Kubernetes集群证书过期
证书一年过期了
kubectl get nodes
Unable to connect to the server: x509: certificate has expired or is not yet valid
查看API服务器的证书日期
- 方法1
openssl x509 -in /etc/kubernetes/pki/apiserver.crt -noout -text|grep -A2 'Validity'
Validity
Not Before: Jun 16 06:09:07 2020 GMT
Not After : Jun 16 06:09:07 2021 GMT
- 方法2
openssl x509 -in /etc/kubernetes/pki/apiserver.crt -noout -text|grep ' Not '
Not Before: Jun 16 06:09:07 2020 GMT
Not After : Jun 16 06:09:07 2021 GMT
重新配置证书 sudo kubeadm alpha certs renew all [renew] Reading configuration from the cluster...