root@master:~# kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.1", GitCommit:"4c9411232e10168d7b050c49a1b59f6df9d7ea4b", GitTreeState:"clean", BuildDate:"2023-04-14T13:20:04Z", GoVersion:"go1.20.3", Compiler:"gc", Platform:"linux/amd64"}
root@master:~#
run kubeadm version to get the k8s version .
below command will check if any of the new version or patches available for us .
root@master:~# 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 -o yaml'
[preflight] Running pre-flight checks.
[upgrade] Running cluster health checks
[upgrade] Fetching available versions to upgrade to
[upgrade/versions] Cluster version: v1.27.1
[upgrade/versions] kubeadm version: v1.27.1
[upgrade/versions] Target version: v1.27.1
[upgrade/versions] Latest version in the v1.27 series: v1.27.1
root@master:~#
apt update
update new cache for the repostiories
apt-cahce madison kubeadm
to check how many version are available in the system
apt-mark unhlold kubeadm
apt-get udpate
apt-get install -y kubeadm=1.22.2
apt-mark hold kubeadm
it will set un hold .if any update yum or another this version remain same
kubeadm version to get the latest version
systemctl daemon-reload if we doing any changes on the node side
k drain node name -> need to put the node in the maintenance mode
systemctl daemon-reload
systemctl restart kublet
check status
kubectl uncordon nodename
now node is ready for use .