1

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.

2
  • please include the versions you use
    – LinPy
    Commented Aug 12, 2019 at 6:45
  • Hi Linpy, Docker version 1.13.1 Kubernetes version 1.15.2
    – sasi
    Commented Aug 12, 2019 at 6:50

1 Answer 1

4

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
1
  • What will be the solution.. the prior version shall I go or any other solution
    – sasi
    Commented Aug 12, 2019 at 7:47

Not the answer you're looking for? Browse other questions tagged or ask your own question.