mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-10-30 13:19:35 +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:
		| @@ -497,6 +497,14 @@ func setResourcesV2(cgroupConfig *libcontainerconfigs.Cgroup) error { | |||||||
| 	} | 	} | ||||||
| 	cgroupConfig.Resources.SkipDevices = true | 	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) | 	manager, err := cgroupfs2.NewManager(cgroupConfig, cgroupConfig.Path, false) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return fmt.Errorf("failed to create cgroup v2 manager: %v", err) | 		return fmt.Errorf("failed to create cgroup v2 manager: %v", err) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user