Site Reliability Engineering interview question · Most asked
What is the difference between liveness, readiness and startup probes in Kubernetes?
Summary
A readiness probe decides whether a pod receives traffic; a failing pod is removed from the Service endpoints. A liveness probe decides whether the container should be restarted. A startup probe protects slow-starting containers by disabling the other probes until startup succeeds.
Longer Answer
The classic mistake: a liveness probe that checks dependencies (database reachable). When the database blips, every pod fails liveness and restarts at the same time, turning a dependency problem into a full outage and a restart storm. Liveness should check only that the process itself is not stuck; readiness can reflect whether the instance can serve (warm-up done, not overloaded). Use generous thresholds and timeouts, and set up graceful shutdown (stop accepting, drain, then exit on SIGTERM) along with preStop hooks where load balancers are slow to deregister.
Key Points
- Readiness: receive traffic or not.
- Liveness: restart or not.
- Startup: protect slow starts.
- Never check dependencies in liveness.
More most-asked Site Reliability Engineering questions
- What is Site Reliability Engineering, and how does it relate to DevOps?
- What makes a good alert? Explain symptom-based alerting and alert fatigue.
- What is an error budget, and how should it be used?
- Define SLI, SLO and SLA, and explain how they relate.
- What is burn-rate alerting, and why is it better than alerting on raw error rates?
- How do you choose good SLIs for a service?
- What are the four golden signals?
- What is the difference between monitoring and observability? Explain metrics, logs and traces.