Interview Prep/Kubernetes/Pods & Workloads

What is `restartPolicy` and how does CrashLoopBackOff happen?

IntermediateConceptPods & Workloads
Answer

restartPolicy (Always, OnFailure, Never) applies to all containers in the Pod, and the kubelet restarts them locally with exponential back-off (10s, 20s, 40s ... capped at 5 minutes). CrashLoopBackOff means the container keeps exiting and the kubelet is waiting before the next attempt. Check kubectl logs --previous and the exit code.

All Kubernetes questions Roadmap: Kubernetes core

More on Pods & Workloads