💥

Pod CrashLoopBackOff

Container starts then exits — check logs and exit code.

Reviewed: ·Tested on: Kubernetes 1.29, Terraform 1.8, Ubuntu 22.04

Symptoms

  • CrashLoopBackOff
  • back-off restarting failed container
  • pod restarting

1Get crash logs

kubectl logs <pod> -n <ns> --previous
kubectl describe pod <pod> -n <ns> | tail -30

2Check events and fix root cause

kubectl get events -n <ns> --field-selector involvedObject.name=<pod>
# Fix: wrong command, missing env, failed health check startup

Related