A running container is a starting point

A process can exist while its application cannot serve requests. It might still be warming up, waiting for a dependency, or stuck internally. A useful health-check design separates those states so that the platform can respond appropriately.

Begin with an application walkthrough. List the work that happens before the service can answer a real request, the dependencies required for that request, and the failures a restart can reasonably fix. This list is more useful than copying probe settings from another service.

Give each probe a clear responsibility

A startup probe checks whether initialization has completed. When configured, it holds back liveness and readiness probes until it succeeds. Readiness determines whether the container is ready to receive traffic through matching Services. A failed liveness check can trigger a restart after the configured threshold.

Avoid putting every downstream dependency into the liveness endpoint. Restarting a healthy process because a shared database is unavailable can add churn during an existing outage. Use the application’s serving behavior to decide what belongs in readiness.

Choose thresholds from observations

Measure startup time during ordinary operation and under slower conditions, such as a cold cache. Choose a startup budget that gives expected initialization time room to finish while still detecting a genuinely stuck start.

For readiness, decide how quickly traffic should stop after a local failure and how much success is needed before it returns. For liveness, favor a conservative signal of an unrecoverable process state. The right values depend on traffic, recovery behavior, and the cost of a restart.

Test the unhealthy paths

A deployment that starts normally does not prove the health checks are useful. Exercise one failure at a time in a safe environment, and observe both the probe result and the resulting traffic behavior.

Capture the expected sequence in the service runbook. A future operator should be able to distinguish slow startup, temporary unavailability, and a restart loop from the monitoring data.

  • Delay startup and confirm that initialization has time to finish.
  • Make a local instance unready and observe how traffic changes.
  • Simulate a recoverable dependency failure without forcing restart churn.
  • Confirm that logs and metrics explain a liveness-triggered restart.

Further reading

Project references and official documentation for further reading: