Skip to content

Commit 6fb9eec

Browse files
Relationship betw cray.nnf.node.drain taint and Storage resource. (#188)
Signed-off-by: Dean Roehrich <dean.roehrich@hpe.com> Co-authored-by: Blake Devcich <89158881+bdevcich@users.noreply.github.com>
1 parent daed78b commit 6fb9eec

3 files changed

Lines changed: 64 additions & 6 deletions

File tree

docs/guides/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424

2525
## Node Management
2626

27-
* [Draining A Node](node-management/drain.md)
27+
* [Disable or Drain a Node](node-management/drain.md)
2828
* [Debugging NVMe Namespaces](node-management/nvme-namespaces.md)

docs/guides/node-management/drain.md

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,40 @@
1-
# Draining A Node
1+
# Disable Or Drain A Node
2+
3+
## Disabling a node
4+
5+
A Rabbit node can be manually disabled, indicating to the WLM that it should not schedule more jobs on the node. Jobs currently on the node will be allowed to complete at the discretion of the WLM.
6+
7+
Disable a node by setting its Storage state to `Disabled`.
8+
9+
```shell
10+
kubectl patch storage $NODE --type=json -p '[{"op":"replace", "path":"/spec/state", "value": "Disabled"}]'
11+
```
12+
13+
When the Storage is queried by the WLM, it will show the disabled status.
14+
15+
```console
16+
$ kubectl get storages
17+
NAME STATE STATUS MODE AGE
18+
kind-worker2 Enabled Ready Live 10m
19+
kind-worker3 Disabled Disabled Live 10m
20+
```
21+
22+
To re-enable a node, set its Storage state to `Enabled`.
23+
24+
```shell
25+
kubectl patch storage $NODE --type=json -p '[{"op":"replace", "path":"/spec/state", "value": "Enabled"}]'
26+
```
27+
28+
The Storage state will show that it is enabled.
29+
30+
```console
31+
kubectl get storages
32+
NAME STATE STATUS MODE AGE
33+
kind-worker2 Enabled Ready Live 10m
34+
kind-worker3 Enabled Ready Live 10m
35+
```
36+
37+
## Draining a node
238

339
The NNF software consists of a collection of DaemonSets and Deployments. The pods
440
on the Rabbit nodes are usually from DaemonSets. Because of this, the `kubectl drain`
@@ -9,7 +45,11 @@ Given the limitations of DaemonSets, the NNF software will be drained by using t
945
as described in
1046
[Taints and Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/).
1147

12-
## Drain NNF Pods From A Rabbit Node
48+
This would be used only after the WLM jobs have been removed from that Rabbit (preferably) and there is some reason to also remove the NNF software from it. This might be used before a Rabbit is powered off and pulled out of the cabinet, for example, to avoid leaving pods in "Terminating" state (harmless, but it's noise).
49+
50+
If an admin used this taint before power-off it would mean there wouldn't be "Terminating" pods lying around for that Rabbit. After a new/same Rabbit is put back in its place, the NNF software won't jump back on it while the taint is present. The taint can be removed at any time, from immediately after the node is powered off up to some time after the new/same Rabbit is powered back on.
51+
52+
### Drain NNF pods from a rabbit node
1353

1454
Drain the NNF software from a node by applying the `cray.nnf.node.drain` taint.
1555
The CSI driver pods will remain on the node to satisfy any unmount requests from k8s
@@ -19,15 +59,33 @@ as it cleans up the NNF pods.
1959
kubectl taint node $NODE cray.nnf.node.drain=true:NoSchedule cray.nnf.node.drain=true:NoExecute
2060
```
2161

62+
This will cause the node's `Storage` resource to be drained:
63+
64+
```console
65+
$ kubectl get storages
66+
NAME STATE STATUS MODE AGE
67+
kind-worker2 Enabled Drained Live 5m44s
68+
kind-worker3 Enabled Ready Live 5m45s
69+
```
70+
71+
The `Storage` resource will contain the following message indicating the reason it has been drained:
72+
73+
```console
74+
$ kubectl get storages rabbit1 -o json | jq -rM .status.message
75+
Kubernetes node is tainted with cray.nnf.node.drain
76+
```
77+
2278
To restore the node to service, remove the `cray.nnf.node.drain` taint.
2379

2480
```shell
2581
kubectl taint node $NODE cray.nnf.node.drain-
2682
```
2783

28-
## The CSI Driver
84+
The `Storage` resource will revert to a `Ready` status.
85+
86+
### The CSI driver
2987

30-
While the CSI driver pods may be drained from a Rabbit node, it is advisable not to do so.
88+
While the CSI driver pods may be drained from a Rabbit node, it is inadvisable to do so.
3189

3290
**Warning** K8s relies on the CSI driver to unmount any filesystems that may have
3391
been mounted into a pod's namespace. If it is not present when k8s is attempting

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ nav:
2020
- 'User Containers': 'guides/user-containers/readme.md'
2121
- 'Lustre External MGT': 'guides/external-mgs/readme.md'
2222
- 'Global Lustre': 'guides/global-lustre/readme.md'
23-
- 'Draining A Node': 'guides/node-management/drain.md'
23+
- 'Disable or Drain a Node': 'guides/node-management/drain.md'
2424
- 'Debugging NVMe Namespaces': 'guides/node-management/nvme-namespaces.md'
2525
- 'Directive Breakdown': 'guides/directive-breakdown/readme.md'
2626
- 'RFCs':

0 commit comments

Comments
 (0)