What You Will Learn
Intermediate
- Common Pod failure reasons
- How to debug each
- A systematic debugging process
Common Pod Issues
| Status | Cause | Fix |
|---|---|---|
| CrashLoopBackOff | Container crashes on start | Check logs: kubectl logs POD |
| ImagePullBackOff | Cannot pull image | Check image name, registry auth |
| OOMKilled | Out of memory | Increase memory limit |
| Pending | No node can schedule it | Check resources, taints |
| ErrImagePull | Image not found | Check image name and tag |
Debugging Process
kubectl get pods - identify the issue
kubectl describe pod NAME - look at Events section
kubectl logs POD - check application output
kubectl logs POD --previous - check before crash
kubectl exec -it POD -- bash - shell in (if running)
Practical Exercise
Create a Pod with a bad image name (ImagePullBackOff)
Run: kubectl describe pod - see the error
Create a Pod that crashes (exit 1 on start)
Run: kubectl logs POD --previous - see error
Fix the issue and redeploy
Key Takeaways
- CrashLoopBackOff: check kubectl logs.
- ImagePullBackOff: check image name and registry.
- OOMKilled: increase memory limit.
- Pending: check resources, taints, affinity.
- kubectl describe pod: Events section has the answer.
Comments
Comments
Post a Comment