Hi @Tej_Singh_Rana, Team, While doing the "Practice test cluster upgrade" lab. I . . .

Mudit:
Hi @Tej_Singh_Rana, Team,
While doing the “Practice test cluster upgrade” lab. I directly started with upgrade and below is the output after upgrade, which got upgraded to v1.18.13. It somehow does not give any option for v1.19.x (as asked in the test). Can such situation occur in exam as well, wherein we are asked to upgrade to a higher version and the ‘kubeadm upgrade plan’ shows a lower version. What should we do in that case? Is is possible to upgrade a some higher version which is not shown in ‘kubeadm upgrade plan’?

controlplane $ 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.13
[upgrade/versions] kubeadm version: v1.18.13
I1218 08:46:13.987481    4505 version.go:252] remote version is much newer: v1.20.0; falling back to: stable-1.18
[upgrade/versions] Latest stable version: v1.18.13
[upgrade/versions] Latest stable version: v1.18.13
[upgrade/versions] Latest version in the v1.18 series: v1.18.13
[upgrade/versions] Latest version in the v1.18 series: v1.18.13

Awesome, you're up-to-date! Enjoy!
controlplane $

OE:
The reason that you are seeing this is that you haven’t updated kubeadm itself. You have to do so first, as mentioned in the upgrade steps - https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/

Mudit:
Hi @OE ,
Thanks for your response. However I upgraded kubeadm (to v1.18.13 - which was shown in plan command) also before upgrading anything else. Here is the command history: (I couldn’t fetch the actual output for the first ‘kubeadm upgrade plan’ command as its gone with the scroll):

controlplane $ history
1 clear
2 RED='\033[0;31m'
3 NC='\033[0m'
4 trap 'rm -rf /tmp/load-quiz.sh ; rm -rf /tmp/wait-script.sh' SIGINT SIGQUIT ERR
5 clear
6 while [ ! -f /tmp/wait-script.sh ]; do sleep .2; done
7 chmod 755 /tmp/wait-script.sh; /tmp/wait-script.sh
8 kubectl get nodes
9 kubectl version
10 kubeadm upgrade plan
11 kubectl -n kube-system get cm kubeadm-config -oyaml
12 apt-get update && apt-get install -y --allow-change-held-packages kubeadm=1.18.13-00
13 kubeadm version
14 kubeadm upgrade plan
15 kubeadm upgrade apply v1.18.13
16 kubectl get nodes
17 kubectl drain controlplane
18 kubectl drain controlplane --ignore-daemonsets
19 kubectl get nodes
20 apt-get update && apt-get install -y --allow-change-held-packages kubelet=1.18.13-00 kubectl=1.18.13-00
21 kubeadm upgrade plan
22 sudo systemctl daemon-reload
23 sudo systemctl restart kubelet
24 sudo systemctl status kubelet
25 kubectl uncordon controlplane
26 kubectl get nodes
27 ssh node-1
28 ssh node01
29 kubectl drain node01
30 kubectl drain node01 --ignore-daemonsets
31 kubectl get nodes
32 kubectl get pods --all-namespaces
33 kubectl get pods --all-namespaces -o wide
34 ssh node01
35 kubectl uncordon node01
36 kubectl get nodes
37 kubectl get pods --all-namespaces -o wide
38 kubectl get deployments.apps
39 kubeadm upgrade plan
40 history
controlplane $

OE:
You upgraded it to the version 1.18.13-00. So you can’t install a version above that. Instead, upgrade it to 1.19-00

Mudit:
I spun up the same lab again and here is the output below, which shows stable version is v1.18.13. Although it allowed me to upgrade kubeadm to v1.19.0 but when it is showing the stable version as v1.18.13 in the plan, then would it suggestable to go a higher stable version? And importantly can such scenarios appear in exam wherein we need to ignore such stable version and go with some other version?

controlplane $ kubectl get nodes
NAME STATUS ROLES AGE VERSION
controlplane Ready master 99s v1.18.0
node01 Ready <none> 65s v1.18.0
controlplane $
controlplane $ 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
I1218 09:04:06.898738 5301 version.go:252] remote version is much newer: v1.20.0; falling back to: stable-1.18
[upgrade/versions] Latest stable version: v1.18.13
[upgrade/versions] Latest stable version: v1.18.13
[upgrade/versions] Latest version in the v1.18 series: v1.18.13
[upgrade/versions] Latest version in the v1.18 series: v1.18.13

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.13

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

COMPONENT CURRENT AVAILABLE
API Server v1.18.0 v1.18.13
Controller Manager v1.18.0 v1.18.13
Scheduler v1.18.0 v1.18.13
Kube Proxy v1.18.0 v1.18.13
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.13`

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

_____________________________________________________________________

controlplane $

Tej_Singh_Rana:
Please follow this steps:
https://v1-19.docs.kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/#upgrade-the-first-control-plane-node

Tej_Singh_Rana:
OE saying upgrade the kubeadm version first. Please check the kubeadm version.

apt-mark unhold kubeadm && \
apt-get update && apt-get install -y kubeadm=1.19.0-00 && \
apt-mark hold kubeadm

Mudit:
thanks @OE and @Tej_Singh_Rana. Understood: only after kubeadm is upgraded, then only the plan shows higher stable version. :slightly_smiling_face: Much thanks!