Init container exited with an error
Production Risk
Application container is completely blocked from starting.
Init:Error means an init container exited with a non-zero code on its first or current attempt, before the backoff timer kicks in (which would show Init:CrashLoopBackOff). The application container is blocked until the init container succeeds. Diagnosis follows the same path as Init:CrashLoopBackOff but represents an earlier stage.
- 1Init container command failed on first execution
- 2Required resource (ConfigMap, Secret, service endpoint) not available
- 3Permission denied when init container tries to modify shared volumes
Pod transitions to Init:Error immediately after the init container exits.
kubectl get pods # NAME READY STATUS RESTARTS AGE # mypod 0/1 Init:Error 0 30s kubectl logs mypod -c init-container-name
expected output
NAME READY STATUS RESTARTS AGE mypod 0/1 Init:Error 0 30s
Fix
Read init container logs immediately
WHEN Pod just entered Init:Error
kubectl logs mypod -c init-container-name kubectl describe pod mypod | grep -A 10 "Init Containers:"
Why this works
Captures logs before the pod is restarted and enters CrashLoopBackOff.
Kubernetes Documentation
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev