diff --git a/charts/sn-platform-slim/templates/bookkeeper/bookkeeper-cluster.yaml b/charts/sn-platform-slim/templates/bookkeeper/bookkeeper-cluster.yaml index ffb9ab0aa..4e7a98800 100644 --- a/charts/sn-platform-slim/templates/bookkeeper/bookkeeper-cluster.yaml +++ b/charts/sn-platform-slim/templates/bookkeeper/bookkeeper-cluster.yaml @@ -364,6 +364,12 @@ spec: env; {{- end }} bin/pulsar-metadata-tool cleanup + {{- if .Values.bookkeeper.initContainerSecurityContext }} + securityContext: {{- toYaml .Values.bookkeeper.initContainerSecurityContext | nindent 16 }} + {{- end }} + {{- if .Values.bookkeeper.resources }} + resources: {{- toYaml .Values.bookkeeper.resources | nindent 16 }} + {{- end }} env: - name: METADATA_TOOL_CONF value: "/pulsar-metadata-tool/conf/pulsar-metadata-tool/pulsar-metadata-tool.properties" diff --git a/charts/sn-platform-slim/templates/zookeeper/zookeeper-cluster.yaml b/charts/sn-platform-slim/templates/zookeeper/zookeeper-cluster.yaml index 7cc548047..800c60bf2 100644 --- a/charts/sn-platform-slim/templates/zookeeper/zookeeper-cluster.yaml +++ b/charts/sn-platform-slim/templates/zookeeper/zookeeper-cluster.yaml @@ -71,6 +71,9 @@ spec: - name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-{{ .Values.zookeeper.customTools.restore.component }}" image: "{{ .Values.images.zookeeper.customTools.restore.repository }}:{{ .Values.images.zookeeper.customTools.restore.tag }}" imagePullPolicy: {{ .Values.zookeeper.customTools.restore.pullPolicy }} + {{- if .Values.zookeeper.initContainerSecurityContext }} + securityContext: {{- toYaml .Values.zookeeper.initContainerSecurityContext | nindent 10 }} + {{- end }} command: ["sh", "-c"] args: - > diff --git a/charts/sn-platform-slim/values.yaml b/charts/sn-platform-slim/values.yaml index 714f22e6a..700b49217 100644 --- a/charts/sn-platform-slim/values.yaml +++ b/charts/sn-platform-slim/values.yaml @@ -639,6 +639,7 @@ zookeeper: advanced: {} securityContext: runAsNonRoot: true + initContainerSecurityContext: {} tolerations: [] gracePeriod: 30 # Resources requests/limits for both init containers and app containers @@ -888,6 +889,7 @@ bookkeeper: annotations: {} securityContext: runAsNonRoot: true + initContainerSecurityContext: {} tolerations: [] gracePeriod: 30 # The minimum number of seconds for new pods to be ready. diff --git a/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml b/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml index 63fd0602a..da43b139c 100644 --- a/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml +++ b/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml @@ -364,6 +364,12 @@ spec: env; {{- end }} bin/pulsar-metadata-tool cleanup + {{- if .Values.bookkeeper.initContainerSecurityContext }} + securityContext: {{- toYaml .Values.bookkeeper.initContainerSecurityContext | nindent 16 }} + {{- end }} + {{- if .Values.bookkeeper.resources }} + resources: {{- toYaml .Values.bookkeeper.resources | nindent 16 }} + {{- end }} env: - name: METADATA_TOOL_CONF value: "/pulsar-metadata-tool/conf/pulsar-metadata-tool/pulsar-metadata-tool.properties" diff --git a/charts/sn-platform/templates/zookeeper/zookeeper-cluster.yaml b/charts/sn-platform/templates/zookeeper/zookeeper-cluster.yaml index 7cc548047..800c60bf2 100644 --- a/charts/sn-platform/templates/zookeeper/zookeeper-cluster.yaml +++ b/charts/sn-platform/templates/zookeeper/zookeeper-cluster.yaml @@ -71,6 +71,9 @@ spec: - name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}-{{ .Values.zookeeper.customTools.restore.component }}" image: "{{ .Values.images.zookeeper.customTools.restore.repository }}:{{ .Values.images.zookeeper.customTools.restore.tag }}" imagePullPolicy: {{ .Values.zookeeper.customTools.restore.pullPolicy }} + {{- if .Values.zookeeper.initContainerSecurityContext }} + securityContext: {{- toYaml .Values.zookeeper.initContainerSecurityContext | nindent 10 }} + {{- end }} command: ["sh", "-c"] args: - > diff --git a/charts/sn-platform/values.yaml b/charts/sn-platform/values.yaml index d9ee05dec..52da8c371 100644 --- a/charts/sn-platform/values.yaml +++ b/charts/sn-platform/values.yaml @@ -714,6 +714,7 @@ zookeeper: advanced: {} securityContext: runAsNonRoot: true + initContainerSecurityContext: {} tolerations: [] gracePeriod: 30 # Resources requests/limits for both init containers and app containers @@ -963,6 +964,7 @@ bookkeeper: annotations: {} securityContext: runAsNonRoot: true + initContainerSecurityContext: {} tolerations: [] gracePeriod: 30 # The minimum number of seconds for new pods to be ready.