k8s v1.19 证书过期解决方案

1.备份

cp -r /etc/kubernetes  /etc/kubernetes_bak
cp -r $HOME/.kube/config $HOME/.kube/config_bak

2.在master节点上更新证书

kubeadm alpha certs renew all

3.更新$HOME/.kube/config文件

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

 4.重启容器

docker ps |grep -E 'k8s_kube-apiserver|k8s_kube-controller-manager|k8s_kube-scheduler|k8s_etcd_etcd' | awk -F ' ' '{print $1}' |xargs docker restart

 

posted @ 2022-01-14 14:11  NavyW  阅读(257)  评论(0编辑  收藏  举报