Kubernetes 101 : Debugging pods - A short overview -



Different ways for debugging pods:

We could get the logs of a pod using the below command:


Checking the events:

For watching the events "live", so that they would appear on the screen as they happen, we could use the below command:


From these events, we could see whether a pod was not schedulable because of lack of resources, or maybe because its image couldn't be pulled for the repository.

We could also look at all the information related to a pod using the below command:


Also, we could get inside a pod and try to fix the issue, using the below command for example:


Checking services:

We could also check the IP addresses of the endpoints for the pods through the service name, and try to see if they are reachable.
Endpoints could be described as a group of IP addresses that a service forwards its requests to.


For example, for two replicas of a pod, we could get the below endpoints for our nginx service:


We could also get more information about a service using the below command:


Comments

Leave as a comment:

Archive