File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -38,10 +38,17 @@ const (
38
38
39
39
//createNodeAllocatableCgroups creates Node Allocatable Cgroup when CgroupsPerQOS flag is specified as true
40
40
func (cm * containerManagerImpl ) createNodeAllocatableCgroups () error {
41
+ nodeAllocatable := cm .internalCapacity
42
+ // Use Node Allocatable limits instead of capacity if the user requested enforcing node allocatable.
43
+ nc := cm .NodeConfig .NodeAllocatableConfig
44
+ if cm .CgroupsPerQOS && nc .EnforceNodeAllocatable .Has (kubetypes .NodeAllocatableEnforcementKey ) {
45
+ nodeAllocatable = cm .getNodeAllocatableInternalAbsolute ()
46
+ }
47
+
41
48
cgroupConfig := & CgroupConfig {
42
49
Name : cm .cgroupRoot ,
43
50
// The default limits for cpu shares can be very low which can lead to CPU starvation for pods.
44
- ResourceParameters : getCgroupConfig (cm . internalCapacity ),
51
+ ResourceParameters : getCgroupConfig (nodeAllocatable ),
45
52
}
46
53
if cm .cgroupManager .Exists (cgroupConfig .Name ) {
47
54
return nil
You can’t perform that action at this time.
0 commit comments