Kubectl 服务器版本未升级

Kubectl server version is not upgrading

我遇到了 kubectl 服务器版本的问题。

Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.4", GitCommit:"e87da0bd6e03ec3fea7933c4b5263d151aafd07c", GitTreeState:"clean", BuildDate:"2021-02-18T16:12:00Z", GoVersion:"go1.15.8", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.8", GitCommit:"9f2892aab98fe339f3bd70e3c470144299398ace", GitTreeState:"clean", BuildDate:"2020-08-13T16:04:18Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}

所以,当我尝试加入一个新节点时,我得到了这个:

root@osswrkprbe007:~# kubeadm join 192.168.14.149:6443 --token 2w06dl.jz1clwuvknkbabqp --discovery-token-ca-cert-hash sha256:00370f52b8b14ae094ae83cb8333b9c7a141df9de7b039aeb33399ef5547f36f [preflight] Running pre-flight checks [WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/ [preflight] Reading configuration from the cluster... [preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml' error execution phase preflight: unable to fetch the kubeadm-config ConfigMap: this version of kubeadm only supports deploying clusters with the control plane version >= 1.19.0. Current version: v1.18.8 To see the stack trace of this error execute with --v=5 or higher

感谢您的帮助

问题不在 kubectl version, problem in kubeadm 版本中。

  • 你的 kubectl 是 1.20.4
  • 您的集群是 1.18.8
  • 你的 kubeadm 很可能是 1.19,它说你“这个版本的 kubeadm 只支持部署控制平面版本 >= 1.19.0 的集群。

所以使用较低且合适的 kubeadm 版本(例如 1.18.8)- 它会有所帮助。

参考这个答案检查