# 看到 invalid 全是过期的 [check-expiration] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml' [check-expiration] Error reading configuration from the Cluster. Falling back to default configuration
CERTIFICATE EXPIRES RESIDUAL TIME CERTIFICATE AUTHORITY EXTERNALLY MANAGED admin.conf Sep 14, 2022 14:01 UTC <invalid> no apiserver Sep 14, 2022 14:01 UTC <invalid> ca no apiserver-etcd-client Sep 14, 2022 14:01 UTC <invalid> etcd-ca no apiserver-kubelet-client Sep 14, 2022 14:01 UTC <invalid> ca no controller-manager.conf Sep 14, 2022 14:01 UTC <invalid> no etcd-healthcheck-client Sep 14, 2022 14:01 UTC <invalid> etcd-ca no etcd-peer Sep 14, 2022 14:01 UTC <invalid> etcd-ca no etcd-server Sep 14, 2022 14:01 UTC <invalid> etcd-ca no front-proxy-client Sep 14, 2022 14:01 UTC <invalid> front-proxy-ca no scheduler.conf Sep 14, 2022 14:01 UTC <invalid> no
CERTIFICATE AUTHORITY EXPIRES RESIDUAL TIME EXTERNALLY MANAGED ca Sep 12, 2031 14:01 UTC 8y no etcd-ca Sep 12, 2031 14:01 UTC 8y no front-proxy-ca Sep 12, 2031 14:01 UTC 8y no
# 或者用 openssl 方法,查看也是过期的 openssl x509 -in /etc/kubernetes/pki/apiserver.crt -noout -text |grep 'Not' Not Before: Sep 14 14:01:12 2021 GMT Not After : Sep 14 14:01:12 2022 GMT
2、 证书备份
1
cp -rp /etc/kubernetes /etc/kubernetes.bak
3、重新生成证书,使用该命令不用提前删除过期证书
1
kubeadm certs renew all
4、再查看证书有效期
1 2 3 4
# 显示已经到2023年 x509 -in /etc/kubernetes/pki/apiserver.crt -noout -text |grep 'Not' Not Before: Sep 14 14:01:12 2021 GMT Not After : Sep 15 01:53:20 2023 GMT