申明:答案仅供参考,最后得分看考官!!!
同样的答案,有人能得90多分,有人只能及格,但只要操作环境正确,最后能出正确结果,及格肯定没问题!
1. 设置mk8s-master-1不可调度并驱逐POD
2. 升级mk8s集群的master节点mk8s-master-1,不升级work节点
3. 升级master时, etcd,coredns,CNI plugin,container manager及其他组件不做升级
$ kubectl config use-context mk8s
$ kubectl get node
$ kubectl cordon mk8s-master-1
$ kubectl drain mk8s-master-1 --delete-local-data --ignore-daemonsets --force
$ ssh mk8s-master-1
$ sudo -i
$ apt install kubeadm=1.19.0-00 -y
$ kubeadm version (检查kubeadm版本)
$ kubeadm upgrade plan
$ kubeadm upgrade apply v1.19.0 --etcd-upgrade=false
$ apt install kubelet=1.19.0-00 kubectl=1.19.0-00 -y
$ systemctl kubelet
$ exit
$ exit (如果使用sudo -i,这里一定要退出两次)
$ kubectl get node (确认只升级了master节点到1.19.0版本)
参考:
升级 kubeadm 集群