highIntermediateSymptom-first#probes#liveness#readiness#pods

Liveness and readiness probes fighting — healthy app killed repeatedly

Pod restarts repeatedly but application logs show no errors

Likely source:availabilityconfiguration

Focused incident mode — strips away everything but this runbook.

Symptoms

  • Pod restarts repeatedly but application logs show no errors
  • kubectl describe shows liveness probe failed, followed by container killed
  • Pod is removed from endpoints (unready) immediately after becoming ready

Liveness should only check 'is the process alive', not 'is the app ready'. Use separate endpoints: /healthz/live for liveness, /healthz/ready for readiness.

Evidence to grab

Collect these artifacts before you change anything — they prove (or rule out) each cause.

  • Probe failure events

    kubectl describe pod <pod> -n <namespace> | grep -E 'Liveness|Readiness' | tail -20
  • Probe configuration

    kubectl get pod <pod> -n <namespace> -o jsonpath='{.spec.containers[*].livenessProbe}'

Diagnostic flow

Run the steps in order, marking each claim confirmed or refuted. The evidence you gather feeds the ranked causes below.

Guided decision tree is ready.

Steps with commands, expected output, and pass/fail branches.

Ranked root causes

Evidence checklist

  • liveness initialDelaySeconds < actual app startup time
  • liveness timeoutSeconds too short for the health endpoint under load

Confirm before fixing

kubectl get pod <pod> -n <namespace> -o jsonpath='{.spec.containers[0].livenessProbe.initialDelaySeconds}'
READ

Read the liveness initial delay

Fix

kubectl patch deployment/<deploy> -n <namespace> --type merge -p '{"spec":{"template":{"spec":{"containers":[{"name":"<c>","livenessProbe":{"initialDelaySeconds":30,"periodSeconds":10,"timeoutSeconds":5}}]}}}}'
CHANGE

Increase initialDelaySeconds and timeoutSeconds for liveness

Resolution runbook

Apply from top to bottom after the cause is confirmed. Review every command before running it — risk tags are shown on each.

1
kubectl describe pod <pod> -n <namespace> | grep -E 'Liveness|Readiness' | tail -20
READ

Read the probe failure timeline

2
kubectl get pod <pod> -n <namespace> -o jsonpath='{.spec.containers[*].livenessProbe}'
READ

Read the liveness probe config

3
kubectl patch deployment/<deploy> -n <namespace> --type merge -p '{"spec":{"template":{"spec":{"containers":[{"name":"<c>","livenessProbe":{"initialDelaySeconds":30,"periodSeconds":10}}]}}}}'
CHANGE

Relax liveness timing

4
kubectl rollout status deployment/<deploy> -n <namespace>
READ

Verify the rollout completes without restarts

Prevention

  • Use separate endpoints for liveness (/live) and readiness (/ready).
  • Add startupProbe for any container that takes >30s to start.
  • Set liveness timeoutSeconds >= 2x the worst-case response time.
  • Monitor pod restart rate and alert on restarts > 3 in 5 minutes.

Commands marked READ CHANGE DESTRUCTIVE — never run DESTRUCTIVE commands against production data you cannot restore. Copy → verify → execute.