KUBEADM证书续期

备份:

kubeadm config view > /tmp/cluster.yaml
cp -rp /etc/kubernetes /tmp/kubernetes.bak
cp -r /var/lib/etcd /tmp/etcd.bak


续定证书

kubeadm alpha certs renew all

续定配置

kubeadm init phase kubeconfig all

检查证书有效期

kubeadm alpha certs check-expiration

或者使用升级的方式更新

kubeadm upgrade apply --certificate-renewal v1.15.0

如果是集群,哪么需要用以下命令,重启相应的组件

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