无法获取kubelets cgroup [英] Failed to get kubelets cgroup
问题描述
在尝试在centos
机器中设置kubernetes
时,kubelets启动给了我这个错误.
Am trying to setup kubernetes
in centos
machine, kubelets start is giving me this error.
无法获取kubelets cgroup:cpu和内存cgroup层次结构不可用 统一. CPU:/,内存:/system.slice/kubelet.service.
Failed to get kubelets cgroup: cpu and memory cgroup hierarchy not unified. Cpu:/, memory: /system.slice/kubelet.service.
我提到的cgroup驱动程序对于docker和kubernetes都是systemd
The cgroup driver I mentioned is systemd for both docker and kubernetes
Docker
版本1.13.1
Kubernetes
版本1.15.2
Docker
version 1.13.1
Kubernetes
version 1.15.2
任何人都可以提出解决方案的建议.
Can any one suggest the solution.
推荐答案
This issue is fixed in a commit but still not merged see this
您可以尝试以下解决方法:
you may try this work around:
sudo vim /etc/sysconfig/kubelet
在DAEMON_ARGS字符串的末尾添加:
add at the end of DAEMON_ARGS string:
--runtime-cgroups=/systemd/system.slice --kubelet-cgroups=/systemd/system.slice
重新启动:
sudo systemctl restart kubelet
或:
在/etc/systemd/system/kubelet.service.d/11-cgroups.conf
其中包含:
[Service]
CPUAccounting=true
MemoryAccounting=true
然后重新加载并重新启动
then reload and restart
systemctl daemon-reload && systemctl restart kubelet
这篇关于无法获取kubelets cgroup的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!