Skip to content

Commit 54f60bc

Browse files
authored
Merge pull request #78787 from abrennan89/OSDOCS-6062
OSDOCS-6062: Steps to create a NodeFeatureDiscovery instance using the CLI for disconnected environment
2 parents a91ae70 + 740895d commit 54f60bc

File tree

4 files changed

+213
-34
lines changed

4 files changed

+213
-34
lines changed

hardware_enablement/psap-node-feature-discovery-operator.adoc

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
:_mod-docs-content-type: ASSEMBLY
2-
[id="node-feature-discovery-operator"]
2+
[id="psap-node-feature-discovery-operator"]
33
= Node Feature Discovery Operator
44
include::_attributes/common-attributes.adoc[]
5-
:context: node-feature-discovery-operator
5+
:context: psap-node-feature-discovery-operator
66

77
toc::[]
88

@@ -12,7 +12,16 @@ include::modules/psap-node-feature-discovery-operator.adoc[leveloffset=+1]
1212

1313
include::modules/psap-installing-node-feature-discovery-operator.adoc[leveloffset=+1]
1414

15-
include::modules/psap-using-node-feature-discovery-operator.adoc[leveloffset=+1]
15+
[id="psap-node-feature-discovery-operator-using-the-operator"]
16+
== Using the Node Feature Discovery Operator
17+
18+
The Node Feature Discovery (NFD) Operator orchestrates all resources needed to run the Node-Feature-Discovery daemon set by watching for a `NodeFeatureDiscovery` custom resource (CR). Based on the `NodeFeatureDiscovery` CR, the Operator creates the operand (NFD) components in the selected namespace. You can edit the CR to use another namespace, image, image pull policy, and `nfd-worker-conf` config map, among other options.
19+
20+
As a cluster administrator, you can create a `NodeFeatureDiscovery` CR by using the {oc-first} or the web console.
21+
22+
include::modules/creating-nfd-cr-cli.adoc[leveloffset=+2]
23+
include::modules/creating-nfd-cr-cli-disconnected.adoc[leveloffset=+2]
24+
include::modules/creating-nfd-cr-web-console.adoc[leveloffset=+2]
1625

