Skip to content

Commit

Permalink
operator bookkeeper-operator (0.17.7)
Browse files Browse the repository at this point in the history
  • Loading branch information
streamnativebot authored Oct 19, 2023
1 parent c6400d8 commit 4c47b30
Show file tree
Hide file tree
Showing 8 changed files with 9,726 additions and 0 deletions.
21 changes: 21 additions & 0 deletions operators/bookkeeper-operator/0.17.7/bundle.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM scratch

# Core bundle labels.
LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=bookkeeper-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha,beta,stable
LABEL operators.operatorframework.io.bundle.channel.default.v1=alpha
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.23.0
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v2

# Labels for testing.
LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1
LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/

# Copy files to locations specified by labels.
COPY bundle/manifests /manifests/
COPY bundle/metadata /metadata/
COPY bundle/tests/scorecard /tests/scorecard/
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
apiVersion: v1
data:
defaultConfig: |-
match:
name: ".*-auto-recovery-config"
groupVersionKinds:
- kind: ConfigMap
manifest: |-
#! template=true
data:
{{ defaultConfig .origin.data "lostBookieRecoveryDelay" "600" }}
defaultJVMOptions: |-
match:
name: ".*-auto-recovery-config"
groupVersionKinds:
- kind: ConfigMap
manifest: |-
#! template=true
{{- if not .owner.spec.autoRecovery.pod.jvmOptions }}
{{- $mem := 0 }}
{{- with .owner.spec.autoRecovery.pod.resources }}
{{- if .limits.memory }}
{{ $mem = parseMemoryMiB .limits.memory }}
{{- else if .requests.memory }}
{{ $mem = parseMemoryMiB .requests.memory }}
{{- end }}
{{- end }}
{{- if eq $mem 0 }}
{{ $mem = parseMemoryMiB "1.5Gi" }}
{{- end }}
{{- if gt $mem 0 }}
{{- $heapSize := mulf $mem 0.3 | int64 }}
{{- $directMem := mulf $mem 0.66 | int64 }}
data:
BOOKIE_MEM: "-Xms{{ $heapSize }}m -Xmx{{ $heapSize }}m -XX:MaxDirectMemorySize={{ $directMem }}m"
{{- end }}
{{- end }}
defaultResources: |-
match:
name: ".*-auto-recovery"
groupVersionKinds:
- kind: StatefulSet
manifest: |-
#! template=true
{{- if not .owner.spec.autoRecovery.pod.resources }}
spec:
template:
spec:
initContainers:
- name: sysctl-init
resources:
requests:
cpu: 100m
memory: 1.2Gi
limits:
cpu: 1
memory: 1.5Gi
containers:
- name: bookie-recovery
resources:
requests:
cpu: 100m
memory: 1.2Gi
limits:
cpu: 1
memory: 1.5Gi
{{- end }}
prometheusAnnotations: |-
match:
name: ".*-auto-recovery"
groupVersionKinds:
- kind: StatefulSet
manifest: |-
#! template=true
{{- if index .origin.spec.template.metadata.annotations "prometheus.io/port" | not }}
spec:
template:
metadata:
annotations:
prometheus.io/port: "8000"
prometheus.io/scrape: "true"
{{- end }}
kind: ConfigMap
metadata:
labels:
cloud.streamnative.io/customization-kind: BookKeeperCluster
name: bookkeeper-operator-autorecovery-default-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app: bookkeeper-operator
control-plane: controller-manager
name: bookkeeper-operator-controller-manager-metrics-service
spec:
ports:
- name: https
port: 8443
targetPort: https
selector:
app: bookkeeper-operator
control-plane: controller-manager
status:
loadBalancer: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: bookkeeper-operator-metrics-reader
rules:
- nonResourceURLs:
- /metrics
verbs:
- get
Loading

0 comments on commit 4c47b30

Please sign in to comment.