Kubernetes Job Manifest

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

External

Internal

Example

apiVersion: batch/v1
kind: Job
metadata:
  name: test-job
spec:
  completions: 1
  backoffLimit: 0
  template:
    spec:
      restartPolicy: Never
      containers:
      - name: test-container
        image: docker.com/some-image:1.0.0
        command: ["some-command", "test"]

.metadata Elements

.spec Elements

completions

backoffLimit

Specifies the number of retries before marking this job failed. Defaults to 6. Retries are counted in addition to the initial execution.

The Pod template

restartPolicy

Only a RestartPolicy equal to Never or OnFailure is allowed.