在 Master 节点上,执行
kubeadm certs check-expiration
命令,查看证书过期时间cp -r /etc/kubernetes /etc/kubernetes.old # 当升级证书失败时, 可以将此文件夹复原, 即可恢复原有集群
kubeadm certs renew all
mv config config.old
cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
chown $(id -u):$(id -g) $HOME/.kube/config
sudo chmod 644 $HOME/.kube/config
重启 kube-apiserver,kube-controller,kube-scheduler,etcd 这4个容器
# docker部署
docker ps | grep -v pause | grep -E "etcd|scheduler|controller|apiserver" | awk '{print $1}' | awk '{print "docker","restart",$1}' | bash
# containerd
sudo crictl ps | grep -E "kube-apiserver|kube-controller-manager|kube-scheduler|etcd"
crictl stop 容器id,就会自动重启恢复了
评论区