Kubernetes Job: Difference between revisions
Line 11: | Line 11: | ||
A Pod is considered completed, and thus its execution counted against the completion counter only if finishes successfully. This counter can be configured with <code>[[Kubernetes_Job_Manifest#completions|.spec.completions]]</code>. | A Pod is considered completed, and thus its execution counted against the completion counter only if finishes successfully. This counter can be configured with <code>[[Kubernetes_Job_Manifest#completions|.spec.completions]]</code>. | ||
The Job will attempt to restart failed Pods. The number of retires until the attempts are dropped can be configured with <code>[[Kubernetes_Job_Manifest#backoffLimit|.spec.backoffLimit]]<code>. | The Job will attempt to restart failed Pods. The number of retires until the attempts are dropped can be configured with <code>[[Kubernetes_Job_Manifest#backoffLimit|.spec.backoffLimit]]</code>. | ||
=Kubernetes Job Manifest= | =Kubernetes Job Manifest= |
Revision as of 21:07, 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 its execution counted against the completion counter only if finishes successfully. This counter can be configured with .spec.completions
.
The Job will attempt to restart failed Pods. The number of retires until the attempts are dropped can be configured with .spec.backoffLimit
.
Kubernetes Job Manifest
Clean up Finished Jobs Automatically
Jobs that have finished, either "Complete" or "Failed" can be automatically be deleted by using the TTL mechanism provided by the [TTL Controller ]. Set the .spec.ttlSecondsAfterFinished
field in the job manifest. If the field is set to 0, the Job will be eligible to be automatically deleted immediately after it finishes.
apiVersion: batch/v1
kind: Job
spec:
ttlSecondsAfterFinished: 100
...