Kubernetes
Debugging Commands
Diagnose and fix issues in your cluster. Learn to inspect events, debug pods, analyze logs, and troubleshoot common Kubernetes problems effectively.
14 commands
Pro Tips
Use 'kubectl describe pod' - the Events section shows why a pod isn't running or is failing.
For crash loops, check 'kubectl logs pod --previous' to see logs from the crashed container.
Use ephemeral debug containers: 'kubectl debug pod -it --image=busybox' for live debugging.
Common Mistakes
Events are deleted after 1 hour by default. Check them quickly after an issue occurs.
Debug containers run in the same pod context - be careful with access to sensitive data and networks.