记一次生产证书过期问题
环境信息:
Kubernetes 版本v1.18.6 |
KubeSphere 版本v3.1.0 |
一个host集群,下面三个menber集群(其中一个member集群过期失联) |
member集群有三个master节点 |
执行kubectl get node
提示如下错误:
1
| kubesphere Unable to connect to the server: x509: certificate has expired or is not yet valid
|
且host集群查看member集群,发下改集群未就绪,且无法访问,直接通过ip可以进行访问。
更新证书
在所有master集群执行
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| kubeadm alpha certs check-expiration
mkdir pki230411 cp -rfa /etc/kubernetes/ pki230411/ ls pki230411/kubernetes/pki
kubeadm alpha certs renew all
kubeadm alpha certs check-expiration
sudo docker ps |grep -E 'k8s_kube-apiserver|k8s_kube-controller-manager|k8s_kube-scheduler|k8s_etcd_etcd'|sudo xargs docker restart
docker ps |grep -E 'k8s_kube-apiserver|k8s_kube-controller-manager|k8s_kube-scheduler|k8s_etcd_etcd'
systemctl status etcd systemctl daemon-reload systemctl restart etcd systemctl status etcd
cp .kube/config ~/pki230411/
cp /etc/kubernetes/admin.conf ~/.kube/config
kubectl get node
|
重新添加host集群的member集群
在kubeshpere查看原集群信息,备份
删除未就绪的member集群
重新添加member集群