File tree 3 files changed +50
-1
lines changed
3 files changed +50
-1
lines changed Original file line number Diff line number Diff line change @@ -76,4 +76,4 @@ type: application
76
76
# This is the chart version. This version number should be incremented each time you make changes
77
77
# to the chart and its templates, including the app version.
78
78
# Versions are expected to follow Semantic Versioning (https://semver.org/)
79
- version : 0.2.6
79
+ version : 0.2.7
Original file line number Diff line number Diff line change
1
+ {{- if .Values.cleanupJob.enabled -}}
2
+ apiVersion : batch/v1
3
+ kind : CronJob
4
+ metadata :
5
+ name : {{ include "mageai.fullname" . }}-cleanup-job
6
+ spec :
7
+ schedule : " 0 * * * *" # Runs every hour
8
+ jobTemplate :
9
+ spec :
10
+ template :
11
+ spec :
12
+ containers :
13
+ - name : mage-cleanup
14
+ {{- if .Values.image.digest }}
15
+ image : " {{ .Values.image.repository }}@{{ .Values.image.digest }}"
16
+ {{- else }}
17
+ image : " {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
18
+ {{- end }}
19
+ command :
20
+ - /bin/sh
21
+ - -c
22
+ - |
23
+ repo_name="${USER_CODE_PATH:-default_repo}" &&
24
+ mage clean-cached-variables "$repo_name" &&
25
+ mage clean-old-logs "$repo_name"
26
+ env :
27
+ {{- if .Values.env }}
28
+ {{- toYaml .Values.env | nindent 16 }}
29
+ {{- else if .Values.extraEnvs }}
30
+ {{- toYaml .Values.extraEnvs | nindent 16 }}
31
+ {{- end }}
32
+ volumeMounts :
33
+ {{- if .Values.volumes }}
34
+ - name : mage-fs
35
+ mountPath : /home/src
36
+ {{- else if .Values.extraVolumeMounts }}
37
+ {{- toYaml .Values.extraVolumeMounts | nindent 16 }}
38
+ {{- end }}
39
+ restartPolicy : OnFailure
40
+ volumes :
41
+ {{- if .Values.volumes }}
42
+ {{- toYaml .Values.volumes | nindent 12 }}
43
+ {{- else if .Values.extraVolumes -}}
44
+ {{ toYaml .Values.extraVolumes | nindent 12 }}
45
+ {{- end }}
46
+ {{- end }}
Original file line number Diff line number Diff line change @@ -209,3 +209,6 @@ extraEnvs:
209
209
valueFrom :
210
210
fieldRef :
211
211
fieldPath : metadata.namespace
212
+
213
+ cleanupJob :
214
+ enabled : false
You can’t perform that action at this time.
0 commit comments