const defaultNodeAllocatableCgroupName … // createNodeAllocatableCgroups creates Node Allocatable Cgroup when CgroupsPerQOS flag is specified as true func (cm *containerManagerImpl) createNodeAllocatableCgroups() error { … } // enforceNodeAllocatableCgroups enforce Node Allocatable Cgroup settings. func (cm *containerManagerImpl) enforceNodeAllocatableCgroups() error { … } // enforceExistingCgroup updates the limits `rl` on existing cgroup `cName` using `cgroupManager` interface. func (cm *containerManagerImpl) enforceExistingCgroup(cNameStr string, rl v1.ResourceList, compressibleResources bool) error { … } // getCgroupConfig returns a ResourceConfig object that can be used to create or update cgroups via CgroupManager interface. func (cm *containerManagerImpl) getCgroupConfig(rl v1.ResourceList, compressibleResourcesOnly bool) *ResourceConfig { … } // getCgroupConfigInternal are the pieces of getCgroupConfig that don't require the cm object. // This is added to unit test without needing to create a full containerManager func getCgroupConfigInternal(rl v1.ResourceList, compressibleResourcesOnly bool) *ResourceConfig { … } // GetNodeAllocatableAbsolute returns the absolute value of Node Allocatable which is primarily useful for enforcement. // Note that not all resources that are available on the node are included in the returned list of resources. // Returns a ResourceList. func (cm *containerManagerImpl) GetNodeAllocatableAbsolute() v1.ResourceList { … } func (cm *containerManagerImpl) getNodeAllocatableAbsoluteImpl(capacity v1.ResourceList) v1.ResourceList { … } // getNodeAllocatableInternalAbsolute is similar to getNodeAllocatableAbsolute except that // it also includes internal resources (currently process IDs). It is intended for setting // up top level cgroups only. func (cm *containerManagerImpl) getNodeAllocatableInternalAbsolute() v1.ResourceList { … } // GetNodeAllocatableReservation returns amount of compute or storage resource that have to be reserved on this node from scheduling. func (cm *containerManagerImpl) GetNodeAllocatableReservation() v1.ResourceList { … } // validateNodeAllocatable ensures that the user specified Node Allocatable Configuration doesn't reserve more than the node capacity. // Returns error if the configuration is invalid, nil otherwise. func (cm *containerManagerImpl) validateNodeAllocatable() error { … } // Using ObjectReference for events as the node maybe not cached; refer to #42701 for detail. func nodeRefFromNode(nodeName string) *v1.ObjectReference { … }