-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Open
Labels
language/enIssues or PRs related to English languageIssues or PRs related to English languagepriority/backlogHigher priority than priority/awaiting-more-evidence.Higher priority than priority/awaiting-more-evidence.sig/nodeCategorizes an issue or PR as relevant to SIG Node.Categorizes an issue or PR as relevant to SIG Node.triage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.
Description
Problem
The Kubernetes documentation for restartPolicy in Pods (https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy) does not clearly explain the differences in container restart behavior between Always, OnFailure, and Never.
New users are often confused when a pod restarts even after exit code 0 or doesn't restart despite an error, especially when used with Deployments or Jobs.
Steps to Reproduce
- Create a Pod with
restartPolicy: OnFailure - Run a container that exits with code 0
- Notice the pod does not restart
- Change it to exit with code 1 → Now it restarts
Expected Addition to Docs
- Table comparing:
- Exit code vs Restart behavior
- Behavior under different controllers (e.g., Deployment, Job)
- Add concrete YAML examples
- Link to kubelet behavior references
Suggested Fix
I'd like to improve the docs page with:
- A comparison table
- Clear examples of
OnFailure,Always,Never - Add links to the underlying kubelet logic
Let me know if this would be accepted — happy to draft the PR!
Labels: documentation, good first issue, help wanted
Metadata
Metadata
Assignees
Labels
language/enIssues or PRs related to English languageIssues or PRs related to English languagepriority/backlogHigher priority than priority/awaiting-more-evidence.Higher priority than priority/awaiting-more-evidence.sig/nodeCategorizes an issue or PR as relevant to SIG Node.Categorizes an issue or PR as relevant to SIG Node.triage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.