Most people’s first real Kubernetes lesson is a pod stuck in CrashLoopBackOff and no idea where to look. The status names sound alarming, but there are only a handful of common failures, and each one points you to a specific command. Knowing that map turns a confusing hour into a five-minute fix.
The short answer: start with kubectl get pods to see the status, then kubectl describe pod to read the Events at the bottom, then kubectl logs (add --previous if the container restarted). Those three commands explain most failures: image pull errors, crashing apps, pods that cannot be scheduled, failing probes, and Services that send traffic nowhere.
Troubleshooting is the skill interviewers test most with Kubernetes scenarios, and it is where hands-on labs in any DevOps training in Pune pay off. This guide walks through each common failure with the commands to diagnose it.
The three commands to run first
# 1. What state is everything in?
kubectl get pods -n shop -o wide
# 2. Why? Read the Events section at the bottom
kubectl describe pod payments-7c9f8-abcde -n shop
# 3. What did the app itself say?
kubectl logs payments-7c9f8-abcde -n shop
kubectl logs payments-7c9f8-abcde -n shop --previous # the crashed run
describe is the most underused of the three. Its Events list shows scheduling decisions, image pulls, probe failures and kills, in time order, usually with a plain-English reason. Read it before guessing.
ImagePullBackOff and ErrImagePull
The node could not download the container image. The Events will say why. The usual causes are a typo in the image name or tag, a tag that was never pushed, or a private registry with no credentials.
Check the exact image string with kubectl get pod NAME -o jsonpath='{.spec.containers[*].image}' and try pulling it yourself with docker pull. For private registries, create an image pull secret and reference it in the pod spec with imagePullSecrets. Using the commit ID as a tag, as most CI pipelines do, makes missing-tag mistakes easier to spot.
CrashLoopBackOff
The container starts, exits, and Kubernetes keeps restarting it with growing delays. Kubernetes is doing its job here; the problem is inside the app or its configuration. kubectl logs --previous shows what the app printed before it died, which is usually the answer.
Common culprits are a missing environment variable or config file, a database the app cannot reach at startup, a wrong command or entrypoint, or a liveness probe that kills the container before it is ready. If the logs are empty, check describe for the exit code: 1 usually means an app error, 137 means the container was killed, often for memory.
OOMKilled
The container used more memory than its limit, so the kernel killed it. describe shows Last State: Terminated, Reason: OOMKilled and exit code 137. Either the limit is too low for the app’s real usage, or the app has a memory leak.
Check actual usage with kubectl top pod (this needs metrics-server installed). Raise the memory limit if the app genuinely needs more, but if usage climbs steadily until it dies every few hours, the fix belongs in the code, not the YAML.
Pending: the pod never starts
A Pending pod has not been placed on any node. The Events usually say FailedScheduling with a reason such as insufficient CPU or memory, a node selector or affinity rule that no node matches, a taint the pod does not tolerate, or a PersistentVolumeClaim that is not bound.
Compare the pod’s resource requests with what nodes have free using kubectl describe node. Requests that are far higher than the app needs are a frequent cause, especially when copied from an example. For storage, run kubectl get pvc and check that the claim is Bound.
Running but not Ready
The pod shows 0/1 in the READY column. The container is running, but its readiness probe is failing, so the Service will not send it traffic. describe shows lines such as Readiness probe failed: HTTP probe failed with statuscode: 404.
Check that the probe’s path and port match what the app actually serves, and that initialDelaySeconds gives a slow-starting app enough time. A Java service that takes forty seconds to boot with a ten-second probe delay will fail its checks every time.
The Service returns nothing
Pods are healthy, but requests to the Service time out. Nine times out of ten, the Service’s selector does not match the pod labels, so it has no endpoints. Run kubectl get endpoints SERVICE_NAME; an empty list confirms it.
# Do the labels match the selector?
kubectl get svc payments -n shop -o yaml | grep -A3 selector
kubectl get pods -n shop --show-labels
# Test from inside the cluster
kubectl run tmp --rm -it --image=busybox:1.36 -n shop --
wget -qO- http://payments:8080/health
If endpoints exist but traffic still fails, check that the Service’s targetPort matches the port the container listens on, and that a NetworkPolicy is not blocking it. Our guide to networking for DevOps covers ports, DNS and firewalls in more depth.
Other tools worth knowing
kubectl get events --sort-by=.lastTimestampshows recent events across a namespace, useful when you do not know which pod to look at.kubectl exec -it POD -- shopens a shell inside a running container to check files, environment variables and connectivity.kubectl rollout historyandkubectl rollout undoreturn a Deployment to its previous version when a release breaks.- Central logs keep output from pods that have already been replaced; see centralised logging for DevOps.
A habit that speeds everything up
Work from the outside in: status, then events, then logs, then inside the container. Resist the urge to delete and recreate a pod first; that often destroys the evidence. And when you fix something, note the symptom and cause somewhere your team can find it. Most clusters fail in the same few ways over and over.
To practise, break a working Deployment on purpose in a local kind or minikube cluster: misspell the image, set a tiny memory limit, point the readiness probe at a wrong path, change a Service selector. Diagnose each one using only the commands above. If Kubernetes itself is still new, start with Docker vs Kubernetes and come back to this guide afterwards.
Frequently asked questions
What does CrashLoopBackOff mean?
It means the container keeps crashing after it starts, and Kubernetes is waiting longer between each restart. Check kubectl logs with –previous to see why the app exited.
What does exit code 137 mean in Kubernetes?
Exit code 137 means the container was killed with SIGKILL. The most common reason is exceeding its memory limit, shown as OOMKilled in kubectl describe.
How do I see logs from a pod that has been deleted?
kubectl cannot show logs from a deleted pod. You need a central logging system, such as Loki or the ELK stack, that collected the logs while the pod was running.
Why is my pod stuck in Pending?
The scheduler cannot find a suitable node. The Events in kubectl describe pod give the reason, usually insufficient CPU or memory, an unmatched node selector, a taint, or an unbound volume claim.




