K8s加入集群报错
# detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd".
[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/
[WARNING SystemVerification]: this Docker version is not on the list of validated versions: 20.10.7. Latest validated version: 19.03
error execution phase preflight: [preflight] Some fatal errors occurred:
[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=...`
1
2
3
4
5
6
7
2
3
4
5
6
7
# 解决方法
cat <<EOF> /etc/docker/daemon.json
{
"exec-opts": ["native.cgroupdriver=systemd"]
}
EOF
1
2
3
4
5
2
3
4
5
# 重启docker
systemctl restart docker
1
# 重新加入集群
kubeadm join 10.0.2.6:6443 --token rxn33c.3z6vnm9c9bijkx1j \
--discovery-token-ca-cert-hash sha256:7ecf04dffe200a96149907498f0fd1833d92e3f416e3874ca2871ec5d4f2d376
1
2
2
# /etc/kubernetes/kubelet.conf already exists
[preflight] Running pre-flight checks
[WARNING SystemVerification]: this Docker version is not on the list of validated versions: 20.10.7. Latest validated version: 19.03
error execution phase preflight: [preflight] Some fatal errors occurred:
[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
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# 解决方法
[root@k8s-node01 k8s_images]# kubeadm reset
[reset] WARNING: Changes made to this host by 'kubeadm init' or 'kubeadm join' will be reverted.
[reset] Are you sure you want to proceed? [y/N]: y
1
2
3
2
3
# 重新加入
kubeadm join 10.0.2.6:6443 --token rxn33c.3z6vnm9c9bijkx1j \
--discovery-token-ca-cert-hash sha256:7ecf04dffe200a96149907498f0fd1833d92e3f416e3874ca2871ec5d4f2d376
1
2
2
# 加入完查看
kubectl get nodes
1
帮我改善此页面 (opens new window)
上次更新: 2021/11/13, 02:56:17