-
Notifications
You must be signed in to change notification settings - Fork 40.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PodDisruptionBudget by percentage doesn't work with StatefulSets #39125
Comments
Thanks @a-robinson ! Looks like we missed this one. The real fix for this issue would be to use controllerRefs instead of hard-coded lists of controllers, which will ensure that even custom/third party controllers with a scale subresource are covered, but that's in the 1.6 timeframe. For now, I'll send a PR to add StatefulSet to the list of controllers it recognizes. |
Thanks @foxish! Is the simpler fix something that'll be pulled into a 1.5.x patch release? |
@a-robinson Just created the PR. I expect that it should get into the next patch release. |
Automatic merge from submit-queue (batch tested with PRs 39435, 39454) Fix PDB by percentages for StatefulSet pods Previously, PDBs defined in terms of percentages would error out with StatefulSet as they did not know how to find the scale associated. This change teaches the disruption controller to also look at StatefulSets and their scale. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #39125 **Release note**: ```release-note Fix issue with PodDisruptionBudgets in which `minAvailable` specified as a percentage did not work with StatefulSet Pods. ``` cc @a-robinson @kow3ns @kubernetes/sig-apps-misc
Is it intentional that the disruption controller isn't aware of StatefulSets? They appear to work together when the budget is configured with a static minimum number of pods, but not when configured with a percentage because the controller
finders
don't include StatefulSets:kubernetes/pkg/controller/disruption/disruption.go
Line 204 in f49442d
kubernetes/pkg/controller/disruption/disruption.go
Line 557 in f49442d
The events for the disruption budget resource show the error message from the second link ("Failed to calculate the number of expected pods: asked for percentage, but found no controllers for pod "cockroachdb-0"), leaving it with no idea how many pods are expected.
This is with client and server both at v1.5.1.
@foxish @erictune
The text was updated successfully, but these errors were encountered: