File tree Expand file tree Collapse file tree 5 files changed +80
-1
lines changed
Expand file tree Collapse file tree 5 files changed +80
-1
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,31 @@ tabs:
147147 label : Propagate SIGTERM to child processes.
148148 settings :
149149 default : true
150+ - name : persistence_toggle
151+ contents :
152+ - type : heading
153+ label : Persistent Disks
154+ - type : subtitle
155+ label : Attach persistent disks to your job to retain data across runs.
156+ - type : checkbox
157+ label : Enable Persistence
158+ variable : pvc.enabled
159+ - name : persistent_storage
160+ show_if : pvc.enabled
161+ contents :
162+ - type : number-input
163+ label : Persistent Storage
164+ variable : pvc.storage
165+ placeholder : " ex: 20"
166+ settings :
167+ unit : Gi
168+ default : 20
169+ - type : string-input
170+ label : Mount Path
171+ variable : pvc.mountPath
172+ placeholder : " ex: /mypath"
173+ settings :
174+ default : /mypath
150175 - type : heading
151176 label : Image Settings
152177 - type : subtitle
Original file line number Diff line number Diff line change @@ -175,6 +175,11 @@ spec:
175175 readOnly : true
176176 {{ end }}
177177 {{ end }}
178+ {{ if .Values.pvc.enabled }}
179+ volumeMounts :
180+ - name : " {{ include " docker-template.fullname" . }}-storage"
181+ mountPath : {{ .Values.pvc.mountPath }}
182+ {{ end }}
178183 resources :
179184 requests :
180185 cpu : {{ .Values.resources.requests.cpu }}
@@ -245,13 +250,22 @@ spec:
245250 mountPath : /secrets/
246251 readOnly : true
247252 {{ end }}
248- {{ if or .Values.cloudsql.enabled .Values.fileSecretMounts.enabled}}
253+ {{ if or .Values.cloudsql.enabled .Values.fileSecretMounts.enabled .Values.pvc.enabled }}
249254 volumes :
250255 {{ if .Values.cloudsql.enabled }}
251256 - name : " sidecar-volume-{{ include " docker-template.fullname" . }}"
252257 secret :
253258 secretName : " {{ include " cloudsql.serviceAccountJSONSecret" . }}"
254259 {{ end }}
260+ {{ if .Values.pvc.enabled }}
261+ - name : " {{ include " docker-template.fullname" . }}-storage"
262+ persistentVolumeClaim :
263+ {{- if .Values.pvc.existingVolume }}
264+ claimName : {{ .Values.pvc.existingVolume }}
265+ {{- else }}
266+ claimName : " {{ include " docker-template.fullname" . }}-pvc"
267+ {{- end }}
268+ {{ end }}
255269 {{ if .Values.fileSecretMounts.enabled }}
256270 {{ range .Values.fileSecretMounts.mounts }}
257271 - name : {{ .mountPath }}
Original file line number Diff line number Diff line change 1+ {{- if and .Values.pvc.enabled (not .Values.pvc.existingVolume) -}}
2+ apiVersion : v1
3+ kind : PersistentVolumeClaim
4+ metadata :
5+ name : " {{ include " docker-template.fullname" . }}-pvc"
6+ spec :
7+ accessModes :
8+ - ReadWriteOnce
9+ resources :
10+ requests :
11+ storage : {{ .Values.pvc.storage }}
12+ {{ end }}
Original file line number Diff line number Diff line change 6868 }
6969 }
7070 }
71+ },
72+ "pvc" : {
73+ "type" : " object" ,
74+ "properties" : {
75+ "enabled" : {
76+ "type" : " boolean" ,
77+ "default" : false
78+ },
79+ "storage" : {
80+ "type" : " string" ,
81+ "pattern" : " ^\\ d+(Ki|Mi|Gi|Ti)$" ,
82+ "default" : " 20Gi"
83+ },
84+ "mountPath" : {
85+ "type" : " string" ,
86+ "default" : " /mypath"
87+ },
88+ "existingVolume" : {
89+ "type" : " string" ,
90+ "default" : " "
91+ }
92+ }
7193 }
7294 }
7395}
Original file line number Diff line number Diff line change @@ -105,5 +105,11 @@ fileSecretMounts:
105105# enable this conservatively
106106enableHostIpc : false
107107
108+ pvc :
109+ enabled : false
110+ storage : 20Gi
111+ mountPath : /mypath
112+ existingVolume : " "
113+
108114# job timeout configuration
109115activeDeadlineSeconds : # Optional - if not set, will use sidecar.timeout
You can’t perform that action at this time.
0 commit comments