Kubernetes POD Troubleshooting Techniques

From Mumshad Mannambeth

  1. Check logs: Use ‘kubectl logs

  2. Analyze Pod Status: Use ‘kubectl get pod ’ and examine the status fields

  3. Describe Pod: Execute ‘kubectl describe pod

  4. Verify Pod Configuration: Review the pod’s YAML configuration using ‘kubectl get pod -o yaml'

  5. Check Events: Run ‘kubectl get events’

  6. Validate Container Images: Check image availability and version in the pod’s YAML using “kubectl get pod -o=jsonpath='{.spec.containers[*].image}'."

  7. Restart Pod: Use ‘kubectl rollout restart deployment/

  8. Review Service Dependencies: Analyze dependencies in the YAML or documentation to ensure required services are available and running

  9. Check Network Connectivity: Get a shell in the running container: ‘kubectl exec -it -- sh’

Use ‘ping’ or ‘curl’ to test network connectivity: ‘ping ’ ‘curl

  1. Inspect Resource Usage: Utilize ‘kubectl top pod

  2. Check Probes: Execute ‘kubectl describe pod

Look for the “LivenessProbe”, “ReadinessProbe”, and “StartupProbe” sections to see if the probes are passing or failing.

  1. Compare Recent Deployment with Current Version: Use the following commands: ‘kubectl rollout history deployment/ --revision=’ ‘kubectl rollout history deployment/ --revision=


Comments

Kubectl get events propably the underrated superhero.