Manually drain a node


#1

Is there a way to manually taint, drain, uncordon, and untaint a node to cleanly shut it down for OS patching and reboots while maintaining uptime in container replicas?


#2

The underlying kubernetes primitives for draining the node are all you need here: https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/

To summarize:

  1. On a master node, gravity shell and use kubectl to drain the node you want to patch or reboot
  2. Do the action on the node
  3. On a master node, gravity shell and uncordon the node

To maintain uptime of replicas ensure the pod disruption budgets are set accordingly https://kubernetes.io/docs/concepts/workloads/pods/disruptions/


#3

Thank you. That’s exactly what I was looking for.


#4

you can also automate those actions using gravity exec -i <command> instead of interactive gravity shell one