Can anybody tell me how to set cgroup driver for kubelet in centos7.2? the official doc doesn't work... https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#configure-cgroup-driver-used-by-kubelet-on-control-plane-node
details is here: https://github.com/kubernetes/website/issues/17924
use the below command
sed -i 's|systemd|cgroupfs|g' /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
You can also try below approach to set cgroup driver for docker
## Create /etc/docker directory.
mkdir /etc/docker
# Setup daemon.
cat > /etc/docker/daemon.json <<EOF
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2",
"storage-opts": [
"overlay2.override_kernel_check=true"
]
}
EOF
mkdir -p /etc/systemd/system/docker.service.d
# Restart Docker
systemctl daemon-reload
systemctl restart docker