Skip to content

Commit

Permalink
Set fsGroup by default, add initContainer when persistence is enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
tess-ten7 committed Feb 8, 2024
1 parent 2dd880d commit 0d2dbb7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions charts/pantheon-backup/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ spec:
serviceAccountName: {{ include "pantheon-backup.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 12 }}
{{- if .Values.persistence.enabled }}
initContainers:
- name: fix-pvc-permissions
image: alpine
command:
- "sh"
- "-c"
- "chown -R 1000:1000 /backups"
volumeMounts:
- name: cache
mountPath: /backups
{{- end }}
containers:
- name: {{ .Chart.Name }}
securityContext:
Expand Down
4 changes: 2 additions & 2 deletions charts/pantheon-backup/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ serviceAccount:
# If not set and create is true, a name is generated using the fullname template
name:

podSecurityContext: {}
# fsGroup: 2000
podSecurityContext:
fsGroup: 1000

securityContext: {}
# capabilities:
Expand Down

0 comments on commit 0d2dbb7

Please sign in to comment.