k8s 证书过期处理
注:kubeadm部署,k8s版本 1.18
[root@master ~]# kubeadm version
kubeadm version: &version.Info{
Major:"1", Minor:"20", GitVersion:"v1.20.0", GitCommit:"af46c47ce925f4c4ad5cc8d1fca46c7b77d13b38", GitTreeState:"clean", BuildDate:"2020-12-08T17:57:36Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"}
1 效果
[root@master ~]# kubectl get pod
Unable to connect to the server: x509: certificate has expired or is not yet valid: current time 2021-12-12T17:03:08+08:00 is after 2021-12-12T04:54:46Z
=
2 检查是否过期
kubeadm alpha certs check-expiration
[root@master ~]# kubeadm alpha certs check-expiration
Command "check-expiration" is deprecated, please use the same command under "kubeadm certs"
[check-expiration] Reading configuration from the cluster...
[check-expiration] FY