These steps only apply when using the TopoLVM StorageClass and PVCs. If only generic ephemeral volumes are used, these steps are not necessary.
To remove a node and volumes/pods on the node from the cluster, follow these steps:
-
Run
kubectl drain NODE --ignore-daemonsets=true
.--ignore-daemonsets=true
allows the command to succeed even if pods managed by Daemonset exist (e.g. topolvm-node). If drain stacks due to PodDisruptionBudgets or something, try--force
option. -
Run
kubectl delete nodes NODE
-
TopoLVM will remove Pods and PersistentVolumeClaims on the node.
-
StatefulSet
controller reschedules Pods and PVCs on other nodes.
To reboot a node without removing volumes, follow these steps:
-
Run
kubectl drain NODE --ignore-daemonsets=true
.--ignore-daemonsets=true
allows the command to succeed even if pods managed by Daemonset exist (e.g. topolvm-node). -
Reboot the node.
-
Run
kubectl uncordon NODE
after the node comes back online. -
After reboot, Pods will be rescheduled to the same node because PVCs remain intact.