当前位置: 首页 > news >正文

Kubeadm搭建的K8S集群怎么更新证书

kubeadm搭建集群怎么更新证书

master节点查看证书有效期

#  kubeadm certs check-expiration
[check-expiration] Reading configuration from the "kubeadm-config" ConfigMap in namespace "kube-system"...
[check-expiration] Use 'kubeadm init phase upload-config --config your-config-file' to re-upload it.CERTIFICATE                EXPIRES                  RESIDUAL TIME   CERTIFICATE AUTHORITY   EXTERNALLY MANAGED
admin.conf                 Jan 27, 2027 07:24 UTC   363d            ca                      no      
apiserver                  Jan 28, 2027 03:10 UTC   363d            ca                      no      
apiserver-etcd-client      Jan 27, 2027 07:24 UTC   363d            etcd-ca                 no      
apiserver-kubelet-client   Jan 27, 2027 07:24 UTC   363d            ca                      no      
controller-manager.conf    Jan 27, 2027 07:24 UTC   363d            ca                      no      
etcd-healthcheck-client    Jan 27, 2027 07:24 UTC   363d            etcd-ca                 no      
etcd-peer                  Jan 27, 2027 07:24 UTC   363d            etcd-ca                 no      
etcd-server                Jan 27, 2027 07:24 UTC   363d            etcd-ca                 no      
front-proxy-client         Jan 27, 2027 07:24 UTC   363d            front-proxy-ca          no      
scheduler.conf             Jan 27, 2027 07:24 UTC   363d            ca                      no      
super-admin.conf           Jan 27, 2027 07:24 UTC   363d            ca                      no      CERTIFICATE AUTHORITY   EXPIRES                  RESIDUAL TIME   EXTERNALLY MANAGED
ca                      Jan 25, 2036 07:24 UTC   9y              no      
etcd-ca                 Jan 25, 2036 07:24 UTC   9y              no      
front-proxy-ca          Jan 25, 2036 07:24 UTC   9y              no      
root@Ubuntu22K8SMaster003151:~# 

更新证书

# kubeadm certs renew all
[renew] Reading configuration from the "kubeadm-config" ConfigMap in namespace "kube-system"...
[renew] Use 'kubeadm init phase upload-config --config your-config-file' to re-upload it.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
certificate embedded in the kubeconfig file for the super-admin renewedDone renewing certificates. You must restart the kube-apiserver, kube-controller-manager, kube-scheduler and etcd, so that they can use the new certificates.

更新kubeconfig配置文件

sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config

如果 kube-proxy 等组件也需要新证书,可以

sudo kubeadm init phase kubeconfig all

更新完证书后,需要让 API Server、Controller Manager、Scheduler 等加载新证书,可以直接重启 kubelet,kubelet 会重新启动这些静态 Pod:

http://www.jsqmd.com/news/317387/

相关文章:

  • 2026年适合办公室吃的健康零食品牌:办公室下午茶小包装零食推荐挑选指南和选购建议
  • 2026最新必读:采购五轴机床首选哪个平台好?
  • 2026年三峡旅游直直通车产品推荐:基于跨域专线实测评价,直击景区衔接与效率痛点
  • 2026年三峡旅游直直通车产品推荐:深度评测与排名,覆盖家庭与自由行场景痛点
  • 艾体宝方案 | 守护核心数据资产:文件服务器访问与敏感数据防泄漏实践
  • 艾体宝方案 | AI时代的数据安全与Lepide智能治理方案
  • 好写作AI:当“意识流”艺术写作,遇见“结构化”AI队友
  • 好写作AI:当你的回归结果开始“讲故事”,AI是第一个听众兼挑刺专家
  • 新手必看|如何在期刊上发表论文?实操干货+避坑指南
  • 2026年苏州硕士留学机构前十诚信排名,服务品质全解析
  • 2026年新加坡留学机构前十,如何评估其负责程度
  • 2026年长沙留学机构排名,这些机构值得信赖
  • 合肥留学机构口碑排名揭晓,性价比高机构全面推荐
  • 济南硕士留学机构前十盘点,经验丰富顾问助您留学成功
  • 探索郑州硕士留学机构排名,寻找性价比高的优质选择
  • 郑州留学中介十强专业解析,2026年最新趋势与建议
  • 2026年夜游长江经典旅游线路推荐:都市夜景与文化沉浸双维度评测,附权威产品排名
  • 2025罐头机生产风云榜:口碑爆棚的肉制品罐头机厂家揭秘!市场上专业的罐头机公司博锐层层把关品质优
  • 2026全自动咖啡机哪个牌子好哪个品牌合适:哪家产品更适合商用场景
  • 探讨昆明有名的四合院设计公司,选哪家更靠谱
  • 2026年夜游长江经典旅游线路推荐:基于多场景实测评价,解决选择困难与体验同质化痛点
  • 盘点聚氨酯瓦壳厂家排名,奥强保温材料服务陕西等地
  • 2026年浙江杭州专业的考研集训营推荐,靠谱的十大品牌
  • 2026年宜昌楚风号旅游攻略推荐:基于文化体验与实用信息评价,直击选择困惑
  • 高云半导体GVIO
  • 2026年宜昌游览三峡人家丰富旅游线路推荐:山水人文融合趋势排名,涵盖家庭与深度游场景核心痛点
  • W+端粒塔的科学视野:NMN与PQQ—从“双雄对决”到“黄金搭档”的抗衰新纪元
  • ISTA6A亚马逊SIOC测试:保障包装运输安全的金标准
  • 2026年宜昌游览三峡人家丰富旅游线路推荐:基于行业趋势评价,涵盖自然与人文场景核心痛点
  • 2026快餐厅与机场商用智能咖啡机优选方案:赋能商业场景高效运营