There's no way to stop a job from restarting forever on failure, documentation is wrongΒ #39578
Description
Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.): No
What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.): jobs, activeDeadlineSeconds, restartPolicy
Is this a BUG REPORT or FEATURE REQUEST? (choose one):
Kubernetes version (use kubectl version
): Client Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.6", GitCommit:"e569a27d02001e343cb68086bc06d47804f62af6", GitTreeState:"clean", BuildDate:"2016-11-12T05:22:15Z", GoVersion:"go1.7.1", Compiler:"gc", Platform:"darwin/amd64"}
Environment:
- Cloud provider or hardware configuration: GCE
- OS (e.g. from /etc/os-release): macos
- Kernel (e.g.
uname -a
): darwin - Install tools: N/A
- Others: N/A
What happened:
Created a job, specified activeDeadlineSeconds as per documentation which explicitly says:
However, if you prefer not to retry forever, you can set a deadline on the job. Do this by setting the spec.activeDeadlineSeconds field of the job to a number of seconds. The job will have status with reason: DeadlineExceeded. No more pods will be created, and existing pods will be deleted.
What happened instead:
What you expected to happen:
Job to not restart when DeadlineExceeded
exceeded as per documentation.
How to reproduce it (as minimally and precisely as possible):
Create a job that exits with greater than exit code 0.
Anything else do we need to know:
Related issues:
More...