-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
kubelet: cgroupv2 disable memcg notifications #106332
kubelet: cgroupv2 disable memcg notifications #106332
Conversation
The current memory notifier on cgroupv2 relies on reading `cgroup.event_control` which is unsupported on cgroupv2. For now, let's disable the feature on cgroupv2.
/hold To get some feedback and perform some testing |
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.
LGTM
/assign @Dragoncell @mrunalp @giuseppe |
Tested as follows, started a cluster on GCE with ubuntu cgroupv2 image with and without this change:
Without this change (failed to update notifier due to reading non-existent
and with this change (no such errors):
|
/triage accepted |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bobbypage, giuseppe, mrunalp 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 |
/unhold |
// Instead long term, on cgroupv2 kubelet should rely on combining usage of memory.low on root pods cgroup with inotify notifications on memory.events and or PSI pressure. | ||
// For now, let's return a fake "disabled" cgroup notifier on cgroupv2. | ||
// https://github.com/kubernetes/kubernetes/issues/106331 | ||
if libcontainercgroups.IsCgroup2UnifiedMode() { |
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.
Should we not start the notifier at all in eviction_manager while enable kernelMemcgNotification
but on cgroupv2 ?
notifier, err := NewMemoryThresholdNotifier(threshold, m.config.PodCgroupRoot, &CgroupNotifierFactory{}, thresholdHandler) |
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.
that would work too, but I choose to disable it in the NewCgroupNotifier
, so calling Start()
will be a no-op. I guess there's not big difference on where exactly to disable it.
The other reason it seems like eviction manager logic there is a bit "higher level" in general, and doesn't really have any cgroup related logic, so I wanted to keep this check contained in the lower level package closer to the other cgroup related logic.
/lgtm |
What type of PR is this?
/kind bug
What this PR does / why we need it:
The kubelet memory notifier relies on reading
cgroup.event_control
which is unsupported on cgroupv2. For now, let'sdisable the memory notifier on cgroupv2.
Which issue(s) this PR fixes:
Fixes #106331
Special notes for your reviewer:
As a more short term solution, I propose to disable kernel memcg notifications on kubelet for cgroupv2 since it's currently not supported. Longer term, we should consider how we adapt kubelet eviction as a whole to take advtange of new cgroupv2 features.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: