diff --git a/charts/sn-platform-slim/templates/bookkeeper/bookkeeper-cluster.yaml b/charts/sn-platform-slim/templates/bookkeeper/bookkeeper-cluster.yaml index 7b9969d50..f742f30a1 100644 --- a/charts/sn-platform-slim/templates/bookkeeper/bookkeeper-cluster.yaml +++ b/charts/sn-platform-slim/templates/bookkeeper/bookkeeper-cluster.yaml @@ -309,8 +309,43 @@ spec: pdb: metadata: name: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}" - {{- with .Values.bookkeeper.customization }} customization: + {{- with .Values.bookkeeper.customization }} {{- toYaml . | nindent 2 -}} {{- end }} + {{- if .Values.zookeeper.customTools.restore.enable}} + - match: + groupVersionKinds: + - kind: Job + name: .*-bk-init + manifest: | + spec: + template: + spec: + initContainers: + - name: pulsar-metadata-cleanup + image: "{{ .Values.images.zookeeper.customTools.restore.repository }}:{{ .Values.images.zookeeper.customTools.restore.tag }}" + command: ["sh", "-c"] + args: + - > + {{- include "pulsar.toolset.zookeeper.tls.settings" . | nindent 12 }} + {{ if and .Values.tls.enabled .Values.tls.zookeeper.enabled }} + export "$(cat conf/pulsar_env.sh | xargs)"; + export OPTS="${PULSAR_EXTRA_OPTS} ${EXTRA_OPTS}"; + env; + {{- end }} + bin/pulsar-metadata-tool cleanup + env: + - name: METADATA_TOOL_CONF + value: "/pulsar-metadata-tool/conf/pulsar-metadata-tool/pulsar-metadata-tool.properties" + - name: EXTRA_OPTS + value: {{ .Values.zookeeper.customTools.restore.configData.OPTS }} + volumeMounts: + - name: cleanup-config + mountPath: /pulsar-metadata-tool/conf/pulsar-metadata-tool + volumes: + - name: cleanup-config + configMap: + name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.customTools.restore.component }}" + {{- end }} {{- end }} diff --git a/charts/sn-platform-slim/templates/broker/broker-cluster.yaml b/charts/sn-platform-slim/templates/broker/broker-cluster.yaml index 72e48c285..e1bc170d1 100644 --- a/charts/sn-platform-slim/templates/broker/broker-cluster.yaml +++ b/charts/sn-platform-slim/templates/broker/broker-cluster.yaml @@ -336,30 +336,6 @@ spec: PULSAR_PREFIX_managedLedgerOffloadServiceEndpoint: "{{ .Values.broker.offload.azureblob.managedLedgerOffloadServiceEndpoint }}" {{- end}} {{- end }} - initJobPod: - {{- if .Values.zookeeper.customTools.restore.enable }} - initContainers: - - name: cleanup - image: "{{ .Values.images.zookeeper.customTools.restore.repository }}:{{ .Values.images.zookeeper.customTools.restore.tag }}" - command: - - bash - - '-c' - args: - - "bin/pulsar-metadata-tool cleanup" - env: - - name: METADATA_TOOL_CONF - value: "/pulsar-metadata-tool/conf/pulsar-metadata-tool/pulsar-metadata-tool.properties" - volumeMounts: - - name: cleanup-config - mountPath: /pulsar-metadata-tool/conf/pulsar-metadata-tool - volumes: - - name: cleanup-config - configMap: - name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.customTools.restore.component }}" - {{- end }} - {{- if .Values.broker.resources }} - resources: {{- toYaml .Values.broker.resources | nindent 10 }} - {{- end }} {{- if or .Values.tls.broker.enabled .Values.broker.extraVolumeMounts .Values.broker.extraVolumeClaimTemplates }} apiObjects: statefulSet: diff --git a/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-statefulset.yaml b/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-statefulset.yaml index 52118d5b2..bcbc7c649 100644 --- a/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-statefulset.yaml +++ b/charts/sn-platform-slim/templates/zookeeper/zookeeper-backup-statefulset.yaml @@ -58,7 +58,7 @@ spec: {{- end }} securityContext: {{- with .Values.zookeeper.securityContext }} - {{ toYaml . | indent 8 }} + {{ toYaml . | nindent 8 }} {{- end }} {{- if .Values.zookeeper.customTools.serviceAccount.use }} serviceAccountName: {{ template "pulsar.zookeeper.backup.serviceAccount" . }} @@ -85,7 +85,7 @@ spec: containers: - name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.customTools.backup.component }}-service" image: "{{ .Values.images.zookeeper.customTools.backup.repository }}:{{ .Values.images.zookeeper.customTools.backup.tag }}" - imagePullPolicy: {{ .Values.zookeeper.customTools.backup.pullPolicy }} + imagePullPolicy: {{ .Values.images.zookeeper.customTools.backup.pullPolicy }} command: ["sh", "-c"] args: - > @@ -163,6 +163,7 @@ spec: initialDelaySeconds: {{ .Values.zookeeper.probe.readiness.initialDelaySeconds }} periodSeconds: {{ .Values.zookeeper.probe.readiness.periodSeconds }} failureThreshold: {{ .Values.zookeeper.probe.readiness.failureThreshold }} + timeoutSeconds: {{ .Values.zookeeper.probe.readiness.timeoutSeconds }} {{- end }} {{- if .Values.zookeeper.probe.liveness.enabled }} livenessProbe: @@ -172,6 +173,7 @@ spec: initialDelaySeconds: {{ .Values.zookeeper.probe.liveness.initialDelaySeconds }} periodSeconds: {{ .Values.zookeeper.probe.liveness.periodSeconds }} failureThreshold: {{ .Values.zookeeper.probe.liveness.failureThreshold }} + timeoutSeconds: {{ .Values.zookeeper.probe.liveness.timeoutSeconds }} {{- end }} {{- if .Values.zookeeper.probe.startup.enabled }} startupProbe: @@ -181,6 +183,7 @@ spec: initialDelaySeconds: {{ .Values.zookeeper.probe.startup.initialDelaySeconds }} periodSeconds: {{ .Values.zookeeper.probe.startup.periodSeconds }} failureThreshold: {{ .Values.zookeeper.probe.startup.failureThreshold }} + timeoutSeconds: {{ .Values.zookeeper.probe.startup.timeoutSeconds }} {{- end }} volumeMounts: {{- include "pulsar.zookeeper.data.volumeMounts" . | nindent 8 }} diff --git a/charts/sn-platform-slim/templates/zookeeper/zookeeper-restore-configmap.yaml b/charts/sn-platform-slim/templates/zookeeper/zookeeper-restore-configmap.yaml index 030575dfa..4523666de 100644 --- a/charts/sn-platform-slim/templates/zookeeper/zookeeper-restore-configmap.yaml +++ b/charts/sn-platform-slim/templates/zookeeper/zookeeper-restore-configmap.yaml @@ -36,5 +36,7 @@ data: managedLedgerPath={{ .Values.zookeeper.customTools.restore.managedLedgerPath }} webServerPort=8088 restoreVersion={{ .Values.zookeeper.customTools.restore.restoreVersion }} + cleanupBookieMeta={{ .Values.zookeeper.customTools.restore.cleanupBookieMeta }} + cleanupClusterMeta={{ .Values.zookeeper.customTools.restore.cleanupClusterMeta }} {{ toYaml .Values.zookeeper.customTools.restore.configData | indent 2 }} {{- end }} \ No newline at end of file diff --git a/charts/sn-platform-slim/values.yaml b/charts/sn-platform-slim/values.yaml index d1174f7b8..6a52c73ab 100644 --- a/charts/sn-platform-slim/values.yaml +++ b/charts/sn-platform-slim/values.yaml @@ -126,9 +126,11 @@ images: backup: repository: "streamnative/pulsar-metadata-tool" tag: "3.1.1.1" + pullPolicy: IfNotPresent restore: repository: "streamnative/pulsar-metadata-tool" tag: "3.1.1.1" + pullPolicy: IfNotPresent bookie: repository: streamnative/sn-platform-slim tag: "3.1.1.1" @@ -583,16 +585,19 @@ zookeeper: failureThreshold: 10 initialDelaySeconds: 10 periodSeconds: 30 + timeoutSeconds: 10 readiness: enabled: true failureThreshold: 10 initialDelaySeconds: 10 periodSeconds: 30 + timeoutSeconds: 10 startup: enabled: false failureThreshold: 30 initialDelaySeconds: 10 periodSeconds: 30 + timeoutSeconds: 10 affinity: anti_affinity: true zone_anti_affinity: true diff --git a/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml b/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml index 4d9d8754b..0b5b29ae5 100644 --- a/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml +++ b/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml @@ -309,8 +309,43 @@ spec: pdb: metadata: name: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}" - {{- with .Values.bookkeeper.customization }} customization: + {{- with .Values.bookkeeper.customization }} {{- toYaml . | nindent 2 -}} {{- end }} + {{- if .Values.zookeeper.customTools.restore.enable}} + - match: + groupVersionKinds: + - kind: Job + name: .*-bk-init + manifest: | + spec: + template: + spec: + initContainers: + - name: pulsar-metadata-cleanup + image: "{{ .Values.images.zookeeper.customTools.restore.repository }}:{{ .Values.images.zookeeper.customTools.restore.tag }}" + command: ["sh", "-c"] + args: + - > + {{- include "pulsar.toolset.zookeeper.tls.settings" . | nindent 12 }} + {{ if and .Values.tls.enabled .Values.tls.zookeeper.enabled }} + export "$(cat conf/pulsar_env.sh | xargs)"; + export OPTS="${PULSAR_EXTRA_OPTS} ${EXTRA_OPTS}"; + env; + {{- end }} + bin/pulsar-metadata-tool cleanup + env: + - name: METADATA_TOOL_CONF + value: "/pulsar-metadata-tool/conf/pulsar-metadata-tool/pulsar-metadata-tool.properties" + - name: EXTRA_OPTS + value: {{ .Values.zookeeper.customTools.restore.configData.OPTS }} + volumeMounts: + - name: cleanup-config + mountPath: /pulsar-metadata-tool/conf/pulsar-metadata-tool + volumes: + - name: cleanup-config + configMap: + name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.customTools.restore.component }}" + {{- end }} {{- end }} diff --git a/charts/sn-platform/templates/broker/broker-cluster.yaml b/charts/sn-platform/templates/broker/broker-cluster.yaml index f6a22c251..f50a697d6 100644 --- a/charts/sn-platform/templates/broker/broker-cluster.yaml +++ b/charts/sn-platform/templates/broker/broker-cluster.yaml @@ -341,30 +341,6 @@ spec: PULSAR_PREFIX_managedLedgerOffloadServiceEndpoint: "{{ .Values.broker.offload.azureblob.managedLedgerOffloadServiceEndpoint }}" {{- end}} {{- end }} - initJobPod: - {{- if .Values.zookeeper.customTools.restore.enable }} - initContainers: - - name: cleanup - image: "{{ .Values.images.zookeeper.customTools.restore.repository }}:{{ .Values.images.zookeeper.customTools.restore.tag }}" - command: - - bash - - '-c' - args: - - "bin/pulsar-metadata-tool cleanup" - env: - - name: METADATA_TOOL_CONF - value: "/pulsar-metadata-tool/conf/pulsar-metadata-tool/pulsar-metadata-tool.properties" - volumeMounts: - - name: cleanup-config - mountPath: /pulsar-metadata-tool/conf/pulsar-metadata-tool - volumes: - - name: cleanup-config - configMap: - name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.customTools.restore.component }}" - {{- end }} - {{- if .Values.broker.resources }} - resources: {{- toYaml .Values.broker.resources | nindent 10 }} - {{- end }} {{- if or .Values.tls.broker.enabled .Values.broker.extraVolumeMounts .Values.broker.extraVolumeClaimTemplates }} apiObjects: statefulSet: diff --git a/charts/sn-platform/templates/zookeeper/zookeeper-backup-statefulset.yaml b/charts/sn-platform/templates/zookeeper/zookeeper-backup-statefulset.yaml index 52118d5b2..ede25c65a 100644 --- a/charts/sn-platform/templates/zookeeper/zookeeper-backup-statefulset.yaml +++ b/charts/sn-platform/templates/zookeeper/zookeeper-backup-statefulset.yaml @@ -58,7 +58,7 @@ spec: {{- end }} securityContext: {{- with .Values.zookeeper.securityContext }} - {{ toYaml . | indent 8 }} + {{ toYaml . | nindent 8 }} {{- end }} {{- if .Values.zookeeper.customTools.serviceAccount.use }} serviceAccountName: {{ template "pulsar.zookeeper.backup.serviceAccount" . }} @@ -163,6 +163,7 @@ spec: initialDelaySeconds: {{ .Values.zookeeper.probe.readiness.initialDelaySeconds }} periodSeconds: {{ .Values.zookeeper.probe.readiness.periodSeconds }} failureThreshold: {{ .Values.zookeeper.probe.readiness.failureThreshold }} + timeoutSeconds: {{ .Values.zookeeper.probe.readiness.timeoutSeconds }} {{- end }} {{- if .Values.zookeeper.probe.liveness.enabled }} livenessProbe: @@ -172,6 +173,7 @@ spec: initialDelaySeconds: {{ .Values.zookeeper.probe.liveness.initialDelaySeconds }} periodSeconds: {{ .Values.zookeeper.probe.liveness.periodSeconds }} failureThreshold: {{ .Values.zookeeper.probe.liveness.failureThreshold }} + timeoutSeconds: {{ .Values.zookeeper.probe.liveness.timeoutSeconds }} {{- end }} {{- if .Values.zookeeper.probe.startup.enabled }} startupProbe: @@ -181,6 +183,7 @@ spec: initialDelaySeconds: {{ .Values.zookeeper.probe.startup.initialDelaySeconds }} periodSeconds: {{ .Values.zookeeper.probe.startup.periodSeconds }} failureThreshold: {{ .Values.zookeeper.probe.startup.failureThreshold }} + timeoutSeconds: {{ .Values.zookeeper.probe.startup.timeoutSeconds }} {{- end }} volumeMounts: {{- include "pulsar.zookeeper.data.volumeMounts" . | nindent 8 }} diff --git a/charts/sn-platform/templates/zookeeper/zookeeper-restore-configmap.yaml b/charts/sn-platform/templates/zookeeper/zookeeper-restore-configmap.yaml index 030575dfa..4523666de 100644 --- a/charts/sn-platform/templates/zookeeper/zookeeper-restore-configmap.yaml +++ b/charts/sn-platform/templates/zookeeper/zookeeper-restore-configmap.yaml @@ -36,5 +36,7 @@ data: managedLedgerPath={{ .Values.zookeeper.customTools.restore.managedLedgerPath }} webServerPort=8088 restoreVersion={{ .Values.zookeeper.customTools.restore.restoreVersion }} + cleanupBookieMeta={{ .Values.zookeeper.customTools.restore.cleanupBookieMeta }} + cleanupClusterMeta={{ .Values.zookeeper.customTools.restore.cleanupClusterMeta }} {{ toYaml .Values.zookeeper.customTools.restore.configData | indent 2 }} {{- end }} \ No newline at end of file diff --git a/charts/sn-platform/values.yaml b/charts/sn-platform/values.yaml index 131d8f5e9..afade0ed9 100644 --- a/charts/sn-platform/values.yaml +++ b/charts/sn-platform/values.yaml @@ -136,9 +136,11 @@ images: backup: repository: "streamnative/pulsar-metadata-tool" tag: "3.1.1.1" + pullPolicy: IfNotPresent restore: repository: "streamnative/pulsar-metadata-tool" tag: "3.1.1.1" + pullPolicy: IfNotPresent bookie: repository: streamnative/sn-platform tag: "3.1.1.1" @@ -658,16 +660,19 @@ zookeeper: failureThreshold: 10 initialDelaySeconds: 10 periodSeconds: 30 + timeoutSeconds: 10 readiness: enabled: true failureThreshold: 10 initialDelaySeconds: 10 periodSeconds: 30 + timeoutSeconds: 10 startup: enabled: false failureThreshold: 30 initialDelaySeconds: 10 periodSeconds: 30 + timeoutSeconds: 10 affinity: anti_affinity: true zone_anti_affinity: true