1 min read | by Jordi Prats
Using kubectl drain you can evict pods and disabled scheduling for a node so you can proceed with some maintenance. Once this maintenance is over we will need to allow pods to be scheduled to this node, removing the SchedulingDisabled:
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
nauvoo.pet2cattle.com Ready control-plane,master 19d v1.20.4+k3s1
tycho.pet2cattle.com Ready,SchedulingDisabled <none> 9m25s v1.20.4+k3s1
To do so we are going to use kubectl uncordon to allow pods to be scheduled on this node:
$ kubectl uncordon tycho.pet2cattle.com
node/tycho.pet2cattle.com uncordoned
Repeating the kubectl get nodes we will be able to see that the SchedulingDisabled have disappeared for node tycho.pet2cattle.com:
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
nauvoo.pet2cattle.com Ready control-plane,master 19d v1.20.4+k3s1
tycho.pet2cattle.com Ready <none> 9m46s v1.20.4+k3s1
Posted on 29/04/2021