KubernetesMid

Liveness probe failed: the container keeps being restarted

Failed liveness probes make the kubelet kill and restart a healthy-looking container. Read the events and tune the probe or add a startup probe.

What you see

  • Warning Unhealthy kubelet Liveness probe failed: cat: can't open '/tmp/healthy': No such file or directory
  • Normal Killing kubelet Container liveness failed liveness probe, will be restarted
  • RESTARTS goes up while the app seems fine

What it means

A liveness probe tells the kubelet when to restart a container. If the probe keeps failing, the kubelet kills the container and starts a new one. A readiness probe is different: failing it only removes the pod from Service endpoints.

Slow-starting apps are the usual victims. If the app is not ready to answer when the first probe runs, it gets killed before it ever finishes starting.

How to confirm the cause

  1. 1
    Read the pod events
    kubectl describe pod POD_NAME

    Look for Unhealthy and Killing events near the bottom.

  2. 2
    Watch the restart counter
    kubectl get pods

    RESTARTS increases each time the kubelet restarts the container.

Causes and fixes

  • Probe runs before the app is ready

    HOW TO TELL
    Failures happen right after start, then the app would have been fine.
    FIX
    Raise initialDelaySeconds, or better, add a startupProbe. The docs say that if a startup probe never succeeds, the container is killed after its allowed time and is then subject to the pod's restartPolicy.
  • Probe checks the wrong thing

    HOW TO TELL
    The probe path, port or command does not match what the app serves.
    FIX
    Fix the probe so it checks a cheap, correct endpoint or command.
  • The app really is unhealthy

    HOW TO TELL
    The probe fails on a running but stuck app.
    FIX
    That is the probe doing its job. Fix the underlying hang or crash.

How to stop it coming back

  • Use a startup probe for slow starters instead of a huge initial delay.
  • Keep liveness checks cheap and independent of downstream services.
  • Do not use the same check for liveness and readiness unless you mean to.

Keep going

Sources

Kubernetes documentation (kubernetes.io), read 18 Nov 2026. The docs version selector listed v1.33 to v1.37.

Search

Search cheat sheets and projects