Debugging Pods and Containers

A Pod is in CrashLoopBackOff. Restart count: 14. You have no idea what it's doing. The logs exist but they're from the last run, three minutes ago, and they don't explain why the container keeps dying. Where do you start?
The answer is almost always the same: kubectl describe pod. The Events section, six lines at the bottom of the output, tells you more than the logs do in most cases. From there, you have two more tools: kubectl exec to get a shell into a running container, and kubectl debug to get a shell into a container that won't cooperate.
Sign in to access this lesson
Create a free account or sign in to enroll in the CKAD — Certified Kubernetes Application Developer course and access all 44 lessons.
CKAD — Certified Kubernetes Application Developer
44 lessons