Skip to content

Commit

Permalink
[xy] Support provisioning PVC in helm chart.
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxiaoyou1993 committed Jul 11, 2024
1 parent 189d6d9 commit 51fe550
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
41 changes: 41 additions & 0 deletions charts/mageai/templates/pv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{- if and .Values.persistence .Values.persistence.enabled -}}

{{- if not .Values.persistence.dynamicProvisioning }}
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-{{ include "mageai.fullname" . }}
labels:
deployment: {{ include "mageai.fullname" . }}
spec:
capacity:
storage: {{ .Values.persistence.size}}
volumeMode: Filesystem
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
storageClassName: {{ .Values.persistence.storageClassName}}
{{- with .Values.persistence.csi }}
csi:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-{{ include "mageai.fullname" . }}
spec:
accessModes:
- ReadWriteMany
storageClassName: {{ .Values.persistence.storageClassName}}
resources:
requests:
storage: {{ .Values.persistence.size}}
{{- if not .Values.persistence.dynamicProvisioning }}
selector:
matchLabels:
deployment: {{ include "mageai.fullname" . }}
{{- end}}
{{- end }}
8 changes: 8 additions & 0 deletions charts/mageai/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,14 @@ extraVolumes:
hostPath:
path: /path/to/mage_project

persistence:
enabled: false
storageClassName: storage-class-name
size: 5Gi
# csi:
# driver: efs.csi.aws.com
# volumeHandle: fs-0123456789

# config: Default configuration for mageai as environment variables. These get injected directly in the container.
config: {}

Expand Down

0 comments on commit 51fe550

Please sign in to comment.