← Back to all fixes

Pod stuck in CrashLoopBackOff

The Issue

`kubectl get pods` shows STATUS: CrashLoopBackOff with RESTARTS climbing.

Root Cause

The container inside the pod is crashing. Kubernetes restarts it, it crashes again, and the backoff timer grows. Common causes: app crash on startup, missing env var, wrong command, missing file.

How to Fix
  1. Check logs from the latest crash: `kubectl logs <pod> --previous`
  2. Describe the pod to see events: `kubectl describe pod <pod>`
  3. Common fix 1: add missing env var via ConfigMap or Secret and reference it in the Deployment
  4. Common fix 2: verify the container CMD/entrypoint is correct — test image locally first with `docker run`
  5. Common fix 3: if init containers are defined, check their logs too: `kubectl logs <pod> -c <init-container-name>`