Add init container to DB
This commit is contained in:
parent
4cc3dabc76
commit
b22b692d61
@ -19,11 +19,26 @@ spec:
|
||||
app.kubernetes.io/component: database
|
||||
spec:
|
||||
securityContext:
|
||||
runAsUser: 999
|
||||
runAsNonRoot: true
|
||||
fsGroup: 999
|
||||
initContainers:
|
||||
- name: fix-permissions
|
||||
image: busybox:latest
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
chown -R 999:999 /var/lib/postgresql/data
|
||||
chmod 700 /var/lib/postgresql/data
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
containers:
|
||||
- name: postgres
|
||||
securityContext:
|
||||
runAsUser: 999
|
||||
runAsNonRoot: true
|
||||
image: "{{ .Values.postgres.image.repository }}:{{ .Values.postgres.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.postgres.image.pullPolicy }}
|
||||
ports:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user