飞天使-k8s知识点6-kubernetes证书更新

news/2024/7/4 7:45:37 标签: kubernetes, 容器, 云原生

文章目录

        • 查看证书有效期
        • 注释haproxy 的,然后进行重启haproxy

查看证书有效期
kubeadm alpha certs check-expiration 查看证书信息


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

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




执行这个进行更新证书
 kubeadm alpha certs renew all




[root@kubeadm-master1 m43]#  kubeadm alpha certs renew all
Command "all" is deprecated, please use the same command under "kubeadm certs"
[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.


然后证书会更新了
CERTIFICATE                EXPIRES                  RESIDUAL TIME   CERTIFICATE AUTHORITY   EXTERNALLY MANAGED
admin.conf                 Dec 20, 2024 14:56 UTC   364d                                    no
apiserver                  Dec 20, 2024 14:56 UTC   364d            ca                      no
apiserver-etcd-client      Dec 20, 2024 14:56 UTC   364d            etcd-ca                 no
apiserver-kubelet-client   Dec 20, 2024 14:56 UTC   364d            ca                      no
controller-manager.conf    Dec 20, 2024 14:56 UTC   364d                                    no
etcd-healthcheck-client    Dec 20, 2024 14:56 UTC   364d            etcd-ca                 no
etcd-peer                  Dec 20, 2024 14:56 UTC   364d            etcd-ca                 no
etcd-server                Dec 20, 2024 14:56 UTC   364d            etcd-ca                 no
front-proxy-client         Dec 20, 2024 14:56 UTC   364d            front-proxy-ca          no
scheduler.conf             Dec 20, 2024 14:56 UTC   364d                                    no

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


注释haproxy 的,然后进行重启haproxy
[root@ha1 ~]# systemctl restart haproxy
[root@ha1 ~]# cat /etc/haproxy/haproxy.cfg
listen stats
    mode http
    bind 0.0.0.0:9999
    stats enable
    log global
    stats uri /haproxy-status
    stats auth haadmin:faeefa123ef

listen k8s-6443
    bind 192.168.1.240:6443
    mode tcp
    balance roundrobin
    server 192.168.1.209 192.168.1.209:6443 check inter 2s fall 3 rise 5
    server 192.168.1.210 192.168.1.210:6443 check inter 2s fall 3 rise 5
    #server 192.168.1.212 192.168.1.212:6443 check inter 2s fall 3 rise 5

listen k8s-nginx-80
    bind 192.168.1.240:80
    mode tcp
    server 192.168.1.209 192.168.1.209:30004 check inter 2s fall 3 rise 5
    server 192.168.1.210 192.168.1.210:30004 check inter 2s fall 3 rise 5
    server 192.168.1.212 192.168.1.212:30004 check inter 2s fall 3 rise 5

在这里插入图片描述


http://www.niftyadmin.cn/n/5279985.html

相关文章

代码随想录算法训练营第二十四天 | 回溯算法

目录 力扣题目 回溯理论基础 力扣题目记录 77. 组合 剪枝 总结 力扣题目 77. 组合 回溯理论基础 暴力解法和递归一起用类似for循环 基本模板: void backtracking(参数) {if (终止条件) {存放结果;return;}for (选择:本层集合中元素&#xff08…

MySQL,练习

表结构参考:MySQL,等值联结、内部联结、多表连接、自联结、自然联结、外部联结、带聚集函数的联结-CSDN博客 1、找出购买了产品id1023005的客户信息 # 联结三表,再过滤 SELECT customers.* FROM orderitems,orders,customers WHERE orderit…

Xline v0.6.0: 一个用于元数据管理的分布式KV存储

Xline 是什么?我们为什么要做 Xline? Xline 是一个基于 Curp 协议的,用于管理元数据的分布式 KV 存储。现有的分布式 KV 存储大多采用 Raft 共识协议,需要两次 RTT 才能完成一次请求。当部署在单个数据中心时,节点之间…

【影像组学入门百问】#38--#40

#38-Python做影像组学研究一些重要的工具包 在使用Python进行影像组学研究时,以下是一些重要的工具包: 1.NumPy:用于进行大量数学计算和操作,如线性代数、矩阵操作等。 2.Pandas:用于数据处理和分析的库&#xff0c…

黑马头条--day06文章上下架--kafka消息队列

目录 一.自媒体文章上下架 二.kafka概述 1.消息中间件对比 2.kafka介绍 3.kafka安装配置 三.kafaka入门 (1)创建kafka-demo项目,导入依赖 (2)生产者发送消息 (3)消费者接收消息 总结…

力扣 | 739. 每日温度

leetcode 739 号算法题:每日温度 请根据每日气温列表,重新生成一个列表。 对应位置的输出为:要想观测到更高的气温,至少需要等待的天数。 如果气温在这之后都不会升高,请在该位置用 0 来代替。 输入:temper…

微服务降级策略及其在Spring Boot中的实现

降级策略的重要性 在微服务架构中,降级策略用于处理外部服务故障或过高的系统负载。当某个服务不可用或响应时间过长时,系统将执行降级操作,即暂时停止执行某些非核心或优先级较低的功能,以保证整体系统的可用性和稳定性。 实现降…

μC/OS-III 里面的环形表

文章目录 1、时钟节拍任务2、定时器列表 μC/OS-III 里面两个地方用到了环形表,时钟节拍任务,定时器列表,通过排序后,效率是非常高的。 以下内容整理自 嵌入式实时操作系统uC/OS-Ⅲ 1、时钟节拍任务 2023/12/21 18:04:16 (1) 该…