K3S证书过期解决方法
作者:互联网
以ubuntu为例
1、关闭时间同步
timedatectl set-ntp no
2、查看k3s过期时间
for i in `ls /var/lib/rancher/k3s/server/tls/*.crt`; do echo $i; openssl x509 -enddate -noout -in $i; done
3、设置时间到过期前一个月
date -s 20211105
4、删除 secret k3s-serving
sudo kubectl --insecure-skip-tls-verify -n kube-system delete secrets k3s-serving
5、删除系统中的文件dynamic-cert.json
sudo rm -f /var/lib/rancher/k3s/server/tls/dynamic-cert.json
6、重启k3s
sudo service k3s restart
7、查看过期时间
for i in `ls /var/lib/rancher/k3s/server/tls/*.crt`; do echo $i; openssl x509 -enddate -noout -in $i; done
8、打开时间同步
timedatectl set-ntp yes
标签:tls,K3S,k3s,证书,过期,sudo,lib,rancher 来源: https://blog.csdn.net/huangruifeng/article/details/120330777