-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Use systemd for disabling swap when it's used #10587
Use systemd for disabling swap when it's used #10587
Conversation
Hi @VannTen. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
af155e6
to
0a9e92e
Compare
Hum, actually, does kubespray support non-systemd distributions ? If not I can just inconditionnaly use the masking and remove the fstab stuff. |
/ok-to-test |
0a9e92e
to
746db74
Compare
This is a more generic way to disable swap, since it pulls .swap units in systemd distributions; fstab is only one way to generate .swap units.
We only care to disable it (the "swapon" registered variable is not used anywhere else. This allows to get rid of the ignore_errors, since this was added because swapon.stdout does not exist in check_mode (see issue kubernetes-sigs#6642).
We're already masking the swap.target, which would pull the zram unit, hence no need to handle zram-generator specifically.
746db74
to
25bbfbd
Compare
/unassign @jayonlau |
/assign @cyclinder Apparently this does not work either :/ Oh well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this nice cleanup! :D
/lgtm
/ok-to-test
/assign @mzaian |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat! @VannTen
Thanks you!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MrFreezeex, mzaian, VannTen The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* Mask systemd swap.target do disable swap This is a more generic way to disable swap, since it pulls .swap units in systemd distributions; fstab is only one way to generate .swap units. * Unconditionally disable swap We only care to disable it (the "swapon" registered variable is not used anywhere else. This allows to get rid of the ignore_errors, since this was added because swapon.stdout does not exist in check_mode (see issue kubernetes-sigs#6642). * Don't explicitly disable swapOnZram We're already masking the swap.target, which would pull the zram unit, hence no need to handle zram-generator specifically.
What type of PR is this?
/kind bug
What this PR does / why we need it:
This relies on systemd instead of fstab to disable swap + some cleanups and simplifications.
On systemd system, mount and swap configuration is achieved by .mount and .swap units, and fstab is only one source for those (they can be manually created or generated from fstab of a gpt partition table for example). Hence it's more appropriate the swap.target, on which all of theses mechanisms should depend.
Which issue(s) this PR fixes:
Fixes #10581
Does this PR introduce a user-facing change?: