k8s升级master步骤
2023-12-28升级k8s -master,可以升级一个小版本,可以升级一个大版本,但是不能跨版本升级,会有报错提示。建议一个版本一个版本升级
1、升级kubeadm
yum list --showduplicates kubeadm
yum -y install kubeadm-1.28.4
2、sh 5image-pull.sh
kubectl cordon master
kubectl drain master --ignore-daemonsets
3、kubeadm upgrade apply v1.28.4
sh nodes.sh
NAME STATUS ROLES AGE VERSION
vm-k8s001 Ready control-plane 4h47m v1.28.2
vm-k8s002 Ready control-plane 4h44m v1.28.2
vm-k8s003 Ready control-plane 4h41m v1.28.4
vm-k8s004 NotReady
vm-k8s005 NotReady
4、升级kubelet/kuebctl
yum -y install kubectl-1.28.4 kubelet-1.28.4
5、重启kubelet
systemctl daemon-reload
systemctl restart kubelet.service
6、工作节点
kubeadm upgrade node
7 第七步:取消节点不可被调度
kubectl uncordon master