add toggle to turn off readiness probes #2004
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses: #2003, #1978
Having statefulsets with readiness probes was requested a couple of times in the past. We merged it with #1825. Now they are enabled by default, which turns out to be not the greatest idea when
pod_management_policy
is set toordered_ready
. What could happen?Imagine a cluster with
pod-0
andpod-1
where the first instance (replica) is broken (e.g. missing a WAL file to restore, disk full etc.) but the master is doing fine. Now the master pod must be replaced (maintenance or it dies for whatever reason). The first pod is failing the readiness probe blocking the second pod from coming back and restore the former master.Without the readiness probe, it's enough for K8s to see that the first pod is in
Running
state ignoring the actual state of the cluster member. This helped us in the past that masters could repair themselves.Changing the
pod_management_policy
is not as easy as it seems, because the operator does not compare it on sync. This PR will include the policy as well as the readiness probe of the container into the stateful set comparison to trigger a replacement of the stateful set (and rolling update of pods if the probe changes).With
ordered_ready
being the default policy, the readiness probe should be disabled by default although this is a breaking change to v1.8. Therefore, a new toggle is added to keep the existing behavior.