Which is best strategy of reboot of Linux node in kubernetes cluster

9/17/2019

a) Plain reboot command. or b) Execute kubectl drain and then reboot.

-- Sumit Kumar
containers
docker
kubectl
kubernetes

1 Answer

9/17/2019

Definitely option-2 using kubectl drain approach.

Before reboot:

kubectl drain $NODENAME will gracefully terminate all pods on the node while marking the node as unschedulable.

After reboot:

Once the reboot is done and its good to go then make the node schedulable again: kubectl uncordon $NODENAME.

Please go through this documentation.

Directly running plain reboot on node, will affect all the pods running on that node so don't recommends that approach.

Hope this helps.

-- mchawre
Source: StackOverflow