kubelet fails to get cgroup stats for docker and kubelet services

家住魔仙堡 提交于 2019-11-29 01:43:09

Try to start kubelet with

--runtime-cgroups=/systemd/system.slice --kubelet-cgroups=/systemd/system.slice

I'm using this solution on RHEL7 with Kubelet 1.8.0 and Docker 1.12

The angeloxx's workaround works also on AWS default image for kops (k8s-1.8-debian-jessie-amd64-hvm-ebs-2017-12-02 (ami-bd229ec4))

sudo vim /etc/sysconfig/kubelet

add at the end of DAEMON_ARGS string:

 --runtime-cgroups=/systemd/system.slice --kubelet-cgroups=/systemd/system.slice

finally:

sudo systemctl restart kubelet

I had to do a yum update in addition to this change to make it work. Might be helpful for others trying this workaround.

For those a little further along, in kops AMI kope.io/k8s-1.8-debian-jessie-amd64-hvm-ebs-2018-02-08 as above, I had to add:

add at the end of DAEMON_ARGS string:

--runtime-cgroups=/lib/systemd/system/kubelet.service --kubelet-cgroups=/lib/systemd/system/kubelet.service

and then: sudo systemctl restart kubelet

but I found I was still getting:

Failed to get system container stats for "/system.slice/docker.service": failed to get cgroup stats for "/system.slice/docker.service": failed to get container info for "/system.slice/docker.service": unknown container "/system.slice/docker.service"

restarting dockerd resolved this error: sudo systemctl restart docker

Thanks

After a little more digging around I found a better resolution to add this into the kops configuration:

https://github.com/kubernetes/kops/issues/4049

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!