File tree Expand file tree Collapse file tree 5 files changed +46
-3
lines changed Expand file tree Collapse file tree 5 files changed +46
-3
lines changed Original file line number Diff line number Diff line change 1+ {{- if and .Values.zenml.database.persistence.enabled (not .Values.zenml.database.url) }}
2+ {{- $pvc_name := printf "%s-config" (include "zenml.fullname" .) -}}
3+ {{- $pvc := (lookup "v1" "PersistentVolumeClaim" .Release.Namespace $pvc_name) }}
4+ {{- if not $pvc }}
5+ apiVersion : v1
6+ kind : PersistentVolumeClaim
7+ metadata :
8+ name : {{ $pvc_name }}
9+ labels :
10+ {{- include "zenml.labels" . | nindent 4 }}
11+ annotations :
12+ " helm.sh/hook " : " pre-install,pre-upgrade"
13+ " helm.sh/hook-weight " : " -1"
14+ " helm.sh/hook-delete-policy " : before-hook-creation
15+ spec :
16+ {{- with .Values.zenml.database.persistence.storageClassName }}
17+ storageClassName : {{.}}
18+ {{- end }}
19+ accessModes :
20+ - ReadWriteOnce
21+ resources :
22+ requests :
23+ storage : {{.Values.zenml.database.persistence.size}}
24+ {{- end }}
25+ {{- end }}
Original file line number Diff line number Diff line change 5959 {{- toYaml .Values.podSecurityContext | nindent 8 }}
6060 volumes :
6161 - name : zenml-config
62+ {{- if and .Values.zenml.database.persistence.enabled (not .Values.zenml.database.url) }}
63+ persistentVolumeClaim :
64+ claimName : {{ include "zenml.fullname" . }}-config
65+ {{- else }}
6266 emptyDir : {}
67+ {{- end }}
6368 {{- if eq .Values.zenml.database.backupStrategy "dump-file" }}
6469 # define a volume that will hold a backup of the database
6570 - name : db-backup
@@ -227,4 +232,4 @@ spec:
227232 nodeSelector :
228233 {{- toYaml . | nindent 8 }}
229234 {{- end }}
230- {{- end }}
235+ {{- end }}
Original file line number Diff line number Diff line change 2222 storageClassName : {{ . }}
2323 {{- end }}
2424{{- end }}
25- {{- end }}
25+ {{- end }}
Original file line number Diff line number Diff line change 5959 {{- toYaml .Values.podSecurityContext | nindent 8 }}
6060 volumes :
6161 - name : zenml-config
62+ {{- if and .Values.zenml.database.persistence.enabled (not .Values.zenml.database.url) }}
63+ persistentVolumeClaim :
64+ claimName : {{ include "zenml.fullname" . }}-config
65+ {{- else }}
6266 emptyDir : {}
67+ {{- end }}
6368 {{- if or .Values.zenml.certificates.customCAs .Values.zenml.certificates.secretRefs }}
6469 - name : custom-certs
6570 projected :
Original file line number Diff line number Diff line change @@ -306,11 +306,19 @@ zenml:
306306 enableImplicitAuthMethods : false
307307
308308 # MySQL database configuration. If not set, a local sqlite database will be
309- # used, which will not be persisted across pod restarts .
309+ # used. To ensure data are not lost, check the persistence part .
310310 # NOTE: the certificate files need to be copied in the helm chart folder and
311311 # the paths configured here need to be relative to the root of the helm chart.
312312 database :
313313
314+ # If set to true, path where the local database is created will be
315+ # mounted as a persistent volume so the data is not lost on pod restarts.
316+ # Only relevant for local sqlite database.
317+ persistence :
318+ enabled : false
319+ size : 1Gi
320+ storageClassName : " "
321+
314322 # The database URL. If not set, a local sqlite database will be used, which
315323 # will not be persisted across pod restarts. The URL can contain the
316324 # password or it can be provided in a secret using the `passwordSecretRef`
You can’t perform that action at this time.
0 commit comments