如何将Kubernetes集群v1.19.4升级到1.19.13



我正在尝试用以下步骤将我们的Kuberneteskubeadm cluster从Ubuntu系统的v-1.19.4升级到v-1.19.13,我可以升级我的主主机,但是仍然工作主机保持相同的旧版本

On Master:-
apt-mark unhold kubeadm && 
apt-get update && apt-get install -y kubeadm=1.19.13-00 && 
apt-mark hold kubeadm
apt-get update && 
apt-get install -y --allow-change-held-packages kubeadm=1.19.13-00
kubeadm upgrade plan
kubeadm upgrade apply v1.19.13
kubeadm upgrade node
kubectl drain worker-1 --ignore-daemonsets
kubectl drain worker-2 --ignore-daemonsets
apt-mark unhold kubelet kubectl && 
apt-get update && apt-get install -y kubelet=1.19.13-00 kubectl=1.19.13-00 && 
apt-mark hold kubelet kubectl
apt-get update && 
apt-get install -y --allow-change-held-packages kubelet=1.19.13-00 kubectl=1.19.13-00 
systemctl daemon-reload
systemctl restart kubelet
kubectl uncordon worker-1
kubectl uncordon worker-2
On Worker Host:-
apt-mark unhold kubeadm && 
apt-get update && apt-get install -y kubeadm=1.19.13-00 && 
apt-mark hold kubeadm
apt-get update && 
apt-get install -y --allow-change-held-packages kubeadm=1.19.13-00
kubeadm upgrade node
On Master Host:-
kubectl drain worker-1 --ignore-daemonsets
kubectl drain worker-2 --ignore-daemonsets
On Worker Node:-
apt-mark unhold kubelet kubectl && 
apt-get update && apt-get install -y kubelet=1.19.13-00 kubectl=1.19.13-00 && 
apt-mark hold kubelet kubectl
apt-get update && 
apt-get install -y --allow-change-held-packages kubelet=1.19.13-00 kubectl=1.19.13-00
systemctl daemon-reload
systemctl restart kubelet
On Master Host:-
kubectl uncordon worker-1
kubectl uncordon worker-2
~# kubectl get nodes
NAME      STATUS   ROLES      AGE   VERSION
master    Ready    master     45h   v1.19.13
worker1   Ready    worker-1   27h   v1.19.4
worker2   Ready    worker-2   27h   v1.19.4

这里我的工作节点仍然有旧的v1.19.4。我需要在工作主机上执行任何其他步骤吗?请建议。谢谢。

重新启动所有主机并尝试上述步骤,已成功升级。

相关内容

  • 没有找到相关文章

最新更新