Hi All, Getting below error message at lightning lab controlplane $ sudo kubea . . .

Kathiresh Muthusamy:
Hi All,

Getting below error message at lightning lab

controlplane $ 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 -oyaml’
[preflight] Running pre-flight checks.
[upgrade] Running cluster health checks
[upgrade] Fetching available versions to upgrade to
[upgrade/versions] Cluster version: v1.18.0
[upgrade/versions] kubeadm version: v1.18.0
I0111 23:39:17.091558 16966 version.go:252] remote version is much newer: v1.20.1; falling back to: stable-1.18
[upgrade/versions] Latest stable version: v1.18.14
[upgrade/versions] Latest stable version: v1.18.14
[upgrade/versions] Latest version in the v1.18 series: v1.18.14
[upgrade/versions] Latest version in the v1.18 series: v1.18.14

Components that must be upgraded manually after you have upgraded the control plane with ‘kubeadm upgrade apply’:
COMPONENT CURRENT AVAILABLE
Kubelet 2 x v1.18.0 v1.18.14

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

COMPONENT CURRENT AVAILABLE
API Server v1.18.0 v1.18.14
Controller Manager v1.18.0 v1.18.14Scheduler v1.18.0 v1.18.14
Kube Proxy v1.18.0 v1.18.14
CoreDNS 1.6.7 1.6.7
Etcd 3.4.3 3.4.3-0

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

    kubeadm upgrade apply v1.18.14

Note: Before you can perform this upgrade, you have to update kubeadm to v1.18.14.


controlplane $

In Question requested to upgrade by 1.19.0.

controlplane $ sudo kubeadm upgrade apply v1.19.0
[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] Running cluster health checks
[upgrade/version] You have chosen to change the cluster version to “v1.19.0”
[upgrade/versions] Cluster version: v1.18.0
[upgrade/versions] kubeadm version: v1.18.0
[upgrade/version] FATAL: the --version argument is invalid due to these fatal errors:

    - Specified version to upgrade to “v1.19.0" is at least one minor release higher than the kubeadm minor release (19 > 18). Such an upgr

ade 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
controlplane $ kubeadm version
kubeadm version: &http://version.Info|version.Info{Major:“1”, Minor:“18", GitVersion:“v1.18.0”, GitCommit:“9e991415386e4cf155a24b1da15becaa390438d8", GitTreeState:
“clean”, BuildDate:“2020-03-25T14:56:30Z”, GoVersion:“go1.13.8”, Compiler:“gc”, Platform:“linux/amd64”}
controlplane $

Kindly let me know what is the issue.

Mohamed Ayman:
Try to restart the lab and check the following steps:
To upgrade the master node, run

kubectl drain master/controlplane --ignore-daemonsets
apt update
apt install kubeadm=1.19.0-00
kubeadm upgrade apply v1.19.0
apt install kubelet=1.19.0-00
kubectl uncordon master

To upgrade the worker nodes, run

master$ kubectl drain node01 --ignore-daemonsets
master$ ssh node01
node01$ apt update
node01$ apt install kubeadm=1.19.0-00
node01$ apt install kubelet=1.19.0-00
node01$ kubeadm upgrade node 
master$ kubectl uncordon node01

Mohamed Ayman:
You can also look at the kubernetes documentation:
https://v1-19.docs.kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/

Kathiresh Muthusamy:
thank you

Mohamed Ayman:
You’re welcome

Rusty:
@Mohamed Ayman Doing God’s work!