k8s安装报错error execution phase wait-control-plane: couldn‘t initialize a Kubernetes cluster
解决在使用docker安装k8s时的报错Initial timeout of 40s passed.It seems like the kubelet isn't running or healthy.error execution phase wait-control-plane: couldn't initialize a Kubernetes cluster
·
报错如下:
[kubelet-check] Initial timeout of 40s passed.
[kubelet-check] It seems like the kubelet isn't running or healthy.
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp [::1]:10248: connect: connection refused.error execution phase wait-control-plane: couldn't initialize a Kubernetes cluster
在使用docker安装k8s的时候,有一个很重要的小细节,就是docker默认使用的Cgroup Driver是cgroupfs,安装报错,那么就需要使用systemd作为cgroup
解决方法:
vim /etc/docker/daemon.json
添加以下内容
{ "exec-opts":["native.cgroupdriver=systemd"] }
#应用配置并重启docker
systemctl daemon-reload
systemctl restart docker
此时,重新使用kubeadm初始化就没问题了
在初始化之前还要重置以前的初始化
kubeadm reset
rm -rf /etc/kubernetes/manifests/kube-apiserver.yaml
rm -rf /etc/kubernetes/manifests/kube-controller-manager.yaml
rm -rf /etc/kubernetes/manifests/kube-scheduler.yaml
rm -rf /etc/kubernetes/manifests/etcd.yaml
rm -rf /var/lib/etcd/*
更多推荐
已为社区贡献3条内容
所有评论(0)