Kubernetes livenessProbe shutdown during application startup Kubernetes livenessProbe shutdown during application startup kubernetes kubernetes

Kubernetes livenessProbe shutdown during application startup


I finally ended up with a good solution, that at the moment works perfectly!

I set:

  • readinessProbe.initialDelaySeconds: equals to the minimum startup time of the application
  • livenessProbe.initialDelaySeconds: equals to the maximum startup time of the application + couple of seconds

So that kubernetes (after readinessProbe.initialDelaySeconds) starts to check readiness probe in order to add the pod to the balancing.Then (after livenessProbe.initialDelaySeconds) it starts to check also the liveness probe, in case the pod needs restarting.


Well, it seems like the time you are talking about is actually there, just not explicitly.

The formula for the time you are looking for would be

initialDelaySeconds + period * (failureTreshold - 1)

(-1 because the probe is executed right after initialDelaySeconds). You can tune maximumAmountOfTime (the parameter that you want to have) by changing these 3 values.

EDIT: after comment from OP, above answer is wrong, it seems like increasing initialDelaySeconds is the only thing you can do for now.