升级管理节点:
1、查找最新版本号
yum list --showduplicates kubeadm
2、升级kubeadm
yum install -y kubeadm-1.23.0-0
3、驱逐node上的pod,且不可调度
kubectl drain k8s-master --ignore-daemonsets
4、检查集群是否可以升级,并获取可以升级的版本
kubeadm upgrade plan
如果遇到报错:[ERROR CoreDNSUnsupportedPlugins]: start version '' not supported
[ERROR CoreDNSMigration]: CoreDNS will not be upgraded: start version '' not supported
执行如下命令跳过这两个参数就行:kubeadm upgrade plan --ignore-preflight-errors=CoreDNSUnsupportedPlugins,CoreDNSMigration
5、执行升级 kubeadm upgrade apply v1.23.0 --ignore-preflight-errors=CoreDNSUnsupportedPlugins,CoreDNSMigration 6、升级kubelet和kubectl yum install -y kubelet-1.23.0-0 kubectl-1.23.0-0 7、重启kubelet systemctl daemon-reload systemctl restart kubelet 8、取消不可调度,重新上线 kubectl uncordon k8s-master --------------------------------------------------------------------- 升级node节点: 1、升级kubeadm yum install -y kubeadm-1.23.0-0 2、驱逐node上的pod,且不可调度 kubectl drain k8s-node1 --ignore-daemonsets 3、升级kubelet配置 kubeadm upgrade node 4、升级kubelet和kubectl yum install -y kubelet-1.23.0-0 kubectl-1.23.0-0 5、重启kubelet systemctl daemon-reload systemctl restart kubelet 6、取消不可调度,重新上线 kubectl uncordon k8s-node1 -------------------------------------------------------------------------- 升级后截图:![](/i/l/?n=22&i=blog/1629521/202208/1629521-20220827003041127-1775287520.png)
标签:kubectl,升级,kubelet,版本升级,集群,1.23,yum,kubeadm,K8s From: https://www.cnblogs.com/cloud-yongqing/p/16629666.html