April 2018
Intermediate to advanced
468 pages
14h 34m
English
You can also run a job with parallelism. There are two fields in the spec, called completions and parallelism. The completions are set to 1 by default. If you want more than one successful completion, then increase this value. parallelism determines how many pods to launch. A job will not launch more pods than needed for successful completions, even if the parallelism number is greater.
Let's run another job that just sleeps for 20 seconds until it has three successful completions. We'll use a parallelism factor of 6, but only three pods will be launched:
apiVersion: batch/v1kind: Jobmetadata: name: sleep20spec: completions: 3 parallelism: 6 template: metadata: name: sleep20 spec: containers: - name: sleep20 image: ...
Read now
Unlock full access