Skip to content

Commit 4523ca4

Browse files
committed
run init containers as uid 1000
1 parent 4e6ea2e commit 4523ca4

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

hosting/k8s/helm/templates/supervisor.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,17 @@ spec:
7070
{{- end }}
7171
spec:
7272
serviceAccountName: {{ include "trigger-v4.supervisorServiceAccountName" . }}
73-
{{- with .Values.supervisor.podSecurityContext }}
7473
securityContext:
74+
fsGroup: 1000
75+
{{- with .Values.supervisor.podSecurityContext }}
7576
{{- toYaml . | nindent 8 }}
76-
{{- end }}
77+
{{- end }}
7778
initContainers:
7879
- name: init-shared
7980
image: busybox:1.35
80-
command: ['sh', '-c', 'mkdir -p /home/node/shared && chown 1000:1000 /home/node/shared']
81+
command: ['sh', '-c', 'mkdir -p /home/node/shared']
8182
securityContext:
82-
runAsUser: 0
83+
runAsUser: 1000
8384
volumeMounts:
8485
- name: shared
8586
mountPath: /home/node/shared

hosting/k8s/helm/templates/webapp.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,16 @@ spec:
2424
{{- toYaml . | nindent 8 }}
2525
{{- end }}
2626
securityContext:
27-
{{- toYaml .Values.webapp.podSecurityContext | nindent 8 }}
27+
fsGroup: 1000
28+
{{- with .Values.webapp.podSecurityContext }}
29+
{{- toYaml . | nindent 8 }}
30+
{{- end }}
2831
initContainers:
2932
- name: init-shared
3033
image: busybox:1.35
31-
command: ['sh', '-c', 'mkdir -p /home/node/shared && chown 1000:1000 /home/node/shared']
34+
command: ['sh', '-c', 'mkdir -p /home/node/shared']
3235
securityContext:
33-
runAsUser: 0
36+
runAsUser: 1000
3437
volumeMounts:
3538
- name: shared
3639
mountPath: /home/node/shared

0 commit comments

Comments
 (0)