其他分享
首页 > 其他分享> > Kubernetes证书过期

Kubernetes证书过期

作者:互联网

证书过期提示

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

标签:ps,grep,Kubernetes,kubernetes,证书,过期,etc,docker
来源: https://www.cnblogs.com/renzhsh/p/16631958.html