kubeadm搭建的k8s集群证书过期
来源:原创
时间:2022-07-21
作者:脚本小站
分类:Linux
证书过期了会提示:
Unable to connect to the server: x509: certificate has expired or is not yet valid
查看证书过期时间:
kubeadm certs check-expiration kubeadm alpha certs check-expiration # 1.18之前版本
轮换证书:
kubeadm certs renew all kubeadm alpha certs renew all
kubectl用到的配置文件:
cp /etc/kubernetes/admin.conf /root/.kube/config
根据提示逐个节点重启kubelet、controller-manager、scheduler
systemctl restart kubelet.service