Skip to content

Commit b3fca9c

Browse files
authored
Add container securityContext (#1252)
1 parent 6db3307 commit b3fca9c

File tree

6 files changed

+18
-4
lines changed

6 files changed

+18
-4
lines changed

charts/sn-platform-slim/templates/toolset/jwt-secret-init-job.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ spec:
6060
- name: "{{ template "pulsar.fullname" . }}-jwt-secret-init"
6161
image: "{{ .Values.images.toolset.repository }}:{{ .Values.images.toolset.tag }}"
6262
imagePullPolicy: {{ .Values.images.toolset.pullPolicy }}
63-
{{- if .Values.toolset.securityContext }}
64-
securityContext: {{- toYaml .Values.toolset.securityContext | nindent 10 }}
63+
{{- if .Values.toolset.containerSecurityContext }}
64+
securityContext: {{- toYaml .Values.toolset.containerSecurityContext | nindent 10 }}
6565
{{- end }}
6666
command: ["bash", "-c"]
6767
args:

charts/sn-platform-slim/templates/toolset/toolset-statefulset.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ spec:
110110
resources:
111111
{{ toYaml .Values.toolset.resources | indent 10 }}
112112
{{- end }}
113+
{{- if .Values.toolset.containerSecurityContext }}
114+
securityContext: {{- toYaml .Values.toolset.containerSecurityContext | nindent 10 }}
115+
{{- end }}
113116
command: ["sh", "-c"]
114117
args:
115118
- >

charts/sn-platform-slim/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,6 +1819,10 @@ toolset:
18191819
runAsUser: 10000
18201820
runAsGroup: 10000
18211821
fsGroup: 10000
1822+
containerSecurityContext:
1823+
runAsNonRoot: true
1824+
runAsUser: 10000
1825+
runAsGroup: 10000
18221826
serviceAccount:
18231827
# Specifies whether to use a service account to run this component
18241828
use: true

charts/sn-platform/templates/toolset/jwt-secret-init-job.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ spec:
6060
- name: "{{ template "pulsar.fullname" . }}-jwt-secret-init"
6161
image: "{{ .Values.images.toolset.repository }}:{{ .Values.images.toolset.tag }}"
6262
imagePullPolicy: {{ .Values.images.toolset.pullPolicy }}
63-
{{- if .Values.toolset.securityContext }}
64-
securityContext: {{- toYaml .Values.toolset.securityContext | nindent 10 }}
63+
{{- if .Values.toolset.containerSecurityContext }}
64+
securityContext: {{- toYaml .Values.toolset.containerSecurityContext | nindent 10 }}
6565
{{- end }}
6666
command: ["bash", "-c"]
6767
args:

charts/sn-platform/templates/toolset/toolset-statefulset.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ spec:
110110
resources:
111111
{{ toYaml .Values.toolset.resources | indent 10 }}
112112
{{- end }}
113+
{{- if .Values.toolset.containerSecurityContext }}
114+
securityContext: {{- toYaml .Values.toolset.containerSecurityContext | nindent 10 }}
115+
{{- end }}
113116
command: ["sh", "-c"]
114117
args:
115118
- >

charts/sn-platform/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1899,6 +1899,10 @@ toolset:
18991899
runAsUser: 10000
19001900
runAsGroup: 10000
19011901
fsGroup: 10000
1902+
containerSecurityContext:
1903+
runAsNonRoot: true
1904+
runAsUser: 10000
1905+
runAsGroup: 10000
19021906
serviceAccount:
19031907
# Specifies whether to use a service account to run this component
19041908
use: true

0 commit comments

Comments
 (0)