kubelet: add initial support for cgroupv2#85218
kubelet: add initial support for cgroupv2#85218k8s-ci-robot merged 1 commit intokubernetes:masterfrom
Conversation
|
Hi @giuseppe. Thanks for your PR. I'm waiting for a kubernetes 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. DetailsInstructions 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. |
mattjmcnaughton
left a comment
There was a problem hiding this comment.
/uncc
Looking forward to reading the KEP :) Removing myself as a reviewer while this diff is WIP.
|
/ok-to-test |
KEP here: kubernetes/enhancements#1370 |
WIP backport of: kubernetes/kubernetes#85218 Signed-off-by: Giuseppe Scrivano <[email protected]>
|
/assign |
derekwaynecarr
left a comment
There was a problem hiding this comment.
i want to review this a little closer.
no conversion was needed for pids and hugepages, correct?
| Cgroups: cgroups, | ||
| Paths: paths, | ||
| }, nil | ||
| f, err := cgroupsystemd.NewSystemdCgroupsManager() |
There was a problem hiding this comment.
does this manager work on v1 and v2 hosts?
There was a problem hiding this comment.
i need to check the runc code, but is this abstracing legacy from unified manager?
There was a problem hiding this comment.
yes, NewSystemdCgroupsManager() checks for the cgroup version used:
If we are running on cgroup v1, it will use cgroupsystemd.LegacyManager
There was a problem hiding this comment.
thanks for pointer, and noting that i confirmed this is in the vendored version.
yes correct, both pids and hugetlb don't need any conversion. I'll need to add support for hugetlb to cAdvisor though, once Linux 5.6 is out (it is still at 5.6-rc5), support in libcontainer is already being added. |
/uncc Whoops, I didn't get to this before @derekwaynecarr did. Tbh, I don't see myself adding anything that his review wouldn't, so going to defer to him on the review :) |
| if libcontainercgroups.IsCgroup2UnifiedMode() { | ||
| if resourceConfig.CpuShares != nil { | ||
| // Convert from the range [2-262144] to [1-10000] | ||
| resources.CpuWeight = (1 + ((*resourceConfig.CpuShares-2)*9999)/262142) |
There was a problem hiding this comment.
minor nit: may be useful to move this conversion into a helper that we can then unit test in a follow-on.
derekwaynecarr
left a comment
There was a problem hiding this comment.
great to see this progress.
/approve
/lgtm
|
/milestone v1.19 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: derekwaynecarr, giuseppe The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Wow, exciting stuff @giuseppe @derekwaynecarr - big thank you for all your work! |
follow-up for kubernetes#85218 Signed-off-by: Giuseppe Scrivano <[email protected]>
/kind feature
do a conversion from the cgroups v1 limits to cgroups v2.
e.g. cpu.shares on cgroups v1 has a range of [2-262144] while the
equivalent on cgroups v2 is cpu.weight that uses a range [1-10000].
Signed-off-by: Giuseppe Scrivano [email protected]
Does this PR introduce a user-facing change?:
NONE
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: