Google CloudMid

GKE CrashLoopBackOff: read the exit code, then the liveness probe

CrashLoopBackOff is not a cause. Check the exit code under Last State: 0 points to the entry point, non-zero to a crash, and OOMKilled to memory.

What you see

  • State: Waiting, Reason: CrashLoopBackOff
  • Last State: Terminated with an exit code

What it means

Google's guide stresses that CrashLoopBackOff does not name a specific error; it means a container is repeatedly crashing after restarts. Restarts happen when a container exits for any reason, even after a successful exit, so a clean exit can loop too.

The exit code under Last State is the first thing to read. Exit code 0 is unexpected for a long-running service and points to the entry point or the app's design. A non-zero code means the app crashed, so look at configuration, dependencies or bugs.

How to confirm the cause

  1. 1
    Read the state, last state and exit code
    kubectl describe pod POD_NAME

    Last State shows the previous container's termination.

  2. 2
    Read the previous container's logs
    kubectl logs POD_NAME --previous

    --previous retrieves logs from the prior, terminated container.

  3. 3
    Check whether liveness probes caused the kill
    # Logs Explorer filter: jsonPayload.MESSAGE:"failed liveness probe, will be restarted"

    If these appear, the probe is killing a container that may be fine.

Causes and fixes

  • Resource exhaustion

    HOW TO TELL
    Reason: OOMKilled under Last State.
    ROOT CAUSE
    The container used more memory than its limit and the kernel killed it.
    FIX
    Raise the memory limit or fix the leak. See the GKE OOM runbook.
  • Liveness probe failures

    HOW TO TELL
    Probe failure messages precede each restart.
    ROOT CAUSE
    The probe fails because it is misconfigured, too strict, or the app is slow to start or under heavy CPU or disk I/O load.
    FIX
    Review the probe's command, port, path and timeoutSeconds, and loosen it or add a startup probe.
  • Exit code 0

    HOW TO TELL
    The container exits cleanly and restarts.
    ROOT CAUSE
    The process finished its work and exited, or the entry point starts something that returns immediately.
    FIX
    Make the container run a long-lived process, or run it as a Job.
  • Application misconfiguration or crash

    HOW TO TELL
    A non-zero exit code and an error in the previous logs.
    ROOT CAUSE
    A missing configuration value, a failed dependency or a bug.
    FIX
    Fix what the log shows.

How to stop it coming back

  • Test the container with the same environment before deploying.
  • Alert on restart counts.
  • Keep probes simple and tolerant.

Keep going

Sources

Google Cloud documentation (docs.cloud.google.com), read 18 Nov 2026.

Search

Search cheat sheets and projects