A Pod restart replaces a terminated container when its current state no longer matches the declared desired state. This keeps long-running application components available after an unexpected exit. section 15.2
Use the behavior with these operational expectations:
- Expect repeated replacement containers when a container exits continuously. section 15.2
- Treat CrashLoopBackOff as a warning that failures are occurring too frequently; investigate configuration or application behavior. section 15.2
- Model finite tasks differently instead of using a Pod intended to keep an application running. section 15.2
Watch a restarting Pod
Deploy a Pod with kubectl apply -f, inspect it with kubectl get pods, print its logs with kubectl logs pi, and watch replacements with kubectl get pods --watch.
