cluster-nfd-operator

command module
v0.0.0-...-c93914d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

README

Node Feature Discovery Operator

The Node Feature Discovery operator is a tool for Openshift administrators that makes it easy to detect and understand the hardware features and configurations of a cluster's nodes. With this operator, administrators can easily gather information about their nodes that can be used for scheduling, resource management, and more by controlling the life cycle of NFD.

Upstream Project

Node Feature Discovery – a Kubernetes add-on for detecting hardware features and system configuration.

The Node Feature Discovery and Node Feature Discovery operator are Upstream projects under the kubernetes-Sigs organization

Getting started with the Node Feature Discovery Operator

Prerequisite: a running OpenShift cluster 4.6+

Get the source code

git clone https://github.com/openshift/cluster-nfd-operator

Deploy the operator

IMAGE_REGISTRY=quay.io/<your-personal-registry>
make image push deploy

Create a NodeFeatureDiscovery instance

oc apply -f config/samples/nfd.openshift.io_v1_nodefeaturediscovery.yaml

Verify

The Operator will deploy NFD based on the information on the NodeFeatureDiscovery CR instance, after a moment you should be able to see

$ oc -n openshift-nfd get ds,deploy
NAME                        DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
daemonset.apps/nfd-worker   3         3         3       3            3           <none>          5s
NAME                         READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/nfd-master   1/1     1            1           17s

Check that NFD feature labels have been created

$ oc get node -o json | jq .items[].metadata.labels
{
  "beta.kubernetes.io/arch": "amd64",
  "beta.kubernetes.io/os": "linux",
  "feature.node.kubernetes.io/cpu-cpuid.ADX": "true",
  "feature.node.kubernetes.io/cpu-cpuid.AESNI": "true",
  "feature.node.kubernetes.io/cpu-cpuid.AVX": "true",
...

Extending NFD with sidecar containers and hooks

First see upstream documentation of the hook feature and how to create a correct hook file: https://github.com/kubernetes-sigs/node-feature-discovery#local-user-specific-features.

The DaemonSet running on the workers will mount the hostPath: /etc/kubernetes/node-feature-discovery/source.d. Additional hooks can than be provided by a sidecar container that is as well running on the workers and mounting the same hostpath and writing the hook executable (shell-script, compiled code, ...) to this directory.

NFD will execute any file in this directory, if one needs any configuration for the hook, a separate configuration directory can be created under /etc/kubernetes/node-feature-discovery/source.d e.g. /etc/kubernetes/node-feature-discovery/source.d/own-hook-conf, NFD will not recurse deeper into the file hierarchy.

Building NFD operator for ARM locally

There 2 options:

  1. Using ARM server - process is the same, but you should use Dockerfile.arm instead of Dockerfile
  2. Using x86 server/laptop - process is the same but before running build command, Makefile.arm should be copied into Makefile

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1
Package v1 contains API Schema definitions for the nfd.openshift.io v1 API group +kubebuilder:object:generate=true +groupName=nfd.openshift.io
Package v1 contains API Schema definitions for the nfd.openshift.io v1 API group +kubebuilder:object:generate=true +groupName=nfd.openshift.io
v1alpha1
Package v1alpha1 is the v1alpha1 version of the nfd API.
Package v1alpha1 is the v1alpha1 version of the nfd API.
v1temp1
Package v1temp1 is the v1alpha1 version of the nfd API.
Package v1temp1 is the v1alpha1 version of the nfd API.
internal
client
Package client is a generated GoMock package.
Package client is a generated GoMock package.
configmap
Package configmap is a generated GoMock package.
Package configmap is a generated GoMock package.
controllers
Package new_controllers is a generated GoMock package.
Package new_controllers is a generated GoMock package.
daemonset
Package daemonset is a generated GoMock package.
Package daemonset is a generated GoMock package.
deployment
Package deployment is a generated GoMock package.
Package deployment is a generated GoMock package.
job
Package job is a generated GoMock package.
Package job is a generated GoMock package.
scc
Package scc is a generated GoMock package.
Package scc is a generated GoMock package.
status
Package status is a generated GoMock package.
Package status is a generated GoMock package.
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL