diff --git a/charts/mageai/templates/deployment.yaml b/charts/mageai/templates/deployment.yaml index 56e1c9b..9d11bcf 100644 --- a/charts/mageai/templates/deployment.yaml +++ b/charts/mageai/templates/deployment.yaml @@ -118,7 +118,7 @@ spec: value: postgresql://{{ .Values.postgresql.auth.username }}:{{ .Values.postgresql.auth.password }}@{{ .Values.postgresql.fullnameOverride }}:5432/{{ .Values.postgresql.auth.database }} {{- end }} volumeMounts: - {{- if .Values.volumes }} + {{- if or .Values.volumes (and .Values.persistence .Values.persistence.enabled) }} - name: mage-fs mountPath: /home/src {{- else if .Values.extraVolumeMounts }} @@ -140,9 +140,15 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} volumes: + {{- if and .Values.persistence .Values.persistence.enabled }} + - name: mage-fs + persistentVolumeClaim: + claimName: "pvc-{{ include "mageai.fullname" . }}" + {{- end }} {{- if .Values.volumes }} {{- toYaml .Values.volumes | nindent 8 }} - {{- else if .Values.extraVolumes -}} + {{- end }} + {{- if .Values.extraVolumes -}} {{ toYaml .Values.extraVolumes | nindent 8 }} {{- end }} {{- end }} diff --git a/charts/mageai/templates/pv.yaml b/charts/mageai/templates/pv.yaml index 9d9581f..00047ba 100644 --- a/charts/mageai/templates/pv.yaml +++ b/charts/mageai/templates/pv.yaml @@ -12,7 +12,7 @@ spec: storage: {{ .Values.persistence.size}} volumeMode: Filesystem accessModes: - - ReadWriteMany + {{- toYaml .Values.persistence.accessModes | nindent 4 }} persistentVolumeReclaimPolicy: Retain storageClassName: {{ .Values.persistence.storageClassName}} {{- with .Values.persistence.csi }} @@ -28,7 +28,7 @@ metadata: name: pvc-{{ include "mageai.fullname" . }} spec: accessModes: - - ReadWriteMany + {{- toYaml .Values.persistence.accessModes | nindent 4 }} storageClassName: {{ .Values.persistence.storageClassName}} resources: requests: diff --git a/charts/mageai/values.yaml b/charts/mageai/values.yaml index 7830b97..ee8a5c5 100644 --- a/charts/mageai/values.yaml +++ b/charts/mageai/values.yaml @@ -176,19 +176,25 @@ tolerations: [] affinity: {} -extraVolumeMounts: - - name: mage-fs - mountPath: /home/src +# Configure extra volumes. +extraVolumes: [] + # - name: mage-fs + # mountPath: /home/src + +# Configure extra volume mounts to provide persistence for additional paths in the container's file system. +extraVolumeMounts: [] + # - name: mage-fs + # hostPath: + # path: /path/to/mage_project -extraVolumes: - - name: mage-fs - hostPath: - path: /path/to/mage_project persistence: enabled: false storageClassName: storage-class-name size: 5Gi + accessModes: + - ReadWriteMany + # dynamicProvisioning: true # csi: # driver: efs.csi.aws.com # volumeHandle: fs-0123456789