背景

开发机漏洞,Kubernetes kube-apiserver信息泄露漏洞(CVE-2021-25737)。
查询资料,需要升级版本(参考: https://github.com/kubernetes/kubernetes/issues/102106)
在这里插入图片描述

开发机使用的版本是1.17.17,但不知道谁使用yum乱升级,集群缺没有升级导致版本错乱。
在这里插入图片描述
然后本人使用常规升级方案,如下图(版本不同):
在这里插入图片描述
升级检查失败:

[root@yz1824 ~]# sudo kubeadm upgrade plan
[upgrade/config] Making sure the configuration is correct:
[upgrade/config] Reading configuration from the cluster...
[upgrade/config] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
[upgrade/config] FATAL: failed to getAPIEndpoint: could not retrieve API endpoints for node "yz1824" using pod annotations: timed out waiting for the condition
To see the stack trace of this error execute with --v=5 or higher

解决方案

  1. 先将kubeadm kubelet kubectl软件包降级到ctl服务版本,使版本统一:
yum downgrade kubeadm-1.17.17 kubelet-1.17.17 kubectl-1.17.17

然后就是升级操作了,可以参考: https://v1-18.docs.kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/

Upgrading control plane nodes

这部分在master节点主机上操作

Upgrade worker nodes

这部分在其他节点操作

Logo

开源、云原生的融合云平台

更多推荐