|
| 1 | +# Draining A Node |
| 2 | + |
| 3 | +The NNF software consists of a collection of DaemonSets and Deployments. The pods |
| 4 | +on the Rabbit nodes are usually from DaemonSets. Because of this, the `kubectl drain` |
| 5 | +command is not able to remove the NNF software from a node. See [Safely Drain a Node](https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/) for details about |
| 6 | +the limitations posed by DaemonSet pods. |
| 7 | + |
| 8 | +Given the limitations of DaemonSets, the NNF software will be drained by using taints, |
| 9 | +as described in |
| 10 | +[Taints and Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/). |
| 11 | + |
| 12 | +## Drain NNF Pods From A Rabbit Node |
| 13 | + |
| 14 | +Drain the NNF software from a node by applying the `cray.nnf.node.drain` taint. |
| 15 | +The CSI driver pods will remain on the node to satisfy any unmount requests from k8s |
| 16 | +as it cleans up the NNF pods. |
| 17 | + |
| 18 | +```shell |
| 19 | +kubectl taint node $NODE cray.nnf.node.drain=true:NoSchedule cray.nnf.node.drain=true:NoExecute |
| 20 | +``` |
| 21 | + |
| 22 | +To restore the node to service, remove the `cray.nnf.node.drain` taint. |
| 23 | + |
| 24 | +```shell |
| 25 | +kubectl taint node $NODE cray.nnf.node.drain- |
| 26 | +``` |
| 27 | + |
| 28 | +## The CSI Driver |
| 29 | + |
| 30 | +While the CSI driver pods may be drained from a Rabbit node, it is advisable not to do so. |
| 31 | + |
| 32 | +**Warning** K8s relies on the CSI driver to unmount any filesystems that may have |
| 33 | +been mounted into a pod's namespace. If it is not present when k8s is attempting |
| 34 | +to remove a pod then the pod may be left in "Terminating" state. This is most |
| 35 | +obvious when draining the `nnf-dm-worker` pods which usually have filesystems |
| 36 | +mounted in them. |
| 37 | + |
| 38 | +Drain the CSI driver pod from a node by applying the `cray.nnf.node.drain.csi` |
| 39 | +taint. |
| 40 | + |
| 41 | +```shell |
| 42 | +kubectl taint node $NODE cray.nnf.node.drain.csi=true:NoSchedule cray.nnf.node.drain.csi=true:NoExecute |
| 43 | +``` |
| 44 | + |
| 45 | +To restore the CSI driver pods to that node, remove the `cray.nnf.node.drain.csi` taint. |
| 46 | + |
| 47 | +```shell |
| 48 | +kubectl taint node $NODE cray.nnf.node.drain.csi- |
| 49 | +``` |
| 50 | + |
| 51 | +This taint will also drain the remaining NNF software if has not already been |
| 52 | +drained by the `cray.nnf.node.drain` taint. |
0 commit comments