May 2018
Intermediate to advanced
554 pages
13h 51m
English
A Job-like Pod is suitable for testing your containers, which can be used for unit test or integration test; alternatively, it can be used for batch programs:
$ cat job-dpkg.yamlapiVersion: batch/v1kind: Jobmetadata: name: package-checkspec: template: spec: containers: - name: package-check image: ubuntu command: ["dpkg-query", "-l"] restartPolicy: Never
Note that restart policy for Pods created in a Job should be set to Never or OnFailure, since a Job goes to termination once it is completed successfully.
$ kubectl create -f job-dpkg.yamljob.batch "package-check" ...
Read now
Unlock full access