File tree Expand file tree Collapse file tree 5 files changed +125
-0
lines changed
content/bn/examples/application/job Expand file tree Collapse file tree 5 files changed +125
-0
lines changed Original file line number Diff line number Diff line change
1
+ apiVersion : batch/v1
2
+ kind : CronJob
3
+ metadata :
4
+ name : hello
5
+ spec :
6
+ schedule : " * * * * *"
7
+ jobTemplate :
8
+ spec :
9
+ template :
10
+ spec :
11
+ containers :
12
+ - name : hello
13
+ image : busybox:1.28
14
+ imagePullPolicy : IfNotPresent
15
+ command :
16
+ - /bin/sh
17
+ - -c
18
+ - date; echo Hello from the Kubernetes cluster
19
+ restartPolicy : OnFailure
Original file line number Diff line number Diff line change
1
+ apiVersion : batch/v1
2
+ kind : Job
3
+ metadata :
4
+ name : ' indexed-job'
5
+ spec :
6
+ completions : 5
7
+ parallelism : 3
8
+ completionMode : Indexed
9
+ template :
10
+ spec :
11
+ restartPolicy : Never
12
+ containers :
13
+ - name : ' worker'
14
+ image : ' docker.io/library/busybox'
15
+ command :
16
+ - " rev"
17
+ - " /input/data.txt"
18
+ volumeMounts :
19
+ - mountPath : /input
20
+ name : input
21
+ volumes :
22
+ - name : input
23
+ downwardAPI :
24
+ items :
25
+ - path : " data.txt"
26
+ fieldRef :
27
+ fieldPath : metadata.annotations['batch.kubernetes.io/job-completion-index']
Original file line number Diff line number Diff line change
1
+ apiVersion : batch/v1
2
+ kind : Job
3
+ metadata :
4
+ name : ' indexed-job'
5
+ spec :
6
+ completions : 5
7
+ parallelism : 3
8
+ completionMode : Indexed
9
+ template :
10
+ spec :
11
+ restartPolicy : Never
12
+ initContainers :
13
+ - name : ' input'
14
+ image : ' docker.io/library/bash'
15
+ command :
16
+ - " bash"
17
+ - " -c"
18
+ - |
19
+ items=(foo bar baz qux xyz)
20
+ echo ${items[$JOB_COMPLETION_INDEX]} > /input/data.txt
21
+ volumeMounts :
22
+ - mountPath : /input
23
+ name : input
24
+ containers :
25
+ - name : ' worker'
26
+ image : ' docker.io/library/busybox'
27
+ command :
28
+ - " rev"
29
+ - " /input/data.txt"
30
+ volumeMounts :
31
+ - mountPath : /input
32
+ name : input
33
+ volumes :
34
+ - name : input
35
+ emptyDir : {}
Original file line number Diff line number Diff line change
1
+ apiVersion : batch/v1
2
+ kind : Job
3
+ metadata :
4
+ name : myjob
5
+ spec :
6
+ template :
7
+ spec :
8
+ containers :
9
+ - name : myjob
10
+ image : alpine:latest
11
+ command : ['sh', '-c', 'echo "logging" > /opt/logs.txt']
12
+ volumeMounts :
13
+ - name : data
14
+ mountPath : /opt
15
+ initContainers :
16
+ - name : logshipper
17
+ image : alpine:latest
18
+ restartPolicy : Always
19
+ command : ['sh', '-c', 'tail -F /opt/logs.txt']
20
+ volumeMounts :
21
+ - name : data
22
+ mountPath : /opt
23
+ restartPolicy : Never
24
+ volumes :
25
+ - name : data
26
+ emptyDir : {}
Original file line number Diff line number Diff line change
1
+ apiVersion : batch/v1
2
+ kind : Job
3
+ metadata :
4
+ name : process-item-$ITEM
5
+ labels :
6
+ jobgroup : jobexample
7
+ spec :
8
+ template :
9
+ metadata :
10
+ name : jobexample
11
+ labels :
12
+ jobgroup : jobexample
13
+ spec :
14
+ containers :
15
+ - name : c
16
+ image : busybox:1.28
17
+ command : ["sh", "-c", "echo Processing item $ITEM && sleep 5"]
18
+ restartPolicy : Never
You can’t perform that action at this time.
0 commit comments