diff --git a/hardware_enablement/psap-node-feature-discovery-operator.adoc b/hardware_enablement/psap-node-feature-discovery-operator.adoc index 72299e0d566..1a336b2e7a1 100644 --- a/hardware_enablement/psap-node-feature-discovery-operator.adoc +++ b/hardware_enablement/psap-node-feature-discovery-operator.adoc @@ -23,6 +23,8 @@ include::modules/creating-nfd-cr-web-console.adoc[leveloffset=+2] include::modules/psap-configuring-node-feature-discovery.adoc[leveloffset=+1] +include::modules/configuring-nfd-worker-master-pod-scheduling.adoc[leveloffset=+1] + include::modules/nfd-rules-about.adoc[leveloffset=+1] include::modules/nfd-rules-using.adoc[leveloffset=+1] diff --git a/modules/configuring-nfd-worker-master-pod-scheduling.adoc b/modules/configuring-nfd-worker-master-pod-scheduling.adoc new file mode 100644 index 00000000000..3048940dbb2 --- /dev/null +++ b/modules/configuring-nfd-worker-master-pod-scheduling.adoc @@ -0,0 +1,114 @@ +// Module included in the following assemblies: +// +// * hardware_enablement/psap-node-feature-discovery-operator.adoc + +:_mod-docs-content-type: PROCEDURE +[id="configuring-nfd-worker-master-pod-scheduling_{context}"] += Configure node feature discovery worker and controller pod scheduling + +[role="_abstract"] +You can control where Node Feature Discovery (NFD) worker and controller pods are scheduled by configuring node selectors and tolerations in the `NodeFeatureDiscovery` custom resource. + +.Prerequisites + +* You have access to an {product-title} cluster. +* You installed the {oc-first}. +* You logged in as a user with `cluster-admin` privileges. +* You installed the NFD Operator. +{empty} + +[NOTE] +==== +If you specify `workerNodeSelector` without the required `workerTolerations`, NFD worker pods are not scheduled on tainted nodes, even when the nodes match the configured node selector. +==== + +.Procedure + +. Label the target node with the label you will use in `workerNodeSelector`: ++ +[source,terminal] +---- +$ oc label node special-node=true +---- + +. Edit the `NodeFeatureDiscovery` custom resource: ++ +[source,terminal] +---- +$ oc edit NodeFeatureDiscovery nfd-instance -n openshift-nfd +---- + +. Configure the scheduling options: ++ +[source,yaml] +---- +apiVersion: nfd.openshift.io/v1 +kind: NodeFeatureDiscovery +metadata: + name: nfd-instance + namespace: openshift-nfd +spec: + enableTaints: false + instance: "" + + operand: + imagePullPolicy: IfNotPresent + servicePort: 12000 + + workerNodeSelector: + special-node: "true" + + workerTolerations: + - key: "node-role.kubernetes.io/ai" + operator: "Exists" + effect: "NoSchedule" + + - key: "node-role.kubernetes.io/ai" + operator: "Exists" + effect: "NoExecute" + + masterTolerations: + - key: "node-role.kubernetes.io/master" + operator: "Exists" + effect: "NoSchedule" + + - key: "node-role.kubernetes.io/control-plane" + operator: "Exists" + effect: "NoSchedule" + + prunerOnDelete: false + topologyUpdater: false +---- ++ +where: ++ +`workerNodeSelector`:: Controls where the NFD worker DaemonSet is scheduled. Configure this field under `spec.operand`. +`workerTolerations`:: Allows the NFD worker pods to tolerate taints applied to the selected nodes. Configure this field under `spec.operand`. +`masterTolerations`:: Allows NFD controller pods to tolerate taints on control plane nodes. The tolerations must match the node taints for the controller pods to schedule successfully. + +.Verification + +. Verify that the NFD worker pods are scheduled on the expected nodes: ++ +[source,terminal] +---- +$ oc get pods -n openshift-nfd -o wide +---- + +. Verify the node labels: ++ +[source,terminal] +---- +$ oc get nodes --show-labels +---- + +. Verify the node taints: ++ +[source,terminal] +---- +$ oc get node -o jsonpath='{.spec.taints}' +---- + +After verification, NFD worker pods should appear on nodes with the `special-node=true` label, or with the label you configured in `workerNodeSelector`. Controller pods should remain `Running` in the `openshift-nfd` namespace. + +