Skip to content

Commit 248abf7

Browse files
Merge pull request #59 from mage-ai/xiaoyou/provision-volume
[xy] Provision PVC in helm chart
2 parents 189d6d9 + 78a710e commit 248abf7

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed

charts/mageai/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ type: application
7676
# This is the chart version. This version number should be incremented each time you make changes
7777
# to the chart and its templates, including the app version.
7878
# Versions are expected to follow Semantic Versioning (https://semver.org/)
79-
version: 0.2.5
79+
version: 0.2.6

charts/mageai/templates/pv.yaml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{{- if and .Values.persistence .Values.persistence.enabled -}}
2+
3+
{{- if not .Values.persistence.dynamicProvisioning }}
4+
apiVersion: v1
5+
kind: PersistentVolume
6+
metadata:
7+
name: pv-{{ include "mageai.fullname" . }}
8+
labels:
9+
deployment: {{ include "mageai.fullname" . }}
10+
spec:
11+
capacity:
12+
storage: {{ .Values.persistence.size}}
13+
volumeMode: Filesystem
14+
accessModes:
15+
- ReadWriteMany
16+
persistentVolumeReclaimPolicy: Retain
17+
storageClassName: {{ .Values.persistence.storageClassName}}
18+
{{- with .Values.persistence.csi }}
19+
csi:
20+
{{- toYaml . | nindent 4 }}
21+
{{- end }}
22+
{{- end }}
23+
24+
---
25+
apiVersion: v1
26+
kind: PersistentVolumeClaim
27+
metadata:
28+
name: pvc-{{ include "mageai.fullname" . }}
29+
spec:
30+
accessModes:
31+
- ReadWriteMany
32+
storageClassName: {{ .Values.persistence.storageClassName}}
33+
resources:
34+
requests:
35+
storage: {{ .Values.persistence.size}}
36+
{{- if not .Values.persistence.dynamicProvisioning }}
37+
selector:
38+
matchLabels:
39+
deployment: {{ include "mageai.fullname" . }}
40+
{{- end}}
41+
{{- end }}

charts/mageai/values.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,14 @@ extraVolumes:
185185
hostPath:
186186
path: /path/to/mage_project
187187

188+
persistence:
189+
enabled: false
190+
storageClassName: storage-class-name
191+
size: 5Gi
192+
# csi:
193+
# driver: efs.csi.aws.com
194+
# volumeHandle: fs-0123456789
195+
188196
# config: Default configuration for mageai as environment variables. These get injected directly in the container.
189197
config: {}
190198

0 commit comments

Comments
 (0)