File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ type: application
9
9
# This is the chart version. This version number should be incremented each time you make changes
10
10
# to the chart and its templates, including the app version.
11
11
# Versions are expected to follow Semantic Versioning (https://semver.org/)
12
- version : 0.0.3
12
+ version : 0.0.4
13
13
14
14
# This is the version number of the application being deployed. This version number should be
15
15
# incremented each time you make changes to the application. Versions are not expected to
16
16
# follow Semantic Versioning. They should reflect the version the application is using.
17
17
# It is recommended to use it with quotes.
18
- appVersion : " 0.3 .0"
18
+ appVersion : " 0.6 .0"
Original file line number Diff line number Diff line change
1
+ {{- if .Values.cleanupConfig.enabled -}}
2
+ apiVersion : batch/v1beta1
3
+ kind : CronJob
4
+ metadata :
5
+ name : {{ include "app.fullname" . }}-cleanup
6
+ spec :
7
+ schedule : {{ .Values.cleanupConfig.schedule }}
8
+ concurrencyPolicy : {{ .Values.cleanupConfig.concurrencyPolicy }}
9
+ jobTemplate :
10
+ spec :
11
+ template :
12
+ spec :
13
+ containers :
14
+ - name : {{ include "app.fullname" . }}-cleanup
15
+ image : {{ .Values.cleanupConfig.image }}
16
+ envFrom :
17
+ - configMapRef :
18
+ name : {{ template "app.fullname" . }}
19
+ env :
20
+ - name : QUERIES
21
+ value : " {{- range .Values.cleanupConfig.queries -}} {{.}} {{- end }}"
22
+ command : ["sh", "-c", "set -x; echo $QUERIES; psql $OPTIMUS_SERVE_DB_DSN -c \"$QUERIES\";"]
23
+ restartPolicy : {{ .Values.cleanupConfig.restartPolicy }}
24
+ {{- end }}
Original file line number Diff line number Diff line change @@ -68,6 +68,18 @@ config:
68
68
69
69
secretConfig : {}
70
70
71
+ cleanupConfig :
72
+ enabled : true
73
+ schedule : " 0 0 1 * *" # Runs At 00:00 on day-of-month 1
74
+ image : " postgres:15.2-alpine3.17"
75
+ restartPolicy : OnFailure
76
+ concurrencyPolicy : Forbid
77
+ queries :
78
+ - " delete from sensor_run where start_time < now() - Interval '30d';"
79
+ - " delete from task_run where start_time < now() - Interval '30d';"
80
+ - " delete from hook_run where start_time < now() - Interval '30d';"
81
+ - " delete from job_run where start_time < now() - Interval '60d';"
82
+
71
83
service :
72
84
type : ClusterIP
73
85
ports :
You can’t perform that action at this time.
0 commit comments