Init:CrashLoopBackOff
KubernetesERRORCommonPod StateHIGH confidence

Init container is crashing repeatedly

Production Risk

Application container never starts; pod contributes zero capacity.

What this means

Init:CrashLoopBackOff means an init container is failing repeatedly and Kubernetes is backing off restarts with exponential delay. Because init containers must complete successfully before app containers start, the main application never launches. This completely blocks the pod from becoming Ready.

Why it happens
  1. 1Init container script fails due to missing dependency or service not yet available
  2. 2Database or external service that init container waits for is down
  3. 3Wrong credentials or permissions used by the init container
  4. 4Bug in the init container logic causing non-zero exit
How to reproduce

Pod stuck in Init:CrashLoopBackOff; main application container has not started.

trigger — this will error
trigger — this will error
kubectl get pods
# NAME    READY   STATUS                  RESTARTS   AGE
# mypod   0/1     Init:CrashLoopBackOff   5          10m

kubectl logs mypod -c init-container-name --previous

expected output

NAME    READY   STATUS                  RESTARTS   AGE
mypod   0/1     Init:CrashLoopBackOff   5          10m

Fix 1

Read init container logs

WHEN Always first step

Read init container logs
# List init containers
kubectl describe pod mypod | grep -A 5 "Init Containers:"

# Read logs from the specific init container
kubectl logs mypod -c my-init-container --previous

Why this works

Init container logs reveal why the init step is failing.

Fix 2

Verify dependency availability

WHEN Init container waits for a database or service

Verify dependency availability
# Test connectivity from inside the cluster
kubectl run nettest --image=busybox --restart=Never -it --rm --   wget -qO- http://my-service:5432

Why this works

Confirms whether the dependency the init container requires is reachable.

Sources
Official documentation ↗

Kubernetes Documentation

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All Kubernetes errors