Skip to content

Commit 2581529

Browse files
committed
docs: slightly rework how tainting is documented
Small edit to how tainting is documented in the customization guide. First, make the heading shorter. Then, move the detailed example yaml and its description further down in the document to the section that describes the "taints" field - this is now similar how extended resources are documented.
1 parent d555109 commit 2581529

File tree

1 file changed

+42
-38
lines changed

1 file changed

+42
-38
lines changed

docs/usage/customization-guide.md

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ re-labeling delay up to the sleep-interval of nfd-worker (1 minute by default).
161161
See [Feature rule format](#feature-rule-format) for detailed description of
162162
available fields and how to write labeling rules.
163163

164-
### NodeFeatureRule tainting feature
164+
### Node tainting
165165

166166
This feature is experimental.
167167

@@ -178,48 +178,14 @@ To enable the tainting feature, `--enable-taints` flag needs to be set to `true`
178178
If the flag `--enable-taints` is set to `false` (i.e. disabled), taints defined in
179179
the NodeFeatureRule CR have no effect and will be ignored by the NFD master.
180180

181+
See documentation of the [taints field](#taints) for detailed description how
182+
to specify taints in the NodeFeatureRule object.
183+
181184
> **NOTE:** Before enabling any taints, make sure to edit nfd-worker daemonset
182185
> to tolerate the taints to be created. Otherwise, already running pods that do
183186
> not tolerate the taint are evicted immediately from the node including the
184187
> nfd-worker pod.
185188

186-
Example NodeFeatureRule with custom taints:
187-
188-
```yaml
189-
apiVersion: nfd.k8s-sigs.io/v1alpha1
190-
kind: NodeFeatureRule
191-
metadata:
192-
name: my-sample-rule-object
193-
spec:
194-
rules:
195-
- name: "my sample taint rule"
196-
taints:
197-
- effect: PreferNoSchedule
198-
key: "feature.node.kubernetes.io/special-node"
199-
value: "true"
200-
- effect: NoExecute
201-
key: "feature.node.kubernetes.io/dedicated-node"
202-
matchFeatures:
203-
- feature: kernel.loadedmodule
204-
matchExpressions:
205-
dummy: {op: Exists}
206-
- feature: kernel.config
207-
matchExpressions:
208-
X86: {op: In, value: ["y"]}
209-
```
210-
211-
In this example, if the `my sample taint rule` rule is matched, `feature.node.kubernetes.io/pci-0300_1d0f.present=true:NoExecute`
212-
and `feature.node.kubernetes.io/cpu-cpuid.ADX:NoExecute` taints are set on the node.
213-
214-
There are some limitations to the namespace part (i.e. prefix/) of the taint
215-
key:
216-
217-
- `kubernetes.io/` and its sub-namespaces (like `sub.ns.kubernetes.io/`) cannot
218-
generally be used
219-
- the only exception is `feature.node.kubernetes.io/` and its sub-namespaces
220-
(like `sub.ns.feature.node.kubernetes.io`)
221-
- unprefixed keys (like `foo`) keys are disallowed
222-
223189
## Local feature source
224190

225191
NFD-Worker has a special feature source named `local` which is an integration
@@ -648,6 +614,44 @@ NFD enforces some limitations to the namespace (or prefix)/ of the annotations:
648614
where the `value` is optional. Effect could be `NoSchedule`, `PreferNoSchedule`
649615
or `NoExecute`. To learn more about the meaning of these effects, check out k8s [documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/).
650616

617+
Example NodeFeatureRule with taints:
618+
619+
```yaml
620+
apiVersion: nfd.k8s-sigs.io/v1alpha1
621+
kind: NodeFeatureRule
622+
metadata:
623+
name: my-sample-rule-object
624+
spec:
625+
rules:
626+
- name: "my sample taint rule"
627+
taints:
628+
- effect: PreferNoSchedule
629+
key: "feature.node.kubernetes.io/special-node"
630+
value: "true"
631+
- effect: NoExecute
632+
key: "feature.node.kubernetes.io/dedicated-node"
633+
matchFeatures:
634+
- feature: kernel.loadedmodule
635+
matchExpressions:
636+
dummy: {op: Exists}
637+
- feature: kernel.config
638+
matchExpressions:
639+
X86: {op: In, value: ["y"]}
640+
```
641+
642+
In this example, if the `my sample taint rule` rule is matched,
643+
`feature.node.kubernetes.io/pci-0300_1d0f.present=true:NoExecute`
644+
and `feature.node.kubernetes.io/cpu-cpuid.ADX:NoExecute` taints are set on the node.
645+
646+
There are some limitations to the namespace part (i.e. prefix/) of the taint
647+
key:
648+
649+
- `kubernetes.io/` and its sub-namespaces (like `sub.ns.kubernetes.io/`) cannot
650+
generally be used
651+
- the only exception is `feature.node.kubernetes.io/` and its sub-namespaces
652+
(like `sub.ns.feature.node.kubernetes.io`)
653+
- unprefixed keys (like `foo`) keys are disallowed
654+
651655
> **NOTE:** taints field is not available for the custom rules of nfd-worker
652656
> and only for NodeFeatureRule objects.
653657

0 commit comments

Comments
 (0)