Kubernetes Job Manifest: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 6: Line 6:
=Overview=
=Overview=


A Kubernetes Job is a workload resource that can be used to start and track to successful completion Pods. A Pod is considered executed, and thus counted against the completion counter only if finishes successfully. The job can be configured to manage a specific number of successful executions with <code>[[Kubernetes_Job_Manifest#completions|.spec.completions]]</code>.
A Kubernetes Job is a workload resource that can be used to start and manage Pods to successful completion. A Pod is considered completed, and thus counted against the completion counter only if finishes successfully. The job can be configured to manage a specific number of successful executions with <code>[[Kubernetes_Job_Manifest#completions|.spec.completions]]</code>.


=Example=
=Example=

Revision as of 21:03, 14 July 2023

External

Internal

Overview

A Kubernetes Job is a workload resource that can be used to start and manage Pods to successful completion. A Pod is considered completed, and thus counted against the completion counter only if finishes successfully. The job can be configured to manage a specific number of successful executions with .spec.completions.

Example

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

.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.