编程知识 cdmana.com

K8S入门------更换证书

    kubeadm安装的kubernetes集群证书的证书有限期是一年,过期后kubectl命令就无法正常执行了,集群里的pod运行也会有问题的。kubelet执行命令就会报错:

Unable to connect to the server: x509: certificate has expired or is not yet valid: current time 2020-12-23T10:00:11+08:00 is after 2020-12-10T10:57:27Z

1、检查过期时间

kubeadm certs check-expiration

K8S入门------更换证书

2、证书备份

cp -rp /etc/kubernetes /etc/kubernetes.bak

3、重新生成证书

kubeadm certs renew all

K8S入门------更换证书

4、重启kubelet

systemctl restart kubelet

5、重新检查过期时间

kubeadm certs check-expiration
K8S入门------更换证书

版权声明
本文为[osc_0k23td2u]所创,转载请带上原文链接,感谢
https://my.oschina.net/u/4279943/blog/4840221

Tags Kubernetes
Scroll to Top