Issue:- Recently updated my kubernetes cluster
[[email protected] ~]# kubeadm upgrade apply v1.21.3
[upgrade/config] Making sure the configuration is correct:
[upgrade/config] Reading configuration from the cluster...
[addons] Applied essential addon: CoreDNS
[addons] Applied essential addon: kube-proxy
[upgrade/successful] SUCCESS! Your cluster was upgraded to "v1.21.3". Enjoy!
[upgrade/kubelet] Now that your control plane is upgraded, please proceed with upgrading your kubelets if you haven't already done so.
So the upgrade message clearly shows the cluster was upgraded to "v1.21.3" in master node. However when i run the command to verify
[[email protected] ~]$ kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
k8smaster.unixcloudfusion.in Ready control-plane,master 9d v1.21.2 172.31.36.208 <none> CentOS Linux 7 (Core) 3.10.0-1160.31.1.el7.x86_64 docker://20.10.7
k8sworker1.unixcloudfusion.in NotReady <none> 9d v1.21.3 172.31.39.6 <none> CentOS Linux 7 (Core) 3.10.0-1160.31.1.el7.x86_64 docker://20.10.7
k8sworker2.unixcloudfusion.in Ready <none> 9d v1.21.3 172.31.46.144 <none> CentOS Linux 7 (Core) 3.10.0-1160.31.1.el7.x86_64 docker://20.10.7
Even after updating the version still showed v1.21.2
Resolution:-
So the cluster is showing you the old version because you have not updated the kubelet which updates the version in the etcd which is storing all the configuration. So just run the below command to update the kubelet and kubectl
[[email protected] ~]$ sudo yum install -y kubelet kubectl --disableexcludes=kubernetes
Loaded plugins: fastestmirror, versionlock
Loading mirror speeds from cached hostfile
* base: mirror.centos.org
* epel: repos.del.extreme-ix.org
* extras: mirror.centos.org
Updated:
kubectl.x86_64 0:1.21.3-0
Updated:
kubelet.x86_64 0:1.21.3-0
Complete!
Once the update is complete for both the kubectl and kubelet , now verify the version again
[[email protected] ~]$ kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
k8smaster.unixcloudfusion.in Ready control-plane,master 9d v1.21.3 172.31.36.208 <none> CentOS Linux 7 (Core) 3.10.0-1160.31.1.el7.x86_64 docker://20.10.7
k8sworker1.unixcloudfusion.in NotReady <none> 9d v1.21.3 172.31.39.6 <none> CentOS Linux 7 (Core) 3.10.0-1160.31.1.el7.x86_64 docker://20.10.7
k8sworker2.unixcloudfusion.in Ready <none> 9d v1.21.3 172.31.46.144 <none> CentOS Linux 7 (Core) 3.10.0-1160.31.1.el7.x86_64 docker://20.10.7
So the issue is resolved and it shows the new version
0 comments:
Post a Comment