Merge pull request #79245 from dashpole/fix_startup

Kubelet emits warning rather than exiting on invalid cgroup setup
This commit is contained in:
Kubernetes Prow Robot 2019-06-21 15:48:12 -07:00 committed by GitHub
commit f8d5ff2907
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -625,17 +625,15 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies, stopCh <-chan
cgroupRoots = append(cgroupRoots, cm.NodeAllocatableRoot(s.CgroupRoot, s.CgroupDriver))
kubeletCgroup, err := cm.GetKubeletContainer(s.KubeletCgroups)
if err != nil {
return fmt.Errorf("failed to get the kubelet's cgroup: %v", err)
}
if kubeletCgroup != "" {
klog.Warningf("failed to get the kubelet's cgroup: %v. Kubelet system container metrics may be missing.", err)
} else if kubeletCgroup != "" {
cgroupRoots = append(cgroupRoots, kubeletCgroup)
}
runtimeCgroup, err := cm.GetRuntimeContainer(s.ContainerRuntime, s.RuntimeCgroups)
if err != nil {
return fmt.Errorf("failed to get the container runtime's cgroup: %v", err)
}
if runtimeCgroup != "" {
klog.Warningf("failed to get the container runtime's cgroup: %v. Runtime system container metrics may be missing.", err)
} else if runtimeCgroup != "" {
// RuntimeCgroups is optional, so ignore if it isn't specified
cgroupRoots = append(cgroupRoots, runtimeCgroup)
}