前言
使用 kubeadm join
加入 k8s-node 节点报错,内容如下:
error execution phase kubelet-start: error uploading crisocket: timed out waiting for the condition
解决办法
1 重置此台机器的集群配置
kubeadm reset -f
2 停止服务
sudo tee /tmp/test.sh <<-'EOF'
systemctl stop kubelet kube-proxy docker containerd
ps -ef | grep containerd | awk '{print $2}' | xargs -I {} kill -9 {}
rm -rf /etc/systemd/system/kube-proxy.service
rm -rf /etc/systemd/system/kubelet.service
systemctl stop zabbix-agent.service
systemctl disable zabbix-agent.service
systemctl stop node_exporter_custom.service
systemctl disable node_exporter_custom.service
systemctl reset-failed
rm -rf /usr/local/bin/kube*
EOF
chmod +x /tmp/test.sh && bash /tmp/test.sh
3 启动 docker
systemctl start docker
4 加入集群
在 master
上运行 kubeadm token create --print-join-command
获取 token
信息
然后在 node
节点执行如下命令,重新加入到 k8s 集群中
# k8s-node 上执行
kubeadm join 172.18.12.23:6443 --token okt9c2.edidk4m2yfim31su \
--discovery-token-ca-cert-hash sha256:0a6cb9f97106782102840e142eda33dc3dc071aff1af436f90d43699acdc3751
成功信息
5 在 k8s-master
上验证
kubectl get node
kubectl get pod -A