sasi
sasi

Reputation: 4318

Failed to get kubelets cgroup

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.

Upvotes: 1

Views: 8249

Answers (1)

LinPy
LinPy

Reputation: 18598

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

Upvotes: 4

Related Questions