Kubernetes uses three probes to manage containers. Each answers a different question, and each failure triggers a different action. Most probe-related incidents come from using one probe to answer another probe's question.

The three probes

ProbeQuestionOn failure
StartupHas the app finished starting?Keeps waiting until failureThreshold, then restarts
LivenessIs the app alive, or stuck?Restarts the container
ReadinessShould this pod receive traffic now?Removes the pod from Service endpoints

While a startup probe is running, liveness and readiness probes are paused. That is what makes slow-starting apps safe.

A safe default configuration

startupProbe:
  httpGet: { path: /health/live, port: 8080 }
  periodSeconds: 5
  failureThreshold: 30          # up to 150 s to start
livenessProbe:
  httpGet: { path: /health/live, port: 8080 }
  periodSeconds: 10
  timeoutSeconds: 2
  failureThreshold: 3           # restart after ~30 s of failures
readinessProbe:
  httpGet: { path: /health/ready, port: 8080 }
  periodSeconds: 5
  timeoutSeconds: 2
  failureThreshold: 2           # out of rotation after ~10 s

Timing fields

  • initialDelaySeconds: wait before the first probe. With a startup probe you rarely need it.
  • periodSeconds: how often to probe.
  • timeoutSeconds: how long a probe may take; the default of 1 second is short for busy apps.
  • failureThreshold: consecutive failures before acting.
  • successThreshold: consecutive successes before considered healthy again (readiness only can be above 1).

The time to act is roughly periodSeconds × failureThreshold.

The mistakes that cause outages

Liveness checks dependencies. The database has a 20-second blip; every pod's liveness fails; Kubernetes restarts all of them; they come back and stampede the recovering database. Liveness should only check the process itself.

No startup probe for slow apps. A JVM app needs 60 seconds to start, liveness starts at 10 seconds and kills it at 40. It never finishes starting, and you get a CrashLoopBackOff.

Readiness too strict. Readiness fails on any dependency error, so a short downstream problem removes every pod from the Service, and users get 503s instead of degraded responses.

Timeouts too short. Under load, a probe that normally takes 50 ms takes 1.2 seconds, fails the 1-second default, and healthy pods are restarted exactly when they are busiest.

Same endpoint for everything. Use the separate endpoints described in health check endpoint best practices.

Probes and graceful shutdown

When a pod is terminating, readiness should fail so it is removed from endpoints, while the process finishes in-flight requests. Combine a readiness flag flipped on SIGTERM with a short preStop delay. Details in graceful shutdown in Kubernetes.

Probe types

httpGet is the most common. tcpSocket only checks that a port accepts connections, useful for non-HTTP servers. exec runs a command in the container, which is flexible but costs more. grpc probes call the standard gRPC health service.

How to tell probes are hurting you

  • Restart counts rising while the app logs show no crashes.
  • Events with "Liveness probe failed" or "Readiness probe failed" during load spikes.
  • Deployments where available replicas drop during traffic peaks.
kubectl describe pod <pod> | sed -n '/Events/,$p'
kubectl get events --field-selector reason=Unhealthy --sort-by=.lastTimestamp | tail

Monitoring probes and their effects

Alert on rising restart counts and on available replicas below desired, not on individual probe failures. Check the public entry point from outside too, since probes can be green while the ingress or DNS is broken. See Kubernetes monitoring and Kubernetes observability; VitalRix infrastructure monitoring shows restart counts and pod status per workload.

Worked timing example

A Spring Boot service usually starts in 45 seconds, and occasionally in 90 under load. A startup probe with periodSeconds: 5 and failureThreshold: 30 allows 150 seconds before giving up, which covers the slow case with margin. Once started, liveness checks every 10 seconds with a 3-second timeout and restarts after three failures (about 30 seconds of being stuck). Readiness checks every 5 seconds and removes the pod after two failures (about 10 seconds), and the pod returns to service after one success.

Probes for non-HTTP services

  • Workers without an HTTP server: an exec probe that checks a heartbeat file updated by the main loop, or a tiny HTTP endpoint on a side port.
  • TCP services: tcpSocket confirms the port accepts connections, which catches crashed listeners but not deadlocks.
  • gRPC: use the standard gRPC health checking protocol with a grpc probe.

Rolling out probe changes

Treat probe changes like code: change one service at a time, deploy at a quiet hour, and watch restart counts and available replicas for a day. A probe that is too aggressive shows up immediately as restarts under the first traffic peak.

Do I need all three probes?

Readiness for anything behind a Service, liveness if the app can hang without crashing, and startup for apps that take more than a few seconds to start.

Can liveness and readiness use the same endpoint?

They can, but it is risky. Liveness should not depend on external systems; readiness often should consider them. Separate endpoints make that easy.

What is a good timeoutSeconds?

A few seconds for busy apps. The 1-second default can fail healthy pods under load.

Try VitalRix free

Uptime monitoring, APM, logs, real user monitoring and status pages in one place. No credit card needed.