A Job creates one or more Pods and will continue to retry execution of the Pods until a specified number of them successfully terminate. Jobs are useful for batch processing or for one in a time workloads. For recurring jobs see
CronJobs.
PODs in a Job ca be executed in parallel with the parallelism property, also each pod can be assigned an index with thecompletionMode: Indexed .
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 3 POD will be created in sequence, each will have an index at the JOB_COMPLETION_INDEX envvarapiVersion:batch/v1kind:Jobmetadata:name:pispec:completions:3parallelism:1completionMode:Indexedtemplate:spec:containers:- name:piimage:perlcommand:["perl","-Mbignum=bpi","-wle","print bpi(2000)"]restartPolicy:NeverbackoffLimit:4