Liveness vs readiness probes: what do you actually check in each?
I set up both probes on a service to hit the same endpoint, which also checked the database. When the database had a hiccup, every pod got restarted at once, which made recovery slower.
My understanding now is that liveness should only answer "is this process stuck?" and readiness should answer "can this instance handle traffic right now?" So the DB check belongs in readiness, if anywhere.
How do you split them? Do you include dependencies in readiness at all?
Comments · 3
Liveness: tiny local check, e.g. the process responds on a simple endpoint. Readiness: can it serve traffic right now, so dependencies like the database can go here. And never point both at the same deep check.
Learned this the hard way too. A shared dependency failing and the whole fleet restarting is the textbook way to turn a blip into an outage.
Startup probes are worth a look as well if your app is slow to boot, so liveness doesn't kill it before it's ready.