1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00

OCPBUGS-13794: Added NodeFeatureRule to the docs

This commit is contained in:
Andrew Taylor
2023-12-06 07:48:30 -05:00
committed by openshift-cherrypick-robot
parent 334aa91b27
commit 0472580840
3 changed files with 66 additions and 0 deletions

View File

@@ -16,6 +16,10 @@ include::modules/psap-using-node-feature-discovery-operator.adoc[leveloffset=+1]
include::modules/psap-configuring-node-feature-discovery.adoc[leveloffset=+1]
include::modules/nfd-rules-about.adoc[leveloffset=+1]
include::modules/nfd-rules-using.adoc[leveloffset=+1]
include::modules/psap-node-feature-discovery-using-topology-updater.adoc[leveloffset=+1]
include::modules/psap-node-feature-discovery-topology-updater-command-reference.adoc[leveloffset=+2]

View File

@@ -0,0 +1,11 @@
// Module included in the following assemblies:
//
// * hardware_enablement/psap-node-feature-discovery-operator.adoc
:_mod-docs-content-type: CONCEPT
[id="nfd-rules-about_{context}"]
= About the NodeFeatureRule custom resource
`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.
`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.

View File

@@ -0,0 +1,51 @@
// Module included in the following assemblies:
//
// * hardware_enablement/psap-node-feature-discovery-operator.adoc
:_mod-docs-content-type: PROCEDURE
[id="nfd-rules-using_{context}"]
= Using the NodeFeatureRule custom resource
Create a `NodeFeatureRule` object to label nodes if a set of rules match the conditions.
.Procedure
. Create a custom resource file named `nodefeaturerule.yaml` that contains the following text:
+
[source,yaml]
----
apiVersion: nfd.openshift.io/v1
kind: NodeFeatureRule
metadata:
name: example-rule
spec:
rules:
- name: "example rule"
labels:
"example-custom-feature": "true"
# Label is created if all of the rules below match
matchFeatures:
# Match if "veth" kernel module is loaded
- feature: kernel.loadedmodule
matchExpressions:
veth: {op: Exists}
# Match if any PCI device with vendor 8086 exists in the system
- feature: pci.device
matchExpressions:
vendor: {op: In, value: ["8086"]}
----
+
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.
. Apply the `nodefeaturerule.yaml` file to your cluster by running the following command:
+
[source,terminal]
----
$ oc apply -f https://raw.githubusercontent.com/kubernetes-sigs/node-feature-discovery/v0.13.6/examples/nodefeaturerule.yaml
----
The example applies the feature label on nodes with the `veth` module loaded and any PCI device with vendor code `8086` exists.
+
[NOTE]
====
A relabeling delay of up to 1 minute might occur.
====