1冈在、生成集群的配置文件
kubeadm config view > /tmp/cluster.yaml
2倒慧、備份原有證書
cp -rp /etc/kubernetes /etc/kubernetes.bak
3、備份etcd數據目錄
cp -r /usr/etcd /usr/etcd.bak
4包券、更新證書
kubeadm alpha certs renew all --config=/tmp/cluster.yaml
mv admin.conf admin.conf.back
mv controller-manager.conf controller-manager.conf.back
mv kubelet.conf kubelet.conf.back
mv scheduler.conf scheduler.conf.back
kubeadm init phase kubeconfig all --config=/tmp/cluster.yaml
5纫谅、在三臺Master上執(zhí)行重啟kube-apiserver,kube-controller,kube-scheduler,etcd這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