• Kubernetes: How to evict a Pod from a node

    3 min read

    When we don't have the Pod's resources correctly configured we might face the need of moving a Pod to a different node. Although we could change the nodeSelector or adjust the resources to that it gets scheduled on a different node, it might urge us to fix an issue. To do so we can use kubectl drain

    At the end of the day what we want it really is "drain the node of that kind of Pods". As kind of by product the node ends up being cordoned so we are sure the Pod won't be scheduled again on the same node.


  • kubectl uncordon: mark node as schedulable

    1 min read

    uncordon kubectl

    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



From pet to cattle
Treat your kubernetes clusters like cattle, not pets