From 35478feb209199b8e24d4bdbb015d7adbc61de48 Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Mon, 29 Aug 2022 11:31:55 +0200 Subject: [PATCH] chore(helm): sharing chalice nfs folder Signed-off-by: rjshrjndrn --- .../charts/chalice/templates/deployment.yaml | 21 +++++++++++++++++-- .../openreplay/charts/chalice/values.yaml | 8 +++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml index 4491a82e4..9642c53ce 100644 --- a/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml @@ -106,16 +106,33 @@ spec: containerPort: {{ $val }} protocol: TCP {{- end }} - {{- with .Values.persistence.mounts }} volumeMounts: + - name: datadir + mountPath: /mnt/efs + {{- with .Values.persistence.mounts }} {{- toYaml . | nindent 12 }} {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} - {{- with .Values.persistence.volumes }} + {{- if eq .Values.pvc.name "hostPath" }} volumes: + - name: datadir + hostPath: + # Ensure the file directory is created. + path: {{ .Values.pvc.hostMountPath }} + type: DirectoryOrCreate + {{- with .Values.persistence.volumes }} + {{- toYaml . | nindent 6 }} + {{- end }} + {{- else }} + volumes: + - name: datadir + persistentVolumeClaim: + claimName: {{ .Values.pvc.name }} + {{- with .Values.persistence.volumes }} {{- toYaml . | nindent 8 }} {{- end }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/scripts/helmcharts/openreplay/charts/chalice/values.yaml b/scripts/helmcharts/openreplay/charts/chalice/values.yaml index 2c9d75040..98a01ab8b 100644 --- a/scripts/helmcharts/openreplay/charts/chalice/values.yaml +++ b/scripts/helmcharts/openreplay/charts/chalice/values.yaml @@ -122,6 +122,14 @@ healthCheck: timeoutSeconds: 10 +pvc: + # This can be either persistentVolumeClaim or hostPath. + # In case of pvc, you'll have to provide the pvc name. + # For example + # name: openreplay-efs + name: hostPath + hostMountPath: /openreplay/storage/nfs + persistence: {} # # Spec of spec.template.spec.containers[*].volumeMounts # mounts: