liveBook · Manning

Backoff limit

As explained in Kubernetes for Developers

A backoff limit is a Job setting that specifies how many execution attempts are allowed before the Job is considered failed.

A backoff limit is a Job setting that limits how many times Kubernetes tries to run the Job before considering it failed. The count includes container crashes and node failures. section 10.2.1

Use the setting alongside the Job’s restart policy:

  • backoffLimit belongs to the Job and counts failed execution attempts. section 10.2.1
  • restartPolicy belongs to the embedded PodSpec and controls whether the kubelet restarts failed containers; Jobs support OnFailure or Never. section 10.2.1

Allow two retries

Set spec.backoffLimit to 2 in a batch/v1 Job. A Job that crashes twice and is then evicted during node maintenance has three counted failures. section 10.2.1

How Kubernetes for Developers covers it

How deep it goes
Defines attempt counting across crashes and node failures, but does not detail retry timing.
Examples
Uses a batch/v1 Job manifest with backoffLimit: 2 and restartPolicy: Never.
What it assumes
Assumes familiarity with Jobs and embedded PodSpecs while explaining their retry-related settings.
What you can do after
Configure a Job’s retry budget and distinguish it from container restart behavior.
How it connects
Connects Job execution with Pod restartPolicy, kubelet behavior, and node failures.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes for Developers. The section links point to the parts of the book it draws on.