Answer a question

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 way (if there is one) 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?

Answers

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.

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