Errors in kubernetes and debugging

Resources:

I recommend that you read the following books and articles to improve your skills in debugging and in debugging kubernetes:

Is the problem in the pod?

The first thing is to check if we are having problems in the pods. The first way to do it is by looking at their status:

kubectl get pods

Look for the status, this will tell you if there is a problem if it is not Running.

Then, look for more information about the pod:

kubectl describe pod [pod-name]

At the end you can see the log of recent events related to your Pod. Based on the event message look for the problem in the Error Messages section.

Also, look at the pod logs with:

kubectl logs pod-name

It is also helpful to connect to the pod and try to see if you can execute commands on it to test, with the kubectl command kubectl exec -it .

To go deeper in this topic please read these articles:

Error Messages

ImagePullBackOff

You can test if the image name is correct with docker in you local machine:

docker pull [repository]/[image]:[tag]

0/1 nodes are available 1 node(s) were unschedulable

This is a problem with the nodes not with the pod. We need to debug the nodes to be available to gather information and understand the problem.

First, let’s the pods status:

kubectl get nodes

Second, let’s check the pods that are not READY:

kubectl describe node [node-name]

Now try to match the output to one of these possibilities:

Possibility 1:

Taint: node.kubernetes.io/unschedulable:NoSchedule

Unschedulable:true

Please refer to this post.

Pending status pod

This example is going to show you how to debug a pending pod

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store