What happens with overlapping LivenessProbes and ReadinessProbes?

Given a container with probes like such:

        readinessProbe:
      httpGet:
        path: /healthz
        port: 80
      initialDelaySeconds: 10
      periodSeconds: 5
    livenessProbe:
      httpGet:
        path: /healthz
        port: 80
      initialDelaySeconds: 10
      periodSeconds: 5

What’s the behavior of readiness probes and liveness probes when overlapping? What happens if the readiness probe never passes - will the liveness probe restart the container once it fails?

Thanks. This wasn’t clear to me from the docs.

Yes, they are independent (even if you happen to use the same endpoint in them). So it will be restarted if livenessProbe fails enough times.

But also, please note that these kind of things are easy to test. You can setup both and use the initialdelayseconds to make only one pass/fail and see what happens. Messing around, I think, is one of the best ways to learn and really get to know these things.

Of course, always feel free to ask. Just encouraging you to try it also, whenever you can, because it is fun :-). And let me know if I remember it wrong :-))

1 Like

Thanks! Appreciate the answer and advice.