Newer
Older
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{{- if .Values.mu_cron.enabled }}
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: {{ template "wordpress.fullname" . }}
labels:
app: {{ include "wordpress.name" . }}
chart: {{ include "wordpress.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
{{ toYaml .Values.mu_cron.cronjob.annotations | indent 4 }}
spec:
schedule: "{{ .Values.mu_cron.cronjob.schedule }}"
concurrencyPolicy: Forbid
{{- with .Values.mu_cron.cronjob.failedJobsHistoryLimit }}
failedJobsHistoryLimit: {{ . }}
{{- end }}
{{- with .Values.mu_cron.cronjob.successfulJobsHistoryLimit }}
successfulJobsHistoryLimit: {{ . }}
{{- end }}
jobTemplate:
metadata:
labels:
app.kubernetes.io/name: {{ include "wordpress.name" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "wordpress.name" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
restartPolicy: Never
{{- if (default .Values.image.pullSecrets .Values.mu_cron.cronjob.image.pullSecrets) }}
imagePullSecrets:
{{- range (default .Values.image.pullSecrets .Values.mu_cron.cronjob.image.pullSecrets) }}
- name: {{ . }}
{{- end }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ default .Values.image.repository .Values.mu_cron.cronjob.image.repository }}:{{ default .Values.image.tag .Values.mu_cron.cronjob.image.tag }}"
imagePullPolicy: {{ default .Values.image.pullPolicy .Values.mu_cron.cronjob.image.pullPolicy }}
command: [ "curl" ]
args:
{{- if .Values.mu_cron.cronjob.curlInsecure }}
- "-k"
{{- end }}
- "--fail"
- "-L"
# TODO: How do I send the secret?
- "http://{{ .Release.Service }}/{{ .Values.mu_cron.cronjob.path }}"
resources:
{{ toYaml (default .Values.resources .Values.mu_cron.cronjob.resources) | indent 16 }}
{{- with (default .Values.nodeSelector .Values.mu_cron.cronjob.nodeSelector) }}
nodeSelector:
{{ toYaml . | indent 12 }}
{{- end }}
{{- with (default .Values.affinity .Values.mu_cron.cronjob.affinity) }}
affinity:
{{ toYaml . | indent 12 }}
{{- end }}
{{- with (default .Values.tolerations .Values.mu_cron.cronjob.tolerations) }}
tolerations:
{{ toYaml . | indent 12 }}:
{{- end }}
{{- end }}