How to reboot a kubernetes node (vm instance) in GKE

4/5/2018

I have a GKE k8s cluster and wanted to reboot one of the nodes (a vm reboot, and not just the kubelet).

I was looking for the correct why (if there is) than just resetting the vm directly. But I couldnt find anything in the web.

So, my plan is to use these steps:

  1. drain the node
  2. reboot

Is there a correct (other) way?

-- rrw
google-kubernetes-engine
kubernetes

1 Answer

4/5/2018

No, that is the correct way -- and you don't have to drain the Node first unless there is some extenuating circumstance. One of the major features of kubernetes is that it will route around the "damage" of having a Node disappear suddenly.

You could cordon the Node, if you wish to prevent future Pods from being scheduled on the soon-to-be-rebooted Node, but that's merely a time-saver, and shouldn't affect the reboot process.

Just be sure to verify the "schedulable" status of the Node after the reboot if you do use cordon or drain; I can't this very second recall whether they automatically re-register in a schedulable state.

-- mdaniel
Source: StackOverflow