K8S节点升级报错

升级节点kubernetes的步骤

kubectl get node # 查看节点状态,查看版本
kubectl cordon master  # master节点举例,让其称为不可以调度的状态
kubectl drain master --force --ignore-daemonsets --delete-local-data

# 下载指定版本的kubeadm
apt-cache show kubeadm | grep kubeadm

kubeadm

apt install -y kubeadm=1.20.1--00
kubeadm version # 查看当前的版本
kubeadm upgrade plan
kubeadm upgrade apply v1.20.1 --etcd-upgrade=false # 不升级etcd

# 下载更新 kubelet 和 kubectl
apt-cache show kubelet | grep 1.20  # 查看1.20.XX的kubelet
apt install kubelet=1.20.1-00 kubectl=1.20.1-00

# 查看kubelet的状态
systemctl status kubelete
systemctl daemon-reload

发生报错

image.png

[upgrade/version] FATAL: the --version argument is invalid due to these fatal errors:

Specified version to upgrade to "v1.21.0" is at least one minor release higher than the kubeadm minor release (21 > 20). Such an upgrade is not supported

Please fix the misalignments highlighted above and try upgrading again
To see the stack trace of this error execute with --v=5 or higher

问题原因

不能跨版本升级,只能从一个minor版本升级到下一个minor版本,比如从 v1.20.0 到 v1.20.1,不能从 v1.20.0 直接到 v1.21.0

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×