From 30fa5387fa1563509291c3fe47f1eccb850917b4 Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Mon, 16 Jan 2023 17:57:38 +0100 Subject: [PATCH] chore(helm): Change permission of efs in init func Signed-off-by: rjshrjndrn --- scripts/helmcharts/openreplay/templates/job.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/helmcharts/openreplay/templates/job.yaml b/scripts/helmcharts/openreplay/templates/job.yaml index aaadc2eb7..50a234904 100644 --- a/scripts/helmcharts/openreplay/templates/job.yaml +++ b/scripts/helmcharts/openreplay/templates/job.yaml @@ -70,9 +70,13 @@ spec: echo "Copying enterprise code" cp -rf ee/scripts/* scripts/ fi + echo "Changing RWX to proper permission" + chown 1001:1001 /mnt/efs volumeMounts: - name: shared mountPath: /opt/openreplay + - name: datadir + mountPath: /mnt/efs containers: - name: postgres env: @@ -267,5 +271,16 @@ spec: name: db-migration-script - name: shared emptyDir: {} + {{- if eq .Values.global.pvcRWXName "hostPath" }} + - name: datadir + hostPath: + # Ensure the file directory is created. + path: /mnt/efs + type: DirectoryOrCreate + {{- else }} + - name: datadir + persistentVolumeClaim: + claimName: "{{ .Values.global.pvcRWXName }}" + {{- end }} restartPolicy: Never {{- end}}