Strive to become a dream architect.
2024-2-17 myluzh Kubernetes
0x01 故障描述 ranhcer UI 无法进入,查看logs提示X509 certificate has expired or is not yet valid # 查看 rancher agent 日志 root@iZbp1bddlmdujngbc11omnZ:~# docker logs -f --tail 10 b109 time="2024-02-17T03:26:04Z" level=fatal msg="Server certificate is not valid, please check if the host has the correct time configured and if the server certificate has a notAfter date and time in the future. Certificate information is displayed above. error: Get \"https://172.30.233.87:8443\": x509: certificate has expired or is not yet valid: curren...标签: rancher
2023-12-15 myluzh Kubernetes
0x00 前言 最近在管理Rancher2.5部署的K8S集群发现一个问题,一旦Rancher Server不可用,直接在K8S master通过kubectl管理集群也会提示连接不到api提示不可用。 分析Rancher UI生成的kubeconfig文件可以发现,当kubectl访问K8S API SERVER的时候,请求是先发送到Rancher,然后再通过cluster agent转发给 K8S API SERVER。 所以需要开启“授权集群访问地址”,这样就算Rancher不可用,也可以通过kubectl --context 切换上下文,直接对集群直接进行管理。 0x01 启用Rancher授权集群访问地址 在rancher web面板中,找到集群,编辑,授权集群访问地址,启用,保存。 0x02 复制kubecfg配置 1、进入rancher面板,选择集群,在右上角打开“Kubeconfig文件”,复制kubeconfig文件内容。 可以看到kubecfg文件里面有两个上下文,第一个上下文就是先到rancher,再通过cluster agent转发到k8s api server的。 第二个上下文就...2023-9-25 myluzh Kubernetes
0x01 介绍 rke版本:v1.4.8 k8s版本:v1.26.7 rancher版本v2.7.6 master 10.206.16.10 centos7.9 role: [controlplane, worker, etcd] node1 10.206.16.11 centos7.9 role: [worker, etcd] node2 10.206.16.12 centos7.9 role: [worker, etcd] 0x02 初始配置 1、修改hostname #10.206.16.10 hostnamectl set-hostname master #10.206.16.11 hostnamectl set-hostname node1 #10.206.16.12 hostnamectl set-hostname node2 2、修改/etc/hosts sudo bash -c 'cat << EOF >> /etc/hosts 10....