You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using PodDisruptionBudget with spec: maxUnavailable, although resource is being deployed, the builder can't identify it as ready/healthy.
Affected builder image
gcr.io/cloud-builders/gke-deploy
Expected Behavior
Trigger should pass however builder fails do identify the PodDisruptionBudget is working fine.
Actual Behavior
According to resource/ready.go under podDisruptionBudgetIsReady, one of the things that is being checked is status.desiredHealthy == spec.minAvailable, however if we deploy something using maxUnavailable instead of minAvailabe, that is supported on Kubernetes 1.17+, builder will always return false here:
minAvailable, ok, err := unstructured.NestedInt64(obj.Object, "spec", "minAvailable")
if err != nil {
return false, fmt.Errorf("failed to get spec.minAvailable field: %v", err)
}
if !ok {
return false, nil
}
Suggestion here is to remove status.desiredHealthy == spec.minAvailable and minAvailable retrieval, and leave only checking is status.currentHealthy >= status.desiredHealthy as I think it should be sufficient.
If you are ok with the suggestion, I can try to submit a PR myself.
Thanks
The text was updated successfully, but these errors were encountered:
Removing minAvailable form podDisruptionBudgetIsReady
and updating the testing files and yamls accordingly
to reflect the changes made to the component logic.
The update to the tests are due to roll back of
PR #726
[Ticket: #725]
Co-authored-by: feitnomore <feitnomore@users.noreply.github.com>
Failing to use PodDisruptionBudget
When using
PodDisruptionBudget
withspec: maxUnavailable
, although resource is being deployed, the builder can't identify it as ready/healthy.Affected builder image
gcr.io/cloud-builders/gke-deploy
Expected Behavior
Trigger should pass however builder fails do identify the
PodDisruptionBudget
is working fine.Actual Behavior
According to
resource/ready.go
underpodDisruptionBudgetIsReady
, one of the things that is being checked isstatus.desiredHealthy == spec.minAvailable
, however if we deploy something usingmaxUnavailable
instead ofminAvailabe
, that is supported on Kubernetes 1.17+, builder will always return false here:Steps to Reproduce the Problem
Use
maxUnavailable
instead ofminAvailable
.Additional Info
Suggestion here is to remove
status.desiredHealthy == spec.minAvailable
andminAvailable
retrieval, and leave only checking isstatus.currentHealthy >= status.desiredHealthy
as I think it should be sufficient.If you are ok with the suggestion, I can try to submit a PR myself.
Thanks
The text was updated successfully, but these errors were encountered: