The liveness check finds if the application is alive or not. The application defines the logic and the liveness check verifies the expected output.
A webserver liveness check could include an HTTP handler that returns a fixed response or checks application dependencies.
Sample Liveness check
- send a pong response in the handler
- combine health check of all dependencies and return true/false
The Readiness check is to know if an application can accept traffic after initialization. A use case is a wait to serve traffic until all dependencies are ready. Essentially both checks have similar config options.
Sample Readiness Check
- combine health check of all dependencies and return
- A init wait of 5 secs
Written with StackEdit.