While upgrading master and worker , should we cordon first , then drain or only . . .

Sachin:
While upgrading master and worker , should we cordon first , then drain or only drain is enough ?

Dennis:
Drain- drains the node then makes it unschedulable. While uncordon basically does the opposite it allows the node to be scheduled again. Each part is important.

Sachin:
Yes I know this:slightly_smiling_face:. I want to ask what are the correct steps
k cordon controlplan , or just k drain controlplane --ignore-daemonsets and after upgrade k uncordon controlplan

Dennis:
The order would be drain, upgrade, then uncordon.https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/|https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/

Dennis:
It’s also kubeadm not k - kubectl for upgrades

Sachin:
thank you

Leo Pastor:
@Sachin You don’t need to explicitly cordon the controlplane, since “kubectl drain controlplane” do both: 1) evicts the workloads/“drains” the node, and 2) cordon the node/mark it unschedulable.

Leo Pastor:
Follow the sequence on the doc that @Dennis pointed out above, paying attention to: 1) the command you have to use on each step - they are a mix of kubectl and kubeadm (and other linux related commands); and 2) where to issue the commands - specially when you upgrade worker nodes after upgrading control plane node(s).