You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`NodeFeatureRule` objects are a `NodeFeatureDiscovery` custom resource designed for rule-based custom labeling of nodes. Some use cases include application-specific labeling or distribution by hardware vendors to create specific labels for their devices.
10
+
11
+
`NodeFeatureRule` objects provide a method to create vendor- or application-specific labels and taints. It uses a flexible rule-based mechanism for creating labels and optionally taints based on node features.
Create a `NodeFeatureRule` object to label nodes if a set of rules match the conditions.
10
+
11
+
.Procedure
12
+
13
+
. Create a custom resource file named `nodefeaturerule.yaml` that contains the following text:
14
+
+
15
+
[source,yaml]
16
+
----
17
+
apiVersion: nfd.openshift.io/v1
18
+
kind: NodeFeatureRule
19
+
metadata:
20
+
name: example-rule
21
+
spec:
22
+
rules:
23
+
- name: "example rule"
24
+
labels:
25
+
"example-custom-feature": "true"
26
+
# Label is created if all of the rules below match
27
+
matchFeatures:
28
+
# Match if "veth" kernel module is loaded
29
+
- feature: kernel.loadedmodule
30
+
matchExpressions:
31
+
veth: {op: Exists}
32
+
# Match if any PCI device with vendor 8086 exists in the system
33
+
- feature: pci.device
34
+
matchExpressions:
35
+
vendor: {op: In, value: ["8086"]}
36
+
----
37
+
+
38
+
This custom resource specifies that labelling occurs when the `veth` module is loaded and any PCI device with vendor code `8086` exists in the cluster.
39
+
40
+
. Apply the `nodefeaturerule.yaml` file to your cluster by running the following command:
0 commit comments