Skip to content

Commit

Permalink
Merge pull request #59 from mage-ai/xiaoyou/provision-volume
Browse files Browse the repository at this point in the history
[xy] Provision PVC in helm chart
  • Loading branch information
wangxiaoyou1993 authored Jul 11, 2024
2 parents 189d6d9 + 78a710e commit 248abf7
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/mageai/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.5
version: 0.2.6
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 248abf7

Please sign in to comment.