kubeadm upgrade plan报错记

报错如下:

[root@k8s-master1 ~]# 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 -oyaml'
[preflight] Running pre-flight checks.
[upgrade] Making sure the cluster is healthy:
[upgrade/health] FATAL: [preflight] Some fatal errors occurred:
	[ERROR ControlPlaneNodesReady]: there are NotReady control-planes in the cluster: [k8s-master2]
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher

缘由:没按官网教程来

官网说要在control plane node 安装kubeadm,我不听劝阻,把所有节点的kubelet,kubeadm,kubectl全更新到了v1.17.0,然后就报了这个错误,误操作命令:apt install kubeadm=1.17.0-00 kubelet=1.17.0-00 kubectl=1.17.0-00 -y

解决:恢复旧版本

参考了这篇文章:https://blog.csdn.net/michaeljscofield/article/details/38072955

#所有节点,除了kubeadm包外均恢复1.16.3版本
apt install aptitude -y
aptitude install  kubelet=1.16.3-00 kubectl=1.16.3-00 -y

然后就好了:

[root@k8s-master1 ~]# 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 -oyaml'
[preflight] Running pre-flight checks.
[upgrade] Making sure the cluster is healthy:
[upgrade] Fetching available versions to upgrade to
[upgrade/versions] Cluster version: v1.16.3
[upgrade/versions] kubeadm version: v1.17.0
[upgrade/versions] Latest stable version: v1.17.0
[upgrade/versions] Latest version in the v1.16 series: v1.16.4

Components that must be upgraded manually after you have upgraded the control plane with 'kubeadm upgrade apply':
COMPONENT   CURRENT       AVAILABLE
Kubelet     3 x v1.16.3   v1.16.4

Upgrade to the latest version in the v1.16 series:

COMPONENT            CURRENT   AVAILABLE
API Server           v1.16.3   v1.16.4
Controller Manager   v1.16.3   v1.16.4
Scheduler            v1.16.3   v1.16.4
Kube Proxy           v1.16.3   v1.16.4
CoreDNS              1.6.2     1.6.5
Etcd                 3.3.15    3.3.17-0

You can now apply the upgrade by executing the following command:

	kubeadm upgrade apply v1.16.4

_____________________________________________________________________

Components that must be upgraded manually after you have upgraded the control plane with 'kubeadm upgrade apply':
COMPONENT   CURRENT       AVAILABLE
Kubelet     3 x v1.16.3   v1.17.0

Upgrade to the latest stable version:

COMPONENT            CURRENT   AVAILABLE
API Server           v1.16.3   v1.17.0
Controller Manager   v1.16.3   v1.17.0
Scheduler            v1.16.3   v1.17.0
Kube Proxy           v1.16.3   v1.17.0
CoreDNS              1.6.2     1.6.5
Etcd                 3.3.15    3.4.3-0

You can now apply the upgrade by executing the following command:

	kubeadm upgrade apply v1.17.0

_____________________________________________________________________