证书过期提示
root@kubernetes # kubectl get nodes
Unable to connect the server: X509 certificate has expired or is not yet valid
操作步骤
1、查看证书有效期
kubeadm alpha certs check-expiration
或
openssl x509 -in /etc/kubernetes/pki/apiserver.crt -noout -text |grep 'Not'
2、证书备份
cp -rp /etc/kubernetes /etc/kubernetes.bak
3、重新生成证书
kubeadm alpha certs renew all
4、更新用户凭证
cp /etc/kubernetes/admin.conf ~/.kube/config
5、重启kubelet
systemctl restart kubelet
6、重启apiserver、scheduler、controller-manager容器
docker ps | grep apiserver
docker ps | grep scheduler
docker ps | grep controller-manager
docker restart containerID
7、检测是否生效
systemctl status kubelet
kubectl get nodes
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/282621.html