January 2019
Intermediate to advanced
484 pages
11h 48m
English
Users can also decide the number of tasks that should be finished in a single Job. This is helpful for solving some random sampling problems. Let's reuse the previous template and add spec.completions to see the differences:
$ cat repeat-job.yaml apiVersion: batch/v1kind: Jobmetadata: name: package-check-repeatspec: activeDeadlineSeconds: 60 completions: 3 template: spec: containers: - name: package-check-repeat image: ubuntu command: ["dpkg-query", "-l"] restartPolicy: Never$ kubectl create -f repeat-job.yaml job.batch/package-check-repeat created$ kubectl get podsNAME READY STATUS RESTARTS AGEpackage-check-7tfkt 0/1 Completed 0 52mpackage-check-repeat-vl988 0/1 Completed 0 7spackage-check-repeat-flhz9 ...
Read now
Unlock full access