Hi Guys, Just a question. While am setting up a k8-cluster V1.20.0 through kube . . .

Hi Guys,

Just a question.
While am setting up a k8-cluster V1.20.0 through kubeadm, I see below error related to cgroup driver.

[email protected]:~# kubeadm join --token 7vfq1k.fj12vmi2fc4jd6if --discovery-token-ca-cert-hash sha256:14e18f9160d459168a183f2a386a8e83f73d83adf79bd8de54293736a16f3d91
[preflight] Running pre-flight checks
[WARNING IsDockerSystemdCheck]: detected “cgroupfs” as the Docker cgroup driver. The recommended driver is “systemd”. Please follow the guide at https://kubernetes.io/docs/setup/cri/
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR DirAvailable–etc-kubernetes-manifests]: /etc/kubernetes/manifests is not empty
[ERROR FileAvailable–etc-kubernetes-kubelet.conf]: /etc/kubernetes/kubelet.conf already exists
[ERROR FileAvailable–etc-kubernetes-pki-ca.crt]: /etc/kubernetes/pki/ca.crt already exists
[preflight] If you know what you are doing, you can make a check non-fatal with --ignore-preflight-errors=...
To see the stack trace of this error execute with --v=5 or higher

Any one faced the same error n resolved?
I got stuck here from long time.
Also already tried below technote but no luck.

Swapnil S:
Change docker cgeoup to systemd on all nodes, restart docker service on all node and execute kubeadm init

Vitor Jr.:

$ systemctl status docker
Check following section 
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)

$ vi /usr/lib/systemd/system/docker.service
# Modify this line
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
# To
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --exec-opt native.cgroupdriver=systemd

# Restart the Docker service by running the following command:
$ systemctl daemon-reload
$ systemctl restart docker

# Verify the cgroups driver to systemd
$ docker info

Vitor Jr.:
Can you try this @sagar?

Hi Vitor. Thanks for your inputs. Let me try and update.