<commit_before>// Module included in the following assemblies:
//
// * scalability_and_performance/psap-node-feature-discovery-operator.adoc

[id="installing-the-node-feature-discovery-operator_{context}"]
= Installing the Node Feature Discovery Operator

The Node Feature Discovery (NFD) Operator orchestrates all resources needed to run the NFD daemon set. As a cluster administrator, you can install the NFD Operator using the {product-title} CLI or the web console.

[id="install-operator-cli_{context}"]
== Installing the NFD Operator using the CLI

As a cluster administrator, you can install the NFD Operator using the CLI.

.Prerequisites

* An {product-title} cluster
* Install the OpenShift CLI (`oc`).
* Log in as a user with `cluster-admin` privileges.

.Procedure

. Create a namespace for the NFD Operator.

.. Create the following `Namespace` custom resource (CR) that defines the `openshift-nfd-operator` namespace, and then save the YAML in the `nfd-namespace.yaml` file:
+
[source,yaml]
----
apiVersion: v1
kind: Namespace
metadata:
  name: openshift-nfd-operator
----

.. Create the namespace by running the following command:
+
[source,terminal]
----
$ oc create -f nfd-namespace.yaml
----

. Install the NFD Operator in the namespace you created in the previous step by creating the following objects:

.. Create the following `OperatorGroup` CR and save the YAML in the `nfd-operatorgroup.yaml` file:
+
[source,yaml]
----
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  generateName: openshift-nfd-
  name: openshift-nfd
  namespace: openshift-nfd-operator
spec:
  targetNamespaces:
  - openshift-nfd-operator
----

.. Create the `OperatorGroup` CR by running the following command:
+
[source,terminal]
----
$ oc create -f nfd-operatorgroup.yaml
----

.. Run the following command to get the `channel` value required for the next step.
+
[source,terminal]
----
$ oc get packagemanifest openshift-nfd-operator -n openshift-marketplace -o jsonpath='{.status.defaultChannel}'
----
+
.Example output
[source,terminal]
----
nfd.v4.8.0
----

.. Create the following `Subscription` CR and save the YAML in the `nfd-sub.yaml` file:
+
.Example Subscription
[source,yaml]
----
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: nfd
  namespace: openshift-nfd-operator
spec:
  channel: nfd.v4.8.0
  installPlanApproval: Automatic
  name: nfd
  source: redhat-operators
  sourceNamespace: openshift-marketplace
----

.. Create the subscription object by running the following command:
+
[source,terminal]
----
$ oc create -f nfd-sub.yaml
----

.. Change to the `openshift-nfd-operator` project:
+
[source,terminal]
----
$ oc project openshift-nfd-operator
----

.Verification

* To verify that the Operator deployment is successful, run:
+
[source,terminal]
----
$ oc get pods
----
+
.Example output
[source,terminal]
----
$ oc get pods
NAME                            READY   STATUS    RESTARTS   AGE
nfd-master-c92jg                1/1     Running   0          48s
nfd-master-f7gd9                1/1     Running   0          48s
nfd-master-jdg8t                1/1     Running   0          48s
nfd-operator-5b945f7ddd-kt4mm   1/1     Running   0          79s
nfd-worker-6wh9m                1/1     Running   0          47s
nfd-worker-crchk                1/1     Running   0          47s
nfd-worker-mgl7g                1/1     Running   0          47s
----
+
A successful deployment shows a `Running` status.

[id="install-operator-web-console_{context}"]
== Installing the NFD Operator using the web console

As a cluster administrator, you can install the NFD Operator using the web console.

[NOTE]
====
You must create the `Namespace` CR and `OperatorGroup` CR as mentioned in the previous section.
====

.Procedure

. In the {product-title} web console, click *Operators* -> *OperatorHub*.

. Choose *Node Feature Discovery* from the list of available Operators, and then click *Install*.

. On the *Install Operator* page, select *a specific namespace on the cluster*, select the namespace created in the previous section, and then click *Install*.

.Verification

To verify that the NFD Operator installed successfully:

. Navigate to the *Operators* -> *Installed Operators* page.
. Ensure that *Node Feature Discovery* is listed in the *openshift-nfd-operator* project with a *Status* of *InstallSucceeded*.
+
[NOTE]
====
During installation an Operator might display a *Failed* status. If the installation later succeeds with an *InstallSucceeded* message, you can ignore the *Failed* message.
====

.Troubleshooting

If the Operator does not appear as installed, troubleshoot further:

. Navigate to the *Operators* -> *Installed Operators* page and inspect the *Operator Subscriptions* and *Install Plans* tabs for any failure or errors under *Status*.
. Navigate to the *Workloads* -> *Pods* page and check the logs for pods in the `openshift-nfd-operator` project.<commit_msg>Bug 1987341: NFD Operator shows different namespace<commit_after>// Module included in the following assemblies:
//
// * scalability_and_performance/psap-node-feature-discovery-operator.adoc

[id="installing-the-node-feature-discovery-operator_{context}"]
= Installing the Node Feature Discovery Operator

The Node Feature Discovery (NFD) Operator orchestrates all resources needed to run the NFD daemon set. As a cluster administrator, you can install the NFD Operator using the {product-title} CLI or the web console.

[id="install-operator-cli_{context}"]
== Installing the NFD Operator using the CLI

As a cluster administrator, you can install the NFD Operator using the CLI.

.Prerequisites

* An {product-title} cluster
* Install the OpenShift CLI (`oc`).
* Log in as a user with `cluster-admin` privileges.

.Procedure

. Create a namespace for the NFD Operator.

.. Create the following `Namespace` custom resource (CR) that defines the `openshift-nfd` namespace, and then save the YAML in the `nfd-namespace.yaml` file:
+
[source,yaml]
----
apiVersion: v1
kind: Namespace
metadata:
  name: openshift-nfd
----

.. Create the namespace by running the following command:
+
[source,terminal]
----
$ oc create -f nfd-namespace.yaml
----

. Install the NFD Operator in the namespace you created in the previous step by creating the following objects:

.. Create the following `OperatorGroup` CR and save the YAML in the `nfd-operatorgroup.yaml` file:
+
[source,yaml]
----
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  generateName: openshift-nfd-
  name: openshift-nfd
  namespace: openshift-nfd
spec:
  targetNamespaces:
  - openshift-nfd
----

.. Create the `OperatorGroup` CR by running the following command:
+
[source,terminal]
----
$ oc create -f nfd-operatorgroup.yaml
----

.. Run the following command to get the `channel` value required for the next step.
+
[source,terminal]
----
$ oc get packagemanifest openshift-nfd-operator -n openshift-marketplace -o jsonpath='{.status.defaultChannel}'
----
+
.Example output
[source,terminal]
----
nfd.v4.8.0
----

.. Create the following `Subscription` CR and save the YAML in the `nfd-sub.yaml` file:
+
.Example Subscription
[source,yaml]
----
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: nfd
  namespace: openshift-nfd
spec:
  channel: nfd.v4.8.0
  installPlanApproval: Automatic
  name: nfd
  source: redhat-operators
  sourceNamespace: openshift-marketplace
----

.. Create the subscription object by running the following command:
+
[source,terminal]
----
$ oc create -f nfd-sub.yaml
----

.. Change to the `openshift-nfd` project:
+
[source,terminal]
----
$ oc project openshift-nfd
----

.Verification

* To verify that the Operator deployment is successful, run:
+
[source,terminal]
----
$ oc get pods
----
+
.Example output
[source,terminal]
----
$ oc get pods
NAME                            READY   STATUS    RESTARTS   AGE
nfd-master-c92jg                1/1     Running   0          48s
nfd-master-f7gd9                1/1     Running   0          48s
nfd-master-jdg8t                1/1     Running   0          48s
nfd-operator-5b945f7ddd-kt4mm   1/1     Running   0          79s
nfd-worker-6wh9m                1/1     Running   0          47s
nfd-worker-crchk                1/1     Running   0          47s
nfd-worker-mgl7g                1/1     Running   0          47s
----
+
A successful deployment shows a `Running` status.

[id="install-operator-web-console_{context}"]
== Installing the NFD Operator using the web console

As a cluster administrator, you can install the NFD Operator using the web console.

[NOTE]
====
It is recommended to create the `Namespace` as mentioned in the previous section.
====

.Procedure

. In the {product-title} web console, click *Operators* -> *OperatorHub*.

. Choose *Node Feature Discovery* from the list of available Operators, and then click *Install*.

. On the *Install Operator* page, select *a specific namespace on the cluster*, select the namespace created in the previous section, and then click *Install*.

.Verification

To verify that the NFD Operator installed successfully:

. Navigate to the *Operators* -> *Installed Operators* page.
. Ensure that *Node Feature Discovery* is listed in the *openshift-nfd* project with a *Status* of *InstallSucceeded*.
+
[NOTE]
====
During installation an Operator might display a *Failed* status. If the installation later succeeds with an *InstallSucceeded* message, you can ignore the *Failed* message.
====

.Troubleshooting

If the Operator does not appear as installed, troubleshoot further:

. Navigate to the *Operators* -> *Installed Operators* page and inspect the *Operator Subscriptions* and *Install Plans* tabs for any failure or errors under *Status*.
. Navigate to the *Workloads* -> *Pods* page and check the logs for pods in the `openshift-nfd` project.
{'fraction_non_alphanumeric': 0.10133008427251497, 'fraction_numerical': 0.012691643821707788, 'mean_word_length': 3.2530224525043177, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5710726', 'n_tokens_mistral': 3044, 'n_tokens_neox': 2871, 'n_words': 1089}