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:
Kubernetes Prow Robot 2020-02-19 16:11:25 -08:00 committed by GitHub
commit 224aca4e01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,10 +38,17 @@ const (
//createNodeAllocatableCgroups creates Node Allocatable Cgroup when CgroupsPerQOS flag is specified as true
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{
Name: cm.cgroupRoot,
// 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) {
return nil