Kubelet Failed with Kubelet Cgroup Driver: "Cgroupfs" Is Different from Docker Cgroup Driver: "Systemd"

docker change cgroup driver to systemd

Since I have two configuration file I need to add the entry in the second config file also -- /etc/systemd/system/docker.service.d/docker-thinpool.conf:

--exec-opt native.cgroupdriver=systemd \

Kubelet service is not running. It seems like the kubelet isn't running or healthy

First, check if swap is diabled on your node as you MUST disable swap in order for the kubelet to work properly.

sudo swapoff -a  
sudo sed -i '/ swap / s/^/#/' /etc/fstab

Also check out if kubernetes and docker cgroup driver is set to same.
From kubernetes documentation:

Both the container runtime and the kubelet have a property called "cgroup driver", which is important for the management of cgroups on Linux machines.

Warning:
Matching the container runtime and kubelet cgroup drivers is required or otherwise the kubelet process will fail.

The Container runtimes page explains that the systemd driver is recommended for kubeadm based setups instead of the cgroupfs driver, because kubeadm manages the kubelet as a systemd service.

For docker:

docker info |grep -i cgroup

You can add this to /etc/docker/daemon.json to set the docker cgroup driver to systemd:

{
"exec-opts": ["native.cgroupdriver=systemd"]
}

Restart your docker service after making any changes with

sudo systemctl daemon-reload
sudo systemctl restart docker
sudo systemctl restart kubelet

You can try to execute kubeadm join after performing the above steps.

Cluster install with `kubeadm` on Ubuntu. Failing on `kubeadm init` with `getsockopt: connection refused`

My system needed

cat << EOF > /etc/docker/daemon.json
{
"exec-opts": ["native.cgroupdriver=cgroupfs"]
}
EOF


Related Topics



Leave a reply



Submit