Rancher Server 设置
- rke2 版本:v1.24.11+rke2r1
集群结构:
kke2部署步骤:
#mkdir -p /etc/rancher/rke2/
#vim /etc/rancher/rke2/config.yaml
#curl -sfL https://rancher-mirror.oss-cn-beijing.aliyuncs.com/rke2/install.sh | INSTALL_RKE2_MIRROR=cn INSTALL_RKE2_VERSION=v1.24.11+rke2r1 sh -
#systemctl enable rke2-server
#systemctl start rke2-server
#ln -s /var/lib/rancher/rke2/bin/kubectl /usr/bin/kubectl
#mkdir ~/.kube -p
#cp /etc/rancher/rke2/rke2.yaml ~/.kube/config
**主机操作系统:Ubuntu 20.04.5
**问题描述:使用rm /var/lib/rancher/rke2/server/tls/dynamic-cert.json,重启rke2服务后,没有触发更新
**重现步骤:#rm /var/lib/rancher/rke2/server/tls/dynamic-cert.json
#systemctl stop rke2-server
rke2 certificate rotate
#systemctl start rke2-server
#cp /etc/rancher/rke2/rke2.yaml ~/.kube/config
#for i in ls /var/lib/rancher/rke2/server/tls/*.crt
; do echo $i; openssl x509 -enddate -noout -in $i; done
#kubectl get secret -n kube-system rke2-serving --template=‘{{index .data “tls.crt”}}’ | base64 -d | openssl x509 -text | grep -E “After|Before”
#rm /var/lib/rancher/rke2/server/tls/dynamic-cert.json
#kubectl delete secret rke2-serving -n kube-system
systemctl restart rke2-server
**结果:rke2 certificate rotate执行后证书更新,执行“rm /var/lib/rancher/rke2/server/tls/dynamic-cert.json”,重启服务rke2-serving证书没有更新;删除secret“rke2-serving”后,重启后没有生成rke2-serving的这个secret
**预期结果:证书包括rke2-serving证书更新成功
截图:
其他上下文信息:
日志