kubeadm 进行续费证书

进行查看证书到期时间

kubeadm certs check-expiration
## 结果如下图所示
[root@hecs-266792 ~]# kubeadm certs check-expiration
[check-expiration] Reading configuration from the cluster...
[check-expiration] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'

CERTIFICATE                EXPIRES                  RESIDUAL TIME   CERTIFICATE AUTHORITY   EXTERNALLY MANAGED
admin.conf                 May 10, 2024 13:20 UTC   355d            ca                      no      
apiserver                  May 10, 2024 13:20 UTC   355d            ca                      no      
apiserver-etcd-client      May 10, 2024 13:20 UTC   355d            etcd-ca                 no      
apiserver-kubelet-client   May 10, 2024 13:20 UTC   355d            ca                      no      
controller-manager.conf    May 10, 2024 13:20 UTC   355d            ca                      no      
etcd-healthcheck-client    May 10, 2024 13:20 UTC   355d            etcd-ca                 no      
etcd-peer                  May 10, 2024 13:20 UTC   355d            etcd-ca                 no      
etcd-server                May 10, 2024 13:20 UTC   355d            etcd-ca                 no      
front-proxy-client         May 10, 2024 13:20 UTC   355d            front-proxy-ca          no      
scheduler.conf             May 10, 2024 13:20 UTC   355d            ca                      no      

CERTIFICATE AUTHORITY   EXPIRES                  RESIDUAL TIME   EXTERNALLY MANAGED
ca                      Apr 21, 2033 13:21 UTC   9y              no      
etcd-ca                 Apr 21, 2033 13:21 UTC   9y              no      
front-proxy-ca          Apr 21, 2033 13:21 UTC   9y              no 

在这里插入图片描述

进行续费证书

 kubeadm certs renew all # 进行续费证书
[root@hecs-266792 ~]#  kubeadm certs renew all
[renew] Reading configuration from the cluster...
[renew] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'

certificate embedded in the kubeconfig file for the admin to use and for kubeadm itself renewed
certificate for serving the Kubernetes API renewed
certificate the apiserver uses to access etcd renewed
certificate for the API server to connect to kubelet renewed
certificate embedded in the kubeconfig file for the controller manager to use renewed
certificate for liveness probes to healthcheck etcd renewed
certificate for etcd nodes to communicate with each other renewed
certificate for serving etcd renewed
certificate for the front proxy client renewed
certificate embedded in the kubeconfig file for the scheduler manager to use renewed

Done renewing certificates. You must restart the kube-apiserver, kube-controller-manager, kube-scheduler and etcd, so that they can use the new certificates.
[root@hecs-266792 ~]# kubeadm certs check-expiration
[check-expiration] Reading configuration from the cluster...
[check-expiration] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'

CERTIFICATE                EXPIRES                  RESIDUAL TIME   CERTIFICATE AUTHORITY   EXTERNALLY MANAGED
admin.conf                 May 20, 2024 02:32 UTC   364d            ca                      no      
apiserver                  May 20, 2024 02:32 UTC   364d            ca                      no      
apiserver-etcd-client      May 20, 2024 02:32 UTC   364d            etcd-ca                 no      
apiserver-kubelet-client   May 20, 2024 02:32 UTC   364d            ca                      no      
controller-manager.conf    May 20, 2024 02:32 UTC   364d            ca                      no      
etcd-healthcheck-client    May 20, 2024 02:32 UTC   364d            etcd-ca                 no      
etcd-peer                  May 20, 2024 02:32 UTC   364d            etcd-ca                 no      
etcd-server                May 20, 2024 02:32 UTC   364d            etcd-ca                 no      
front-proxy-client         May 20, 2024 02:32 UTC   364d            front-proxy-ca          no      
scheduler.conf             May 20, 2024 02:32 UTC   364d            ca                      no      

CERTIFICATE AUTHORITY   EXPIRES                  RESIDUAL TIME   EXTERNALLY MANAGED
ca                      Apr 21, 2033 13:21 UTC   9y              no      
etcd-ca                 Apr 21, 2033 13:21 UTC   9y              no      
front-proxy-ca          Apr 21, 2033 13:21 UTC   9y              no 

证书升级完成之后建议进行重启一下组件

systemctl restart kubelet

也可以参考一下官网地址:

https://kubernetes.io/zh-cn/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值