-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
fix kube_reserved so it only controls kubeReservedCgroup #11367
fix kube_reserved so it only controls kubeReservedCgroup #11367
Conversation
Hi @rptaylor. 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-sigs/prow repository. |
I confirmed that after upgrading to Kubespray 2.21 with the default
This demonstrates the problem, it causes the allocatable resources reported on a node to increase from (pre 2.21)
to (post 2.21)
This means that pods can consume 100% of node resources, which would cause kubelet/containerd to crash or become unresponsive. |
I applied this patch on a v2.21 cluster via
Afterwards the nodeAllocatable reduced as expected. |
/ok-to-test |
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 the explanation and the fix :D
/lgtm
/assign ant31 |
@ant31 @ErikJiang Can you please take a look and /approve ? /assign ErikJiang |
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.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MrFreezeex, mzaian, rptaylor 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 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
I believe there may have been a misapprehension in the implementation of #9209
It introduced a new kube_reserved variable with a default value of false, and made all kubeReserved declarations conditional on it. I believe this was a mistake as the documentation makes it clear that you can set kubeReserved without kubeReservedCgroup, for the purposes of reserving resources without enforcing, which is the safest default behaviour.
This MR restores the previous behaviour - kubeReserved can/should always be defined and does not depend on or require the creation of separate cgroups, or running daemons in those cgroups, or configuring
kubeReservedCgroup
. The important primary purpose of this is to reduce the Node Allocatable resource amount to guarantee resources for k8s daemons purely on a scheduling basis, even if their cgroup config is not modified.Which issue(s) this PR fixes:
Fixes #9692
Special notes for your reviewer:
Please see this comment
This is just what I have been trying to figure out for the last several days. Let's review carefully to make sure it's right.
Does this PR introduce a user-facing change?: