Liveness probe failed ☸️ Kubernetes

Liveness probe failed ... Container will be restarted (also Startup probe failed)

The kubelet’s liveness (or startup) check failed enough times that it killed and restarted the container.

Seen on: Kubernetes

Meaning

Liveness probes restart stuck apps — but a probe that’s too strict restarts healthy ones: slow JVM/Rails startup, GC pauses, heavy load or a dependency check inside the endpoint. The restarts then look like CrashLoopBackOff with exit code 137/143.

Common causes

  • Startup longer than initialDelaySeconds × failureThreshold
  • timeoutSeconds too short under load
  • Probe hits an endpoint that checks the database
  • Wrong port/path

⚡ Quick fix

  1. Add a startupProbe for slow starts
  2. Raise timeoutSeconds/failureThreshold
  3. Make liveness check only the process itself, not dependencies

Detailed fix by platform

YAML

  1. bash
    startupProbe:
      httpGet: { path: /healthz, port: 8080 }
      failureThreshold: 30
      periodSeconds: 10
    livenessProbe:
      httpGet: { path: /healthz, port: 8080 }
      timeoutSeconds: 3
      failureThreshold: 3

How to diagnose

  1. Events — Liveness/Startup failure messages
  2. Timing — Restart time vs startup duration
  3. Endpoint — What does it check?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.