1726
include::modules/psap-configuring-node-feature-discovery.adoc[leveloffset=+1]
1827

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hardware_enablement/psap-node-feature-discovery-operator.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="creating-nfd-cr-cli-disconnected_{context}"]
7+
= Creating a NodeFeatureDiscovery CR by using the CLI in a disconnected environment
8+
9+
As a cluster administrator, you can create a `NodeFeatureDiscovery` CR instance by using the {oc-first}.
10+
11+
.Prerequisites
12+
13+
* You have access to an {product-title} cluster
14+
* You installed the {oc-first}.
15+
* You logged in as a user with `cluster-admin` privileges.
16+
* You installed the the NFD Operator.
17+
* You have access to a mirror registry with the required images.
18+
* You installed the `skopeo` CLI tool.
19+
20+
.Procedure
21+
22+
. Determine the digest of the registry image:
23+
24+
.. Run the following command:
25+
+
26+
[source,terminal]
27+
----
28+
$ skopeo inspect docker://registry.redhat.io/openshift4/ose-node-feature-discovery:<openshift_version>
29+
----
30+
+
31+
.Example command
32+
[source,terminal]
33+
----
34+
$ skopeo inspect docker://registry.redhat.io/openshift4/ose-node-feature-discovery:v4.12
35+
----
36+
37+
.. Inspect the output to identify the image digest:
38+
+
39+
.Example output
40+
[source,terminal]
41+
----
42+
{
43+
...
44+
"Digest": "sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
45+
...
46+
}
47+
----
48+
49+
. Use the `skopeo` CLI tool to copy the image from `registry.redhat.io` to your mirror registry, by running the following command:
50+
+
51+
[source,terminal]
52+
----
53+
skopeo copy docker://registry.redhat.io/openshift4/ose-node-feature-discovery@<image_digest> docker://<mirror_registry>/openshift4/ose-node-feature-discovery@<image_digest>
54+
----
55+
+
56+
.Example command
57+
[source,terminal]
58+
----
59+
skopeo copy docker://registry.redhat.io/openshift4/ose-node-feature-discovery@sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef docker://<your-mirror-registry>/openshift4/ose-node-feature-discovery@sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
60+
----
61+
62+
. Create a `NodeFeatureDiscovery` CR:
63+
+
64+
.Example `NodeFeatureDiscovery` CR
65+
[source,yaml,subs="attributes+"]
66+
----
67+
apiVersion: nfd.openshift.io/v1
68+
kind: NodeFeatureDiscovery
69+
metadata:
70+
name: nfd-instance
71+
spec:
72+
operand:
73+
image: <mirror_registry>/openshift4/ose-node-feature-discovery@<image_digest>
74+
imagePullPolicy: Always
75+
workerConfig:
76+
configData: |
77+
core:
78+
# labelWhiteList:
79+
# noPublish: false
80+
sleepInterval: 60s
81+
# sources: [all]
82+
# klog:
83+
# addDirHeader: false
84+
# alsologtostderr: false
85+
# logBacktraceAt:
86+
# logtostderr: true
87+
# skipHeaders: false
88+
# stderrthreshold: 2
89+
# v: 0
90+
# vmodule:
91+
## NOTE: the following options are not dynamically run-time configurable
92+
## and require a nfd-worker restart to take effect after being changed
93+
# logDir:
94+
# logFile:
95+
# logFileMaxSize: 1800
96+
# skipLogHeaders: false
97+
sources:
98+
cpu:
99+
cpuid:
100+
# NOTE: whitelist has priority over blacklist
101+
attributeBlacklist:
102+
- "BMI1"
103+
- "BMI2"
104+
- "CLMUL"
105+
- "CMOV"
106+
- "CX16"
107+
- "ERMS"
108+
- "F16C"
109+
- "HTT"
110+
- "LZCNT"
111+
- "MMX"
112+
- "MMXEXT"
113+
- "NX"
114+
- "POPCNT"
115+
- "RDRAND"
116+
- "RDSEED"
117+
- "RDTSCP"
118+
- "SGX"
119+
- "SSE"
120+
- "SSE2"
121+
- "SSE3"
122+
- "SSE4.1"
123+
- "SSE4.2"
124+
- "SSSE3"
125+
attributeWhitelist:
126+
kernel:
127+
kconfigFile: "/path/to/kconfig"
128+
configOpts:
129+
- "NO_HZ"
130+
- "X86"
131+
- "DMI"
132+
pci:
133+
deviceClassWhitelist:
134+
- "0200"
135+
- "03"
136+
- "12"
137+
deviceLabelFields:
138+
- "class"
139+
customConfig:
140+
configData: |
141+
- name: "more.kernel.features"
142+
matchOn:
143+
- loadedKMod: ["example_kmod3"]
144+
----
145+
146+
. Create the `NodeFeatureDiscovery` CR by running the following command:
147+
+
148+
[source,terminal]
149+
----
150+
$ oc apply -f <filename>
151+
----
152+
153+
.Verification
154+
155+
. Check the status of the `NodeFeatureDiscovery` CR by running the following command:
156+
+
157+
[source,terminal]
158+
----
159+
$ oc get nodefeaturediscovery nfd-instance -o yaml
160+
----
161+
162+
. Check that the pods are running without `ImagePullBackOff` errors by running the following command:
163+
+
164+
[source,terminal]
165+
----
166+
$ oc get pods -n <nfd_namespace>
167+
----

modules/psap-using-node-feature-discovery-operator.adoc renamed to modules/creating-nfd-cr-cli.adoc

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,23 @@
33
// * hardware_enablement/psap-node-feature-discovery-operator.adoc
44

55
:_mod-docs-content-type: PROCEDURE
6-
[id="using-the-node-feature-discovery-operator_{context}"]
7-
= Using the Node Feature Discovery Operator
6+
[id="creating-nfd-cr-cli_{context}"]
7+
= Creating a NodeFeatureDiscovery CR by using the CLI
88

9-
The Node Feature Discovery (NFD) Operator orchestrates all resources needed to run the Node-Feature-Discovery daemon set by watching for a `NodeFeatureDiscovery` CR. Based on the `NodeFeatureDiscovery` CR, the Operator will create the operand (NFD) components in the desired namespace. You can edit the CR to choose another `namespace`, `image`, `imagePullPolicy`, and `nfd-worker-conf`, among other options.
10-
11-
As a cluster administrator, you can create a `NodeFeatureDiscovery` instance using the {product-title} CLI or the web console.
12-
13-
[id="create-cd-cli_{context}"]
14-
== Create a NodeFeatureDiscovery instance using the CLI
15-
16-
As a cluster administrator, you can create a `NodeFeatureDiscovery` CR instance using the CLI.
9+
As a cluster administrator, you can create a `NodeFeatureDiscovery` CR instance by using the {oc-first}.
1710

1811
.Prerequisites
1912

20-
* An {product-title} cluster
21-
* Install the OpenShift CLI (`oc`).
22-
* Log in as a user with `cluster-admin` privileges.
23-
* Install the NFD Operator.
13+
* You have access to an {product-title} cluster
14+
* You installed the {oc-first}.
15+
* You logged in as a user with `cluster-admin` privileges.
16+
* You installed the the NFD Operator.
2417
2518
.Procedure
2619

27-
. Create the following `NodeFeatureDiscovery` Custom Resource (CR), and then save the YAML in the `NodeFeatureDiscovery.yaml` file:
20+
. Create a `NodeFeatureDiscovery` CR:
2821
+
22+
.Example `NodeFeatureDiscovery` CR
2923
[source,yaml,subs="attributes+"]
3024
----
3125
apiVersion: nfd.openshift.io/v1
@@ -110,18 +104,16 @@ spec:
110104
- loadedKMod: ["example_kmod3"]
111105
----
112106

113-
For more details on how to customize NFD workers, refer to the link:https://kubernetes-sigs.github.io/node-feature-discovery/v0.10/advanced/worker-configuration-reference.html[Configuration file reference of nfd-worker].
114-
115-
. Create the `NodeFeatureDiscovery` CR instance by running the following command:
107+
. Create the `NodeFeatureDiscovery` CR by running the following command:
116108
+
117109
[source,terminal]
118110
----
119-
$ oc create -f NodeFeatureDiscovery.yaml
111+
$ oc apply -f <filename>
120112
----
121113

122114
.Verification
123115

124-
* To verify that the instance is created, run:
116+
. Check that the `NodeFeatureDiscovery` CR was created by running the following command:
125117
+
126118
[source,terminal]
127119
----
@@ -141,14 +133,3 @@ nfd-worker-xqbws 1/1 Running 0 60s
141133
----
142134
+
143135
A successful deployment shows a `Running` status.
144-
145-
[id="create-nfd-cr-web-console_{context}"]
146-
== Create a NodeFeatureDiscovery CR using the web console
147-
148-
.Procedure
149-
150-
. Navigate to the *Operators* -> *Installed Operators* page.
151-
. Find *Node Feature Discovery* and see a box under *Provided APIs*.
152-
. Click *Create instance*.
153-
. Edit the values of the `NodeFeatureDiscovery` CR.
154-
. Click *Create*.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hardware_enablement/psap-node-feature-discovery-operator.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="creating-nfd-cr-web-console_{context}"]
7+
= Creating a NodeFeatureDiscovery CR by using the web console
8+
9+
As a cluster administrator, you can create a `NodeFeatureDiscovery` CR by using the {product-title} web console.
10+
11+
.Prerequisites
12+
13+
* You have access to an {product-title} cluster
14+
* You logged in as a user with `cluster-admin` privileges.
15+
* You installed the the NFD Operator.
16+
17+
.Procedure
18+
19+
. Navigate to the *Operators* -> *Installed Operators* page.
20+
. In the *Node Feature Discovery* section, under *Provided APIs*, click *Create instance*.
21+
. Edit the values of the `NodeFeatureDiscovery` CR.
22+
. Click *Create*.

0 commit comments

Comments
 (0)