How Do You Troubleshoot Kubernetes when the Pods Are Not Working Correctly?

Problem scenario
You deployment Kubernetes. You used "kubectl create" to deploy some pods. Pods are not getting IP addresses and the status is Pending. What do you do?

Solution

  1. Run a command like this (but replace "foobar" with the namespace of the Kubernetes pods you are trying to troubleshoot):
kubectl get all -n foobar
  1. The above command should list relevant deployment names or pod names. Now you can construct this command (but replace "foobar" with the namespace name and "abcd1234" with the name of the pod or deployment):
kubectl -n foobar describe pod abcd1234

The above command's results should help. If you see "Warning FailedScheduling 34s (x5 over 6m18s) default-scheduler no nodes available to schedule pods", see this posting.

  1. Verify your nodes are healthy with this command: kubectl get nodes

Leave a comment

Your email address will not be published. Required fields are marked *