kunsupported cgroup setup causes kubelet to emit a warning rather than exiting

This commit is contained in:
David Ashpole 2019-06-20 16:16:08 -07:00
parent c898ab2043
commit 883f33df6c

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)) cgroupRoots = append(cgroupRoots, cm.NodeAllocatableRoot(s.CgroupRoot, s.CgroupDriver))
kubeletCgroup, err := cm.GetKubeletContainer(s.KubeletCgroups) kubeletCgroup, err := cm.GetKubeletContainer(s.KubeletCgroups)
if err != nil { if err != nil {
return fmt.Errorf("failed to get the kubelet's cgroup: %v", err) klog.Warningf("failed to get the kubelet's cgroup: %v. Kubelet system container metrics may be missing.", err)
} } else if kubeletCgroup != "" {
if kubeletCgroup != "" {
cgroupRoots = append(cgroupRoots, kubeletCgroup) cgroupRoots = append(cgroupRoots, kubeletCgroup)
} }
runtimeCgroup, err := cm.GetRuntimeContainer(s.ContainerRuntime, s.RuntimeCgroups) runtimeCgroup, err := cm.GetRuntimeContainer(s.ContainerRuntime, s.RuntimeCgroups)
if err != nil { if err != nil {
return fmt.Errorf("failed to get the container runtime's cgroup: %v", err) klog.Warningf("failed to get the container runtime's cgroup: %v. Runtime system container metrics may be missing.", err)
} } else if runtimeCgroup != "" {
if runtimeCgroup != "" {
// RuntimeCgroups is optional, so ignore if it isn't specified // RuntimeCgroups is optional, so ignore if it isn't specified
cgroupRoots = append(cgroupRoots, runtimeCgroup) cgroupRoots = append(cgroupRoots, runtimeCgroup)
} }