-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathcronjob.yml
54 lines (54 loc) · 1.52 KB
/
cronjob.yml
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
{{- if .Values.cronjob.enabled }}
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ .Release.Name }}-cronjob
spec:
concurrencyPolicy: Allow
{{- if .Values.demo.enabled }}
schedule: "*/5 * * * *"
{{- else }}
schedule: "* * * * *"
{{- end }}
suspend: false
startingDeadlineSeconds: 200
jobTemplate:
spec:
parallelism: 1
completions: 1
activeDeadlineSeconds: 540
backoffLimit: 6
template:
metadata:
labels:
app: cronjob
spec:
containers:
- name: compute-pi-digits
image: perl:5.34.0
imagePullPolicy: IfNotPresent
resources:
requests:
cpu: 40m
memory: 15Mi
limits:
cpu: 80m
memory: 30Mi
command:
- perl
- -Mbignum=bpi
- -wle
{{- if .Values.demo.enabled }}
- open(FH, '>', '/output/{{ .Values.fileSystemTest.fileName }}') or die "Cannot open file - $!"; print FH bpi(100); close(FH); print bpi(4000)
{{- else }}
- open(FH, '>', '/output/{{ .Values.fileSystemTest.fileName }}') or die "Cannot open file - $!"; print FH bpi(100); close(FH); print bpi(1500)
{{- end }}
volumeMounts:
- mountPath: /output
name: storage
restartPolicy: OnFailure
volumes:
- name: storage
emptyDir:
sizeLimit: 30Mi
{{- end }}