Skip to main content

Reboot a node

k8s resources are usually independent of any specific node and kubectl makes this task easy.

NOTE - you would still need to verify the resources which utilises PVCs and ensure that PVCs are detachable and re-attachable so that pods do not suffer while getting migrated from one node to another.

Steps

  1. You need to cordon the node. cordoning marks a node as unscheduled so that no new pods are placed there
kubectl cordon <node-name>

you can confirm the node's status as "SchedulingDisabled" by running:

kubectl get nodes
  1. You need to drain the node. first confirm by doing the dry run
kubectl drain <node-name> --ignore-daemonsets --delete-emptydir-data --dry-run=server

After you verify the listed resources, you can proceed with actually draining the node.

  1. Reboot the node.

There are multiple methods to reboot the node, depends upon platform. you can also exec into the node and run

reboot
  1. wait for a few minutes and verify if node have become healthy again
kubectl get nodes
  1. You can now uncordon the node.
kubectl uncordon <node-name>