mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
kubelet, cgroupv2: make hugetlb optional
make the hugetlb controller optional when cgroup v2 is used. Closes: https://github.com/kubernetes/kubernetes/issues/92933 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
bb8a5d2ada
commit
79be8be10e
@ -497,6 +497,14 @@ func setResourcesV2(cgroupConfig *libcontainerconfigs.Cgroup) error {
|
||||
}
|
||||
cgroupConfig.Resources.SkipDevices = true
|
||||
|
||||
// if the hugetlb controller is missing
|
||||
supportedControllers := getSupportedUnifiedControllers()
|
||||
if !supportedControllers.Has("hugetlb") {
|
||||
cgroupConfig.Resources.HugetlbLimit = nil
|
||||
// the cgroup is not present, but its not required so skip it
|
||||
klog.V(6).Infof("Optional subsystem not supported: hugetlb")
|
||||
}
|
||||
|
||||
manager, err := cgroupfs2.NewManager(cgroupConfig, cgroupConfig.Path, false)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create cgroup v2 manager: %v", err)
|
||||
|
Loading…
Reference in New Issue
Block a user