-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathcleanup-cronjob.yaml
More file actions
52 lines (51 loc) · 1.99 KB
/
Copy pathcleanup-cronjob.yaml
File metadata and controls
52 lines (51 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{{- if .Values.cleanup.enabled }}
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ include "runtime-api.fullname" . }}-cleanup
spec:
schedule: {{ .Values.cleanup.schedule | quote }}
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: {{ .Values.jobSettings.successfulJobsHistoryLimit }}
failedJobsHistoryLimit: {{ .Values.jobSettings.failedJobsHistoryLimit }}
jobTemplate:
spec:
activeDeadlineSeconds: {{ .Values.jobSettings.activeDeadlineSeconds }}
template:
spec:
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
serviceAccountName: {{ .Values.serviceAccount.name }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.ingressBase.enabled }}
volumes:
- name: ingress-base-config
configMap:
name: {{ include "runtime-api.fullname" . }}-ingress-base
{{- end }}
containers:
- name: cleanup
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
command: ["python", "cleanup.py"]
env:
{{- include "runtime-api.env" . | nindent 14 }}
- name: DB_POOL_SIZE
value: {{ .Values.database.poolSize.cronjobs | default 2 | quote }}
- name: DB_MAX_OVERFLOW
value: {{ .Values.database.maxOverflow.cronjobs | default 5 | quote }}
- name: RUNTIME_IDLE_SECONDS
value: {{ .Values.cleanup.idle_seconds | default 1800 | quote }}
{{- if .Values.ingressBase.enabled }}
volumeMounts:
- name: ingress-base-config
mountPath: /ingress-base
{{- end }}
resources:
{{- toYaml .Values.jobSettings.resources | nindent 14 }}
restartPolicy: OnFailure
{{- end }}