Add init container to DB
This commit is contained in:
parent
4cc3dabc76
commit
b22b692d61
@ -19,11 +19,26 @@ spec:
|
|||||||
app.kubernetes.io/component: database
|
app.kubernetes.io/component: database
|
||||||
spec:
|
spec:
|
||||||
securityContext:
|
securityContext:
|
||||||
runAsUser: 999
|
|
||||||
runAsNonRoot: true
|
|
||||||
fsGroup: 999
|
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:
|
containers:
|
||||||
- name: postgres
|
- name: postgres
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 999
|
||||||
|
runAsNonRoot: true
|
||||||
image: "{{ .Values.postgres.image.repository }}:{{ .Values.postgres.image.tag }}"
|
image: "{{ .Values.postgres.image.repository }}:{{ .Values.postgres.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.postgres.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.postgres.image.pullPolicy }}
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user