Skip to content

Commit 469dc64

Browse files
authored
Draining A Node (#142)
NNF Daemonsets will be drained from nodes via the cray.nnf.node.drain taint. The CSI driver must tolerate that so it can stick around and complete the unmounts that k8s will request. If CSI were allowed to be drained then nothing would remain to satisfy the k8s unmounts, and k8s would leave the NNF software in Terminating state. Signed-off-by: Dean Roehrich <dean.roehrich@hpe.com>
1 parent e4dc599 commit 469dc64

3 files changed

Lines changed: 55 additions & 0 deletions

File tree

docs/guides/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@
2020

2121
* [User Containers](user-containers/readme.md)
2222

23+
## Node Management
2324

25+
* [Draining A Node] (node-management/drain.md)
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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.

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ nav:
1919
- 'User Containers': 'guides/user-containers/readme.md'
2020
- 'Lustre External MGT': 'guides/external-mgs/readme.md'
2121
- 'Global Lustre': 'guides/global-lustre/readme.md'
22+
- 'Draining A Node': 'guides/node-management/drain.md'
2223
- 'RFCs':
2324
- rfcs/index.md
2425
- 'Rabbit Request For Comment Process': 'rfcs/0001/readme.md'

0 commit comments

Comments
 (0)