I have a pod which takes a long time.
The liveness and readiness probe looked like this:
livenessProbe:
failureThreshold: 3
httpGet:
path: /ping
port: api
scheme: HTTP
initialDelaySeconds: 240
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 60
readinessProbe:
failureThreshold: 3
httpGet:
path: /ping
port: api
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
Now, the container needs more than 4 minutes to start up. I set initialDelaySeconds
for the liveness probe to 7200 (two hours) but after applying this, it still stops after four minutes.
What am I missing?
If you are using the same endpoint for the checks and it takes too long, then the readiness probe will time out after 3 failures before it even calls the liveness probe.
Readiness should be used if the container is temporarily unable to service traffic, it will be called periodically and then the container will start to receive traffic if it starts returning successfully.
It is not clear why your pod is taking so long and whether that is just at startup or when running.