Skip to content

Allow updates/patches to pod disruption budgets#69867

Merged
k8s-ci-robot merged 2 commits intokubernetes:masterfrom
HotelsDotCom:allow-updates-to-pdbs
May 15, 2019
Merged

Allow updates/patches to pod disruption budgets#69867
k8s-ci-robot merged 2 commits intokubernetes:masterfrom
HotelsDotCom:allow-updates-to-pdbs

Conversation

@davidmccormick
Copy link
Copy Markdown
Contributor

@davidmccormick davidmccormick commented Oct 16, 2018

What this PR does / why we need it: It removes the immutability of pod disruption budgets. Encouraging teams to use Pod Disruption Budgets is a vital part of us allowing us to effectively perform maintenance on our clusters without inadvertently taking out one of the services running within it. With the present Pod Disruption Budgets being immutable this presents problems incorporating them into application charts (neither kubectl with force or helm can properly handle changing a pdb object - forcing an administrator to delete and re-create it). It has been said in the issue that there is no longer any design reason requiring pdbs to be immutable, so let's remove this control and allow them to be patched.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #45398
#45398
Special notes for your reviewer:
I have removed the DeepEqual check and then updated the tests in line with updates being allowed. In updating the tests I found that the order two of the test parameters had been accidentally transposed so I have corrected that and updated them to show that updates are now successful but pdb validation still applies - i.e. you are still not allowed to mix MaxUnavailable and MinAvailable values.

Release note:

Allow updates/patches to pod disruption budgets

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 16, 2018
@neolit123
Copy link
Copy Markdown
Member

/kind feature
/sig api-machinery
/ok-to-test

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 16, 2018
@neolit123
Copy link
Copy Markdown
Member

/sig apps
/remove-sig api-machinery

@k8s-ci-robot k8s-ci-robot added sig/apps Categorizes an issue or PR as relevant to SIG Apps. and removed sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Oct 18, 2018
@neolit123
Copy link
Copy Markdown
Member

@davidmccormick
please add a release note explaining the change.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Oct 18, 2018
@davidmccormick
Copy link
Copy Markdown
Contributor Author

ok have added a release note - does it look ok?

@neolit123
Copy link
Copy Markdown
Member

@davidmccormick
normally RN are kept down to a sentence or two.
the title seems like a good one.

Allow updates/patches to pod disruption budgets

the tool that collects release notes also inserts a PR link next to them for better context.

i would defer to the maintainers for further comments on the PR itself.
thanks.

@davidmccormick
Copy link
Copy Markdown
Contributor Author

ok thanks, have updated the release note as suggested

@davidmccormick davidmccormick changed the title WIP: Allow updates/patches to pod disruption budgets Allow updates/patches to pod disruption budgets Nov 2, 2018
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 2, 2018
@davidmccormick
Copy link
Copy Markdown
Contributor Author

@hongchaodeng @janetkuo can you review this PR please?

@nrvnrvn
Copy link
Copy Markdown

nrvnrvn commented Jan 12, 2019

@mattfarina @janetkuo
hey folks,
any chance to have a look at it?

@krmayankk
Copy link
Copy Markdown

@kubernetes/sig-apps-feature-requests @kubernetes/sig-apps-pr-reviews can some review or comment. This seems like we should do ?

@enisoc
Copy link
Copy Markdown
Contributor

enisoc commented Feb 4, 2019

@davidmccormick Sorry for the delay. Are you able to pick this back up? I personally want to see this happen too and I'll volunteer to be a reviewer and help track down an approver. If you don't have time to continue this, please let us know so we can open a new PR.

@mortent
Copy link
Copy Markdown
Member

mortent commented Apr 25, 2019

/lgtm
/assign @liggitt

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the purpose of setting and restoring the generation field? it seems like a no-op

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if possible, we should drop that behavior... validation shouldn't mutate objects, even temporarily

@liggitt
Copy link
Copy Markdown
Member

liggitt commented Apr 26, 2019

one question about cleaning up the generation set/restore in ValidatePodDisruptionBudgetUpdate, lgtm otherwise

@davidmccormick
Copy link
Copy Markdown
Contributor Author

Hi @liggitt, I couldn't work out why the pdb validation wanted to save and restore the generation number, so I've removed it and re-run the tests and still behaving as expected. Looking better?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't this make the test flaky?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that the time was to allow the pod disruption budget to be processed. The difference is that now we specifically wait for the pdb to be processed when we create or update the pdb in the waitForPdbToBeProcessed() function.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The difference is that now we specifically wait for the pdb to be processed when we create or update the pdb in the waitForPdbToBeProcessed() function.

That indicates the pdb controller has observed the update. It does not indicate the informer in the apiserver process (used by the eviction REST handler) has observed the update. In practice, the in-process informer is likely to always see the update events first, but that is not guaranteed.

Please keep an eye on this test post-merge to see if this increases flakiness.

@liggitt
Copy link
Copy Markdown
Member

liggitt commented May 2, 2019

validation change lgtm.

one comment on dropping the timeout on the test.

I didn't look at the new test, will defer to @kubernetes/sig-apps-pr-reviews for that

@mortent
Copy link
Copy Markdown
Member

mortent commented May 7, 2019

/lgtm

@kow3ns
Copy link
Copy Markdown
Member

kow3ns commented May 13, 2019

/approve

@davidmccormick
Copy link
Copy Markdown
Contributor Author

had to rebase @mortent @liggitt @kow3ns can you re-approve please?

@davidmccormick
Copy link
Copy Markdown
Contributor Author

/retest

@liggitt
Copy link
Copy Markdown
Member

liggitt commented May 14, 2019

/lgtm
/approve

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: davidmccormick, kow3ns, liggitt

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@fejta-bot
Copy link
Copy Markdown

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@pc-rshetty
Copy link
Copy Markdown

will this be backported to 1.13 and 1.14 ?

@liggitt
Copy link
Copy Markdown
Member

liggitt commented Oct 12, 2019

No, backports are limited to critical bug fixes and fixes for regressions. Features are not backported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/apiserver area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PodDisruptionBudget updates are forbidden