Skip to content

Commit

Permalink
jobs: clarify that there is no restartPolicy for the job itself (#1…
Browse files Browse the repository at this point in the history
…8605)

Sometimes, as it happened to me, a Pod's `restartPolicy` 
is mistakenly taken as the corresponding Job's restart policy.

That was concluded before, here:
https://github.com/kubernetes/community/pull/583/files

The confusion happened here:
kubernetes/kubernetes#30243
kubernetes/kubernetes#43964

And here:
jaegertracing/jaeger-kubernetes#32

This commit tries to clarify that there is no `restartPolicy` for
the job itself, and that using either of `backoffLimit` and
`activeDeadlineSeconds` may result in permanent failure.
  • Loading branch information
jgehrcke authored and k8s-ci-robot committed Jan 15, 2020
1 parent 6275183 commit f6c402a
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -265,6 +265,9 @@ spec:

Note that both the Job spec and the [Pod template spec](/docs/concepts/workloads/pods/init-containers/#detailed-behavior) within the Job have an `activeDeadlineSeconds` field. Ensure that you set this field at the proper level.

Keep in mind that the `restartPolicy` applies to the Pod, and not to the Job itself: there is no automatic Job restart once the Job status is `type: Failed`.
That is, the Job termination mechanisms activated with `.spec.activeDeadlineSeconds` and `.spec.backoffLimit` result in a permanent Job failure that requires manual intervention to resolve.

## Clean Up Finished Jobs Automatically

Finished Jobs are usually no longer needed in the system. Keeping them around in
Expand Down

0 comments on commit f6c402a

Please sign in to comment.