First Steps
When a pod is not running, start here:
# What state is it in?
kubectl get pods
# Why?
kubectl describe pod <pod-name>
# What did the app say?
kubectl logs <pod-name>
# Previous crash logs
kubectl logs <pod-name> --previousCrashLoopBackOff
The container starts, crashes, and Kubernetes keeps restarting it.
Check logs:
kubectl logs <pod-name> --previousCommon causes: - Application error (check stack trace in logs) - Missing environment variable or config - Wrong command or entrypoint
Quick debug — run a shell instead:
kubectl run debug --image=<your-image> --rm -it -- /bin/shImagePullBackOff
Kubernetes cannot pull the container image.
kubectl describe pod <pod-name> | grep -A5 "Events"Fixes: - Wrong image name: check for typos in the deployment spec - Private registry: create an image pull secret
kubectl create secret docker-registry regcred \
--docker-server=ghcr.io \
--docker-username=<user> \
--docker-password=<token>Add to your pod spec:
spec:
imagePullSecrets:
- name: regcredMaster this topic with hands-on labs
Go beyond reading — build real projects in sandboxed environments with expert video guidance.
Browse Courses →Pending Pod
Pod stays in Pending state — not scheduled to any node.
kubectl describe pod <pod-name> | grep -A10 "Events"Common causes: - Insufficient resources: no node has enough CPU/memory
kubectl describe nodes | grep -A5 "Allocated resources"- Node selector or affinity mismatch: pod requires a label no node has
- PVC not bound: the persistent volume claim is waiting
kubectl get pvcOOMKilled
Container exceeded its memory limit and was killed.
kubectl describe pod <pod-name> | grep -i "oom\|killed\|memory"Fix: increase the memory limit or fix the memory leak:
resources:
requests:
memory: "256Mi"
limits:
memory: "512Mi"Check actual usage:
kubectl top pod <pod-name>Container Won't Start
Exit code 0 but pod keeps restarting — the process exits immediately.
Common fix: your container needs a foreground process. Docker images that work with docker run may exit in Kubernetes because there is no TTY.
# Wrong — exits immediately
command: ["bash", "-c", "echo hello"]
# Right — stays running
command: ["bash", "-c", "echo hello && sleep infinity"]Get weekly IT automation tips
Docker, Ansible, Terraform, MLOps — curated insights delivered to your inbox. No spam.
Subscribe Free →Network Issues
Pod is running but cannot be reached:
# Check service endpoints
kubectl get endpoints <service-name>
# Test from inside the cluster
kubectl run curl --image=curlimages/curl --rm -it -- curl http://<service-name>:<port>
# Check DNS
kubectl run dns --image=busybox --rm -it -- nslookup <service-name>Quick Reference
| Symptom | First Command |
|---|---|
| CrashLoopBackOff | kubectl logs |
| ImagePullBackOff | kubectl describe pod |
| Pending | kubectl describe pod |
| OOMKilled | kubectl top pod |
| Not reachable | kubectl get endpoints |
| Slow startup | kubectl describe pod (check readiness probe) |
Related Posts
- Local Kubernetes with Kind for local testing - Monitoring ML Models in K8s for observability - CI/CD for ML on Kubernetes for deployment pipelines -e ---
Ready to go deeper? Explore our hands-on DevOps courses — from Docker and Terraform to MLflow on Kubernetes.
Ready to learn by doing?
Stop reading tutorials — start building. Expert video courses with hands-on labs in real sandboxed environments.
Related Articles
kubectl Cheat Sheet for DevOps
Essential kubectl commands for pods, deployments, services, logs, and debugging Kubernetes clusters. Copy-paste ready DevOps reference.
Kubernetes Troubleshooting Checklist
Kubernetes troubleshooting checklist. Pod failures, CrashLoopBackOff, networking issues, DNS resolution, and storage fixes.
Podman vs Docker in 2026
Podman and Docker both run containers but differ in architecture. Compare rootless containers, daemon requirements, Compose support, and Kubernetes.
Kubernetes Probes Liveness Readiness
Configure Kubernetes liveness, readiness, and startup probes. HTTP, TCP, exec checks with proper timing and misconfiguration fixes.
Kubernetes RBAC for Beginners
Kubernetes RBAC from scratch. Roles, ClusterRoles, RoleBindings, ServiceAccounts, and practical examples for access control.
Kubernetes Resource Requests Limits
Set Kubernetes CPU and memory requests and limits correctly. QoS classes, OOMKilled troubleshooting, and VPA right-sizing.
Explore topics
Browse more articles on the topics covered here.