Telling the system whether a container is working.
WHAT A HEALTH CHECK IS
A command run periodically inside the container to determine its state.
WHY RUNNING IS NOT ENOUGH
A process can be alive and unable to serve requests.
WHAT A GOOD CHECK DOES
Exercises the path that matters, briefly.
WHAT IT SHOULD NOT DO
Check dependencies you do not control.
WHY
A database outage then marks every application container unhealthy, and they all restart pointlessly.
WHAT TO CHECK INSTEAD
That this container can serve.
WHAT PARAMETERS MATTER
How often to check How long to allow How many failures before unhealthy A grace period at startup
WHY THE GRACE PERIOD MATTERS
Applications take time to start, and failing during startup causes restart loops.
WHAT ORCHESTRATORS DISTINGUISH
Whether the container is alive Whether it is ready for traffic Whether it has finished starting
WHAT ALIVE FAILING CAUSES
A restart.
WHAT READY FAILING CAUSES
Traffic withheld, without restarting.
WHY THAT DISTINCTION IS IMPORTANT
A container busy or warming up should stop receiving traffic, not be killed.
WHAT THE COMMON MISTAKE IS
Making the liveness check too strict.
WHAT THAT PRODUCES
Restart loops under load, making the problem worse.