Pod not working? Here is a systematic troubleshooting flowchart.
Pod Not Starting¶
kubectl describe pod
Look at the Events section. Most common causes:
- ImagePullBackOff — wrong image name or registry credentials
- Pending — insufficient resources, node selector/affinity
- Init:Error — init container failed
CrashLoopBackOff¶
kubectl logs
- Application error (check the logs)
- Missing config/secret
- Health check failing too quickly
Networking¶
kubectl run debug –rm -it –image=nicolaka/netshoot – /bin/bash
Kubernetes Troubleshooting: Complete Flowchart¶
- Service has no endpoints? → Check label selector
- DNS not working? → nslookup svc.namespace.svc.cluster.local
- NetworkPolicy blocking traffic?
Storage¶
kubectl get pv,pvc
- PVC Pending → StorageClass doesn’t exist or has no provisioner
- Volume mount error → Check permissions
Autoscaling¶
kubectl get hpa
kubectl describe hpa
Procedure¶
describe pod → events → logs → exec into pod → network debug container.