How do you troubleshoot a pod that's not starting?

Beginner

Answer

Systematic troubleshooting approach:

# Check pod status
kubectl get pods -o wide
# Describe pod for events
kubectl describe pod <pod-name>
# Check logs
kubectl logs <pod-name>
# Check previous container logs if restarting
kubectl logs <pod-name> --previous
# Check node resources
kubectl top nodes
kubectl describe node <node-name>

Common issues:

  • Image pull errors: Check image name, registry access, secrets
  • Resource constraints: Insufficient CPU/memory on nodes
  • Configuration errors: Invalid environment variables, missing secrets
  • Network issues: DNS resolution, service connectivity