DEV Community

Cover image for POD | Kubernetes
Ibrahim S
Ibrahim S

Posted on

POD | Kubernetes

Kubernetes offers powerful tools, but when things go wrong with your pods, the right commands and log locations can save you a ton of time. Here’s a quick guide to some common issues and how to handle them:

Commands to Check Logs:

For specific pod logs:

kubectl logs pod_name container_name

To exec into the pod's container :

kubectl exec pod_name -c container_name -- /bin/sh

Important Log Locations:

/var/log/kube-apiserver.log
/var/log/kube-kubelet.log
/var/log/kube-controller-manager.log

—————————————————————————-

Common Pod Issues:

Pod Stuck in Pending:

Usually resource-related, like insufficient CPU or memory.

Solution: Scale up resources (increase CPU/memory allocation).

Pod in Waiting State:

This is often due to an incorrect or missing image in the YAML file.

Solution: Ensure the image is correct and available in the mentioned repository.

ImagePullBackOff:

Possible causes: wrong image tag, repo authentication failure, or RBAC issues.

Solution: Verify the image name, tag, and authentication.
CrashLoopBackOff:

Typically caused by resource insufficiency or host port conflicts.

Solution: Check resources and network configurations.

Tip: If you see a CreateContainerConfigError, dig deeper into the pod and container logs to understand the root cause.

More POD — Kubernetes

Top comments (0)