How to set cgroup driver for kubelet in centos7.2?

12/3/2019
-- Kobe Biello
kubeadm
kubelet
kubernetes

1 Answer

12/3/2019

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
-- P Ekambaram
Source: StackOverflow