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
- You need to cordon the node.
cordoningmarks 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
- 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.
- Reboot the node.
There are multiple methods to reboot the node, depends upon platform. you can also exec into the node and run
reboot
- wait for a few minutes and verify if node have become healthy again
kubectl get nodes
- You can now uncordon the node.
kubectl uncordon <node-name>