kubeblocks
kubeblocks copied to clipboard
[BUG] The number of unavailable instances may exceed the maxUnavailable limit during upgrades
Describe the bug
When performing an upgrade, if the user upgrades to a faulty image causing the Container to crash shortly thereafter, during this brief period (before the Container crashes), since the Pod has already been upgraded, the next Pod upgrade might be permitted (with currentUnavailable
being 0 and the previous Pod being checked as healthy). This can lead to the final number of unavailable
instances exceeding the maxUnavailable
limit.
Expected behavior
In addition to the isHealthy
check, it may also be necessary to rely on MinReadySeconds
for the isRunningAndAvailable
check. At the same time, we also need to ensure that the call to isRunningAndAvailable
happens after the kubelet has completed updating the status.