diff --git a/helm-charts/stage/templates/deployment.yaml b/helm-charts/stage/templates/deployment.yaml index 1a3e157..93139f4 100644 --- a/helm-charts/stage/templates/deployment.yaml +++ b/helm-charts/stage/templates/deployment.yaml @@ -45,11 +45,14 @@ spec: resources: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.volumeMounts }} + {{- if .Values.persistence.enabled }} volumeMounts: - {{- toYaml . | nindent 12 }} + - name: storage + mountPath: /data {{- end }} - {{- with .Values.volumes }} + {{- if .Values.persistence.enabled }} volumes: - {{- toYaml . | nindent 8 }} + - name: storage + persistentVolumeClaim: + claimName: {{ include "stage.fullname" }}-data {{- end }} diff --git a/helm-charts/stage/templates/pvc.yaml b/helm-charts/stage/templates/pvc.yaml new file mode 100644 index 0000000..815128c --- /dev/null +++ b/helm-charts/stage/templates/pvc.yaml @@ -0,0 +1,17 @@ +{{- if .Values.persistence.enabled }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "stage.fullname" . }}-data + labels: + {{- include "stage.labels" . | nindent 4 }} +spec: + accessModes: + - {{ .Values.persistence.accessMode | quote }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} + {{- if .Values.persistence.storageClass }} + storageClassName: {{ .Values.persistence.storageClass }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/helm-charts/stage/values.yaml b/helm-charts/stage/values.yaml index f75bb31..ebab249 100644 --- a/helm-charts/stage/values.yaml +++ b/helm-charts/stage/values.yaml @@ -64,15 +64,8 @@ resources: {} # cpu: 100m # memory: 128Mi -# Additional volumes on the output Deployment definition. -volumes: [] -# - name: foo -# secret: -# secretName: mysecret -# optional: false - -# Additional volumeMounts on the output Deployment definition. -volumeMounts: [] -# - name: foo -# mountPath: "/etc/foo" -# readOnly: true \ No newline at end of file +persistence: + enabled: false + accessMode: ReadWriteMany + size: 5Gi + # storageClass: "csi-nfs" \ No newline at end of file