0
votes

Am trying to setup kubernetes in centos machine, kubelets start is giving me this error.

Failed to get kubelets cgroup: cpu and memory cgroup hierarchy not unified. Cpu:/, memory: /system.slice/kubelet.service.

The cgroup driver I mentioned is systemd for both docker and kubernetes

Docker version 1.13.1 Kubernetes version 1.15.2

Can any one suggest the solution.

1
please include the versions you use - LinPy
Hi Linpy, Docker version 1.13.1 Kubernetes version 1.15.2 - sasi

1 Answers

3
votes

This issue is fixed in a commit but still not merged see this

you may try this work around:

sudo vim /etc/sysconfig/kubelet

add at the end of DAEMON_ARGS string:

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

restart:

sudo systemctl restart kubelet

or :

adding a file in : /etc/systemd/system/kubelet.service.d/11-cgroups.conf

which contains:

[Service]
CPUAccounting=true
MemoryAccounting=true

then reload and restart

systemctl daemon-reload && systemctl restart kubelet