mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
Merge pull request #88251 from kublr/fix/kubelet-systemd-reservation
Partially fix incorrect configuration of kubepods.slice unit by kubelet
This commit is contained in:
commit
224aca4e01
@ -38,10 +38,17 @@ const (
|
|||||||
|
|
||||||
//createNodeAllocatableCgroups creates Node Allocatable Cgroup when CgroupsPerQOS flag is specified as true
|
//createNodeAllocatableCgroups creates Node Allocatable Cgroup when CgroupsPerQOS flag is specified as true
|
||||||
func (cm *containerManagerImpl) createNodeAllocatableCgroups() error {
|
func (cm *containerManagerImpl) createNodeAllocatableCgroups() error {
|
||||||
|
nodeAllocatable := cm.internalCapacity
|
||||||
|
// Use Node Allocatable limits instead of capacity if the user requested enforcing node allocatable.
|
||||||
|
nc := cm.NodeConfig.NodeAllocatableConfig
|
||||||
|
if cm.CgroupsPerQOS && nc.EnforceNodeAllocatable.Has(kubetypes.NodeAllocatableEnforcementKey) {
|
||||||
|
nodeAllocatable = cm.getNodeAllocatableInternalAbsolute()
|
||||||
|
}
|
||||||
|
|
||||||
cgroupConfig := &CgroupConfig{
|
cgroupConfig := &CgroupConfig{
|
||||||
Name: cm.cgroupRoot,
|
Name: cm.cgroupRoot,
|
||||||
// The default limits for cpu shares can be very low which can lead to CPU starvation for pods.
|
// The default limits for cpu shares can be very low which can lead to CPU starvation for pods.
|
||||||
ResourceParameters: getCgroupConfig(cm.internalCapacity),
|
ResourceParameters: getCgroupConfig(nodeAllocatable),
|
||||||
}
|
}
|
||||||
if cm.cgroupManager.Exists(cgroupConfig.Name) {
|
if cm.cgroupManager.Exists(cgroupConfig.Name) {
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user