Link Search Menu Expand Document

Job

simple.yaml

---
# https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
apiVersion: batch/v1
kind: Job
metadata:
  name: jobs-simple-job
spec:
  template:
    spec:
      restartPolicy: Never
      containers:
        - command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
          image: perl
          name: jobs-simple-container

spec.activeDeadlineSeconds/

timeout.yaml

            ---
# https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
apiVersion: batch/v1
kind: Job
metadata:
  name: jobs-timeout-job
spec:
  activeDeadlineSeconds: 100
  template:
    spec:
      restartPolicy: Never
      containers:
        - command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
          image: perl
          name: jobs-timeout-container
 

spec.ttlSecondsAfterFinished/

timetolive.yaml

            ---
# https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
apiVersion: batch/v1
kind: Job
metadata:
  name: jobs-timetolive-job
spec:
  ttlSecondsAfterFinished: 100
  template:
    spec:
      containers:
        - command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
          image: perl
          name: jobs-timetolive-container
      restartPolicy: Never