Confusion related to draining the node in cluster upgrade

Hi, As per the kubernetes documentation, the control plane node is drained before the kubelet upgrade. I am confused what happens when we drain the node. I understand with kubeadm the control plane components run as pods, but draining the node will evict those pods? And if we have only one master where will they be scheduled? Also why we drain only before kubelet upgrade and not before that.

Regards
Ankit

Hi @ankitfreeway

  • The drain only affects pods managed by the scheduler, the control plane components are all static pods, so he continues to run on the controlplane. You can test it by draining the controlplane and after you run.
kubectl get pods -n kube-system
  • You can drain at the beginning of the process. The goal of draining is to not have downtime and move all the workloads to another node.

Thanks @mmkmou! This was helpful and now I understand!