I am having a hard time to understand the behaviour of readiness probes and liveness probes. And need some input to rightfully set them:
Here’s my initial configuration:
readinessProbe:
httpGet:
path: /readiness
port: 4001
initialDelaySeconds: 300
periodSeconds: 10
livenessProbe:
httpGet:
path: /liveness
port: 4001
initialDelaySeconds: 300
periodSeconds: 30
Based on my understanding after reading documentation and blogs, as soon as the pod starts up, both readiness and liveness probe will start checking the pod (after waiting for first 300 seconds).
-
Should the
initialDelaySeconds
oflivenessProbe
be always greated than that ofreadinessProbe
? Reason being, if liveness checks fails before pod is ready, it will restart it and will get stuck in a loop. -
What happens when both readiness probe and liveness probe are successful but because of some database downtime, readiness probe starts failing. And the whole webserver is not responding i.e. both endpoints
readiness
andliveness
become unavailable. In this case, I think it will again be stuck in crashing loop, unless the database downtime is over.