Error Codes Wiki

Kubernetes CrashLoopBackOff — Pod Restart Loop and Container Crash Debugging

Errordocker

Overview

Fix Kubernetes CrashLoopBackOff status when pods repeatedly crash and restart, caused by application errors, misconfigured probes, or resource limits.

Key Details

  • CrashLoopBackOff means the container starts, crashes, and Kubernetes keeps restarting it with exponential backoff
  • The backoff delay increases from 10 seconds up to 5 minutes between restart attempts
  • Container logs from previous runs are critical for diagnosing the crash cause
  • Liveness probe failures can kill healthy containers if the probe is misconfigured
  • OOMKilled status indicates the container exceeded its memory limit

Common Causes

  • Application crashing on startup due to missing configuration, environment variables, or dependencies
  • Container exceeding memory limits and being OOMKilled by Kubernetes
  • Liveness probe failing because the application is slow to start or the probe endpoint is wrong
  • Image pull errors causing the container to start with the wrong or missing image

Steps

  1. 1Check pod status and events: 'kubectl describe pod [pod-name] -n [namespace]' — look at Events section
  2. 2View container logs: 'kubectl logs [pod-name] -n [namespace] --previous' to see logs from the crashed container
  3. 3Check resource limits: 'kubectl get pod [pod-name] -o yaml' — verify memory/CPU limits are sufficient
  4. 4If OOMKilled: increase memory limit in the deployment spec or fix the application's memory leak
  5. 5If probe failure: increase initialDelaySeconds in liveness probe or fix the health check endpoint

Tags

kubernetescrashloopbackoffpodcontainerrestart

More in Docker

Frequently Asked Questions

Error means the container exited with a non-zero code once. CrashLoopBackOff means it has crashed multiple times and Kubernetes is applying exponential backoff between restarts.