From f3be8ddd5b53bab5395abce3bc13973663cba557 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Wed, 24 Aug 2022 04:43:33 +0000 Subject: [PATCH] Update documentation for v0.11 Auto-generated from v0.11.1-13-g5d88692 by 'update-gh-pages.sh' --- v0.11/404.html | 2 +- v0.11/advanced/customization-guide.html | 8 ++--- v0.11/advanced/developer-guide.html | 12 +++---- v0.11/advanced/index.html | 2 +- .../master-commandline-reference.html | 4 +-- ...opology-updater-commandline-reference.html | 4 +-- .../worker-commandline-reference.html | 4 +-- .../worker-configuration-reference.html | 4 +-- v0.11/contributing/index.html | 2 +- v0.11/data.json | 2 +- v0.11/get-started/deployment-and-usage.html | 34 +++++++++---------- v0.11/get-started/examples-and-demos.html | 2 +- v0.11/get-started/features.html | 4 +-- v0.11/get-started/index.html | 4 +-- v0.11/get-started/introduction.html | 4 +-- v0.11/get-started/quick-start.html | 6 ++-- v0.11/search.html | 2 +- v0.11/sitemap.xml | 2 +- 18 files changed, 51 insertions(+), 51 deletions(-) diff --git a/v0.11/404.html b/v0.11/404.html index 9162a1e30..ab92789b5 100644 --- a/v0.11/404.html +++ b/v0.11/404.html @@ -1 +1 @@ - 404 · Node Feature Discovery

404

Not Found


Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file + 404 · Node Feature Discovery

404

Not Found


Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file diff --git a/v0.11/advanced/customization-guide.html b/v0.11/advanced/customization-guide.html index 05e9aba42..3c517efba 100644 --- a/v0.11/advanced/customization-guide.html +++ b/v0.11/advanced/customization-guide.html @@ -1,4 +1,4 @@ - Customization guide · Node Feature Discovery

Customization guide

Table of contents

  1. Overview
  2. NodeFeatureRule custom resource
    1. A NodeFeatureRule example
    2. NodeFeatureRule controller
  3. Local feature source
    1. A hook example
    2. Hooks
    3. Feature files
    4. Input format
    5. Mounts
  4. Custom feature source
    1. An example custom feature source configuration
    2. Additional configuration directory
  5. Node labels
  6. Label rule format
    1. Fields
    2. Available features
    3. Templating
    4. Backreferences
    5. Examples
  7. Legacy custom rule syntax
    1. General nomenclature and definitions
    2. Custom features format (using the nomenclature defined above)
    3. Matching process
    4. Rules
    5. Legacy custom rule example

Overview

NFD provides multiple extension points for vendor and application specific labeling:

  • NodeFeatureRule objects provide a way to deploy custom labeling rules via the Kubernetes API
  • local feature source of nfd-worker creates labels by executing hooks and reading files
  • custom feature source of nfd-worker creates labels based on user-specified rules

NodeFeatureRule custom resource

NodeFeatureRule objects provide an easy way to create vendor or application specific labels. It uses a flexible rule-based mechanism for creating labels based on node feature.

A NodeFeatureRule example

Consider the following referential example:

apiVersion: nfd.k8s-sigs.io/v1alpha1
+        Customization guide · Node Feature Discovery                      

Customization guide

Table of contents

  1. Overview
  2. NodeFeatureRule custom resource
    1. A NodeFeatureRule example
    2. NodeFeatureRule controller
  3. Local feature source
    1. A hook example
    2. Hooks
    3. Feature files
    4. Input format
    5. Mounts
  4. Custom feature source
    1. An example custom feature source configuration
    2. Additional configuration directory
  5. Node labels
  6. Label rule format
    1. Fields
    2. Available features
    3. Templating
    4. Backreferences
    5. Examples
  7. Legacy custom rule syntax
    1. General nomenclature and definitions
    2. Custom features format (using the nomenclature defined above)
    3. Matching process
    4. Rules
    5. Legacy custom rule example

Overview

NFD provides multiple extension points for vendor and application specific labeling:

  • NodeFeatureRule objects provide a way to deploy custom labeling rules via the Kubernetes API
  • local feature source of nfd-worker creates labels by executing hooks and reading files
  • custom feature source of nfd-worker creates labels based on user-specified rules

NodeFeatureRule custom resource

NodeFeatureRule objects provide an easy way to create vendor or application specific labels. It uses a flexible rule-based mechanism for creating labels based on node feature.

A NodeFeatureRule example

Consider the following referential example:

apiVersion: nfd.k8s-sigs.io/v1alpha1
 kind: NodeFeatureRule
 metadata:
   name: my-sample-rule-object
@@ -14,7 +14,7 @@
         - feature: kernel.config
           matchExpressions:
             X86: {op: In, value: ["y"]}
-

It specifies one rule which creates node label feature.node.kubenernetes.io/my-sample-feature=true if both of the following conditions are true (matchFeatures implements a logical AND over the matchers):

  • The dummy network driver module has been loaded
  • X86 option in kernel config is set to =y

Create a NodeFeatureRule with a yaml file:

kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/node-feature-discovery/v0.11.1/examples/nodefeaturerule.yaml
+

It specifies one rule which creates node label feature.node.kubenernetes.io/my-sample-feature=true if both of the following conditions are true (matchFeatures implements a logical AND over the matchers):

  • The dummy network driver module has been loaded
  • X86 option in kernel config is set to =y

Create a NodeFeatureRule with a yaml file:

kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/node-feature-discovery/v0.11.2/examples/nodefeaturerule.yaml
 

Now, on X86 platforms the feature label appears after doing modprobe dummy on a system and correspondingly the label is removed after rmmod dummy. Note a re-labeling delay up to the sleep-interval of nfd-worker (1 minute by default).

NodeFeatureRule controller

NFD-Master acts as the controller for NodeFeatureRule objects. It applies these rules on raw feature data received from nfd-worker instances and creates node labels, accordingly.

NOTE nfd-master is stateless and (re-)labelling only happens when a request is received from nfd-worker. That is, in practice rules are evaluated and labels for each node are created on intervals specified by the core.sleepInterval configuration option (or -sleep-interval command line flag) of nfd-worker instances. This means that modification or creation of NodeFeatureRule objects does not instantly cause the node labels to be updated. Instead, the changes only come visible in node labels as nfd-worker instances send their labelling requests.

Local feature source

NFD-Worker has a special feature source named local which is an integration point for external feature detectors. It provides a mechanism for pluggable extensions, allowing the creation of new user-specific features and even overriding built-in labels.

The local feature source has two methods for detecting features, hooks and feature files. The features discovered by the local source can further be used in label rules specified in NodeFeatureRule objects and the custom feature source.

NOTE: Be careful when creating and/or updating hook or feature files while NFD is running. In order to avoid race conditions you should write into a temporary file (outside the source.d and features.d directories), and, atomically create/update the original file by doing a filesystem move operation.

A hook example

Consider a shell script /etc/kubernetes/node-feature-discovery/source.d/my-hook.sh having the following stdout output, or alternatively, a plaintext file /etc/kubernetes/node-feature-discovery/features.d/my-features having the following contents:

my-feature.1
 my-feature.2=myvalue
 my.namespace/my-feature.3=456
@@ -43,7 +43,7 @@ my.namespace/my-feature.3=456
     - feature: kernel.loadedmodule
       matchExpressions:
         e1000: {op: Exists}
-

This simple rule will create feature.node.kubenernetes.io/e1000.present=true label if the e1000 kernel module has been loaded.

The samples/custom-rules kustomize overlay sample contains an example for deploying a custom rule from a ConfigMap.

Node labels

Feature labels have the following format:

<namespace>/<name> = <value>
+

This simple rule will create feature.node.kubenernetes.io/e1000.present=true label if the e1000 kernel module has been loaded.

The samples/custom-rules kustomize overlay sample contains an example for deploying a custom rule from a ConfigMap.

Node labels

Feature labels have the following format:

<namespace>/<name> = <value>
 

The namespace part (i.e. prefix) of the labels is controlled by nfd:

  • All built-in labels use feature.node.kubernetes.io. This is also the default for user defined features that don't specify any namespace.
  • User-defined labels are allowed to use:
    • feature.node.kubernetes.io and profile.node.kubernetes.io plus their sub-namespaces (e.g. vendor.profile.node.kubernetes.io and sub.ns.profile.node.kubernetes.io) by default
    • Additional namespaces may be enabled with the -extra-label-ns command line flag of nfd-master

Label rule format

This section describes the rule format used in NodeFeatureRule objects and in the configuration of the custom feature source.

It is based on a generic feature matcher that covers all features discovered by nfd-worker. The rules rely on a unified data model of the available features and a generic expression-based format. Features that can be used in the rules are described in detail in available features below.

Take this rule as a referential example:

    - name: "my feature rule"
       labels:
         "my-special-feature": "my-value"
@@ -268,4 +268,4 @@ Element     :An identifier of the USB attribute.
     value: "datacenter-1"
     matchOn:
       - nodename: [ "node-datacenter1-rack.*-server.*" ]
-

In the example above:

  • A node would contain the label: feature.node.kubernetes.io/custom-my.kernel.feature=true if the node has kmod1 AND kmod2 kernel modules loaded.
  • A node would contain the label: feature.node.kubernetes.io/custom-my.pci.feature=true if the node contains a PCI device with a PCI vendor ID of 15b3 AND PCI device ID of 1014 OR 1017.
  • A node would contain the label: feature.node.kubernetes.io/custom-my.usb.feature=true if the node contains a USB device with a USB vendor ID of 1d6b AND USB device ID of 0003.
  • A node would contain the label: feature.node.kubernetes.io/custom-my.combined.feature=true if vendor_kmod1 AND vendor_kmod2 kernel modules are loaded AND the node contains a PCI device with a PCI vendor ID of 15b3 AND PCI device ID of 1014 or 1017.
  • A node would contain the label: vendor.feature.node.kubernetes.io/accumulated.feature=true if some_kmod1 AND some_kmod2 kernel modules are loaded OR the node contains a PCI device with a PCI vendor ID of 15b3 AND PCI device ID of 1014 OR 1017.
  • A node would contain the label: feature.node.kubernetes.io/custom-my.kernel.featureneedscpu=true if KVM_INTEL kernel config is enabled AND the node CPU supports VMX virtual machine extensions
  • A node would contain the label: feature.node.kubernetes.io/custom-my.kernel.modulecompiler=true if the in-tree kmod1 kernel module is loaded AND it's built with GCC_VERSION=100101.
  • A node would contain the label: profile.node.kubernetes.io/my-datacenter=datacenter-1 if the node's name matches the node-datacenter1-rack.*-server.* pattern, e.g. node-datacenter1-rack2-server42

Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file +

In the example above:

  • A node would contain the label: feature.node.kubernetes.io/custom-my.kernel.feature=true if the node has kmod1 AND kmod2 kernel modules loaded.
  • A node would contain the label: feature.node.kubernetes.io/custom-my.pci.feature=true if the node contains a PCI device with a PCI vendor ID of 15b3 AND PCI device ID of 1014 OR 1017.
  • A node would contain the label: feature.node.kubernetes.io/custom-my.usb.feature=true if the node contains a USB device with a USB vendor ID of 1d6b AND USB device ID of 0003.
  • A node would contain the label: feature.node.kubernetes.io/custom-my.combined.feature=true if vendor_kmod1 AND vendor_kmod2 kernel modules are loaded AND the node contains a PCI device with a PCI vendor ID of 15b3 AND PCI device ID of 1014 or 1017.
  • A node would contain the label: vendor.feature.node.kubernetes.io/accumulated.feature=true if some_kmod1 AND some_kmod2 kernel modules are loaded OR the node contains a PCI device with a PCI vendor ID of 15b3 AND PCI device ID of 1014 OR 1017.
  • A node would contain the label: feature.node.kubernetes.io/custom-my.kernel.featureneedscpu=true if KVM_INTEL kernel config is enabled AND the node CPU supports VMX virtual machine extensions
  • A node would contain the label: feature.node.kubernetes.io/custom-my.kernel.modulecompiler=true if the in-tree kmod1 kernel module is loaded AND it's built with GCC_VERSION=100101.
  • A node would contain the label: profile.node.kubernetes.io/my-datacenter=datacenter-1 if the node's name matches the node-datacenter1-rack.*-server.* pattern, e.g. node-datacenter1-rack2-server42

Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file diff --git a/v0.11/advanced/developer-guide.html b/v0.11/advanced/developer-guide.html index d4898525e..ba06d645c 100644 --- a/v0.11/advanced/developer-guide.html +++ b/v0.11/advanced/developer-guide.html @@ -1,4 +1,4 @@ - Developer guide · Node Feature Discovery

Developer guide

Table of contents

  1. Building from source
    1. Download the source code
    2. Docker build
    3. Docker multi-arch builds with buildx
    4. Deployment
    5. Building locally
    6. Customizing the build
    7. Testing
  2. Running locally
    1. NFD-Master
    2. NFD-Worker
    3. NFD-Topology-Updater
  3. Documentation

Building from source

Download the source code

git clone https://github.com/kubernetes-sigs/node-feature-discovery
+        Developer guide · Node Feature Discovery                      

Developer guide

Table of contents

  1. Building from source
    1. Download the source code
    2. Docker build
    3. Docker multi-arch builds with buildx
    4. Deployment
    5. Building locally
    6. Customizing the build
    7. Testing
  2. Running locally
    1. NFD-Master
    2. NFD-Worker
    3. NFD-Topology-Updater
  3. Documentation

Building from source

Download the source code

git clone https://github.com/kubernetes-sigs/node-feature-discovery
 cd node-feature-discovery
 

Docker build

Build the container image

See customizing the build below for altering the container image registry, for example.

make
 

Push the container image

Optional, this example with Docker.

docker push <IMAGE_TAG>
@@ -7,21 +7,21 @@
 

The resulting container image can be used in the same way on each arch by pulling e.g. node-feature-discovery:v0.11.0 without specifying the architecture. The manifest-list will take care of providing the right architecture image.

Change the job spec to use your custom image (optional)

To use your published image from the step above instead of the k8s.gcr.io/nfd/node-feature-discovery image, edit image attribute in the spec template(s) to the new location (<registry-name>/<image-name>[:<version>]).

Deployment

The yamls makefile generates a kustomization.yaml matching your locally built image and using the deploy/overlays/default deployment. See build customization below for configurability, e.g. changing the deployment namespace.

K8S_NAMESPACE=my-ns make yamls
 kubectl apply -k .
 

You can use alternative deployment methods by modifying the auto-generated kustomization file. For example, deploying worker and master in the same pod by pointing to deployment/overlays/default-combined.

Building locally

You can also build the binaries locally

make build
-

This will compile binaries under bin/

Customizing the build

There are several Makefile variables that control the build process and the name of the resulting container image. The following are targeted targeted for build customization and they can be specified via environment variables or makefile overrides.

Variable Description Default value
HOSTMOUNT_PREFIX Prefix of system directories for feature discovery (local builds) / (local builds) /host- (container builds)
IMAGE_BUILD_CMD Command to build the image docker build
IMAGE_BUILD_EXTRA_OPTS Extra options to pass to build command empty
IMAGE_BUILDX_CMD Command to build and push multi-arch images with buildx DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build –platform=${IMAGE_ALL_PLATFORMS} –progress=auto –pull
IMAGE_ALL_PLATFORMS Comma seperated list of OS/ARCH tuples for mulit-arch builds linux/amd64,linux/arm64
IMAGE_PUSH_CMD Command to push the image to remote registry docker push
IMAGE_REGISTRY Container image registry to use k8s.gcr.io/nfd
IMAGE_TAG_NAME Container image tag name <nfd version>
IMAGE_EXTRA_TAG_NAMES Additional container image tag(s) to create when building image empty
K8S_NAMESPACE nfd-master and nfd-worker namespace node-feature-discovery
KUBECONFIG Kubeconfig for running e2e-tests empty
E2E_TEST_CONFIG Parameterization file of e2e-tests (see example) empty
OPENSHIFT Non-empty value enables OpenShift specific support (currently only effective in e2e tests) empty
BASE_IMAGE_FULL Container base image for target image full (–target full) debian:buster-slim
BASE_IMAGE_MINIMAL Container base image for target image minimal (–target minimal) gcr.io/distroless/base

For example, to use a custom registry:

make IMAGE_REGISTRY=<my custom registry uri>
+

This will compile binaries under bin/

Customizing the build

There are several Makefile variables that control the build process and the name of the resulting container image. The following are targeted targeted for build customization and they can be specified via environment variables or makefile overrides.

Variable Description Default value
HOSTMOUNT_PREFIX Prefix of system directories for feature discovery (local builds) / (local builds) /host- (container builds)
IMAGE_BUILD_CMD Command to build the image docker build
IMAGE_BUILD_EXTRA_OPTS Extra options to pass to build command empty
IMAGE_BUILDX_CMD Command to build and push multi-arch images with buildx DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build –platform=${IMAGE_ALL_PLATFORMS} –progress=auto –pull
IMAGE_ALL_PLATFORMS Comma seperated list of OS/ARCH tuples for mulit-arch builds linux/amd64,linux/arm64
IMAGE_PUSH_CMD Command to push the image to remote registry docker push
IMAGE_REGISTRY Container image registry to use k8s.gcr.io/nfd
IMAGE_TAG_NAME Container image tag name <nfd version>
IMAGE_EXTRA_TAG_NAMES Additional container image tag(s) to create when building image empty
K8S_NAMESPACE nfd-master and nfd-worker namespace node-feature-discovery
KUBECONFIG Kubeconfig for running e2e-tests empty
E2E_TEST_CONFIG Parameterization file of e2e-tests (see example) empty
OPENSHIFT Non-empty value enables OpenShift specific support (currently only effective in e2e tests) empty
BASE_IMAGE_FULL Container base image for target image full (–target full) debian:buster-slim
BASE_IMAGE_MINIMAL Container base image for target image minimal (–target minimal) gcr.io/distroless/base

For example, to use a custom registry:

make IMAGE_REGISTRY=<my custom registry uri>
 

Or to specify a build tool different from Docker, It can be done in 2 ways:

  1. via environment

     IMAGE_BUILD_CMD="buildah bud" make
     
  2. by overriding the variable value

     make  IMAGE_BUILD_CMD="buildah bud"
     

Testing

Unit tests are automatically run as part of the container image build. You can also run them manually in the source code tree by simply running:

make test
 

End-to-end tests are built on top of the e2e test framework of Kubernetes, and, they required a cluster to run them on. For running the tests on your test cluster you need to specify the kubeconfig to be used:

make e2e-test KUBECONFIG=$HOME/.kube/config
-

Running locally

You can run NFD locally, either directly on your host OS or in containers for testing and development purposes. This may be useful e.g. for checking features-detection.

NFD-Master

When running as a standalone container labeling is expected to fail because Kubernetes API is not available. Thus, it is recommended to use -no-publish command line flag. E.g.

$ export NFD_CONTAINER_IMAGE=k8s.gcr.io/nfd/node-feature-discovery:v0.11.1
+

Running locally

You can run NFD locally, either directly on your host OS or in containers for testing and development purposes. This may be useful e.g. for checking features-detection.

NFD-Master

When running as a standalone container labeling is expected to fail because Kubernetes API is not available. Thus, it is recommended to use -no-publish command line flag. E.g.

$ export NFD_CONTAINER_IMAGE=k8s.gcr.io/nfd/node-feature-discovery:v0.11.2
 $ docker run --rm --name=nfd-test ${NFD_CONTAINER_IMAGE} nfd-master -no-publish
 2019/02/01 14:48:21 Node Feature Discovery Master <NFD_VERSION>
 2019/02/01 14:48:21 gRPC server serving on port: 8080
 

NFD-Worker

In order to run nfd-worker as a "stand-alone" container against your standalone nfd-master you need to run them in the same network namespace:

$ docker run --rm --network=container:nfd-test ${NFD_CONTAINER_IMAGE} nfd-worker
 2019/02/01 14:48:56 Node Feature Discovery Worker <NFD_VERSION>
 ...
-

If you just want to try out feature discovery without connecting to nfd-master, pass the -no-publish flag to nfd-worker.

NOTE Some feature sources need certain directories and/or files from the host mounted inside the NFD container. Thus, you need to provide Docker with the correct --volume options in order for them to work correctly when run stand-alone directly with docker run. See the default deployment for up-to-date information about the required volume mounts.

NFD-Topology-Updater

In order to run nfd-topology-updater as a "stand-alone" container against your standalone nfd-master you need to run them in the same network namespace:

$ docker run --rm --network=container:nfd-test ${NFD_CONTAINER_IMAGE} nfd-topology-updater
+

If you just want to try out feature discovery without connecting to nfd-master, pass the -no-publish flag to nfd-worker.

NOTE Some feature sources need certain directories and/or files from the host mounted inside the NFD container. Thus, you need to provide Docker with the correct --volume options in order for them to work correctly when run stand-alone directly with docker run. See the default deployment for up-to-date information about the required volume mounts.

NFD-Topology-Updater

In order to run nfd-topology-updater as a "stand-alone" container against your standalone nfd-master you need to run them in the same network namespace:

$ docker run --rm --network=container:nfd-test ${NFD_CONTAINER_IMAGE} nfd-topology-updater
 2019/02/01 14:48:56 Node Feature Discovery Topology Updater <NFD_VERSION>
 ...
-

If you just want to try out feature discovery without connecting to nfd-master, pass the -no-publish flag to nfd-topology-updater.

NOTE:

NFD topology updater needs certain directories and/or files from the host mounted inside the NFD container. Thus, you need to provide Docker with the correct --volume options in order for them to work correctly when run stand-alone directly with docker run. See the template spec for up-to-date information about the required volume mounts.

PodResource API is a prerequisite for nfd-topology-updater. Preceding Kubernetes v1.23, the kubelet must be started with the following flag: --feature-gates=KubeletPodResourcesGetAllocatable=true. Starting Kubernetes v1.23, the GetAllocatableResources is enabled by default through KubeletPodResourcesGetAllocatable feature gate.

Documentation

All documentation resides under the docs directory in the source tree. It is designed to be served as a html site by GitHub Pages.

Building the documentation is containerized in order to fix the build environment. The recommended way for developing documentation is to run:

make site-serve
+

If you just want to try out feature discovery without connecting to nfd-master, pass the -no-publish flag to nfd-topology-updater.

NOTE:

NFD topology updater needs certain directories and/or files from the host mounted inside the NFD container. Thus, you need to provide Docker with the correct --volume options in order for them to work correctly when run stand-alone directly with docker run. See the template spec for up-to-date information about the required volume mounts.

PodResource API is a prerequisite for nfd-topology-updater. Preceding Kubernetes v1.23, the kubelet must be started with the following flag: --feature-gates=KubeletPodResourcesGetAllocatable=true. Starting Kubernetes v1.23, the GetAllocatableResources is enabled by default through KubeletPodResourcesGetAllocatable feature gate.

Documentation

All documentation resides under the docs directory in the source tree. It is designed to be served as a html site by GitHub Pages.

Building the documentation is containerized in order to fix the build environment. The recommended way for developing documentation is to run:

make site-serve
 

This will build the documentation in a container and serve it under localhost:4000/ making it easy to verify the results. Any changes made to the docs/ will automatically re-trigger a rebuild and are reflected in the served content and can be inspected with a simple browser refresh.

In order to just build the html documentation run:

make site-build
-

This will generate html documentation under docs/_site/.


Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file +

This will generate html documentation under docs/_site/.


Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file diff --git a/v0.11/advanced/index.html b/v0.11/advanced/index.html index dae9f0e1e..99693a6af 100644 --- a/v0.11/advanced/index.html +++ b/v0.11/advanced/index.html @@ -1 +1 @@ - Advanced · Node Feature Discovery

Advanced

Advanced topics and reference.


Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file + Advanced · Node Feature Discovery

Advanced

Advanced topics and reference.


Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file diff --git a/v0.11/advanced/master-commandline-reference.html b/v0.11/advanced/master-commandline-reference.html index 58fe82293..9d4d7eb77 100644 --- a/v0.11/advanced/master-commandline-reference.html +++ b/v0.11/advanced/master-commandline-reference.html @@ -1,4 +1,4 @@ - Master cmdline reference · Node Feature Discovery

Commandline flags of nfd-master

Table of contents

  1. -h, -help
  2. -version
  3. -prune
  4. -port
  5. -instance
  6. -ca-file
  7. -cert-file
  8. -key-file
  9. -verify-node-name
  10. -no-publish
  11. -featurerules-controller
  12. -label-whitelist
  13. -extra-label-ns
  14. -resource-labels
  15. Logging

To quickly view available command line flags execute nfd-master -help. In a docker container:

docker run k8s.gcr.io/nfd/node-feature-discovery:v0.11.1 nfd-master -help
+        Master cmdline reference · Node Feature Discovery                      

Commandline flags of nfd-master

Table of contents

  1. -h, -help
  2. -version
  3. -prune
  4. -port
  5. -instance
  6. -ca-file
  7. -cert-file
  8. -key-file
  9. -verify-node-name
  10. -no-publish
  11. -featurerules-controller
  12. -label-whitelist
  13. -extra-label-ns
  14. -resource-labels
  15. Logging

To quickly view available command line flags execute nfd-master -help. In a docker container:

docker run k8s.gcr.io/nfd/node-feature-discovery:v0.11.2 nfd-master -help
 

-h, -help

Print usage and exit.

-version

Print version and exit.

-prune

The -prune flag is a sub-command like option for cleaning up the cluster. It causes nfd-master to remove all NFD related labels, annotations and extended resources from all Node objects of the cluster and exit.

-port

The -port flag specifies the TCP port that nfd-master listens for incoming requests.

Default: 8080

Example:

nfd-master -port=443
 

-instance

The -instance flag makes it possible to run multiple NFD deployments in parallel. In practice, it separates the node annotations between deployments so that each of them can store metadata independently. The instance name must start and end with an alphanumeric character and may only contain alphanumeric characters, -, _ or ..

Default: empty

Example:

nfd-master -instance=network
 

-ca-file

The -ca-file is one of the three flags (together with -cert-file and -key-file) controlling master-worker mutual TLS authentication on the nfd-master side. This flag specifies the TLS root certificate that is used for authenticating incoming connections. NFD-Worker side needs to have matching key and cert files configured in order for the incoming requests to be accepted.

Default: empty

Note: Must be specified together with -cert-file and -key-file

Example:

nfd-master -ca-file=/opt/nfd/ca.crt -cert-file=/opt/nfd/master.crt -key-file=/opt/nfd/master.key
@@ -11,4 +11,4 @@
 

-label-whitelist

The -label-whitelist specifies a regular expression for filtering feature labels based on their name. Each label must match against the given reqular expression in order to be published.

Note: The regular expression is only matches against the "basename" part of the label, i.e. to the part of the name after ‘/'. The label namespace is omitted.

Default: empty

Example:

nfd-master -label-whitelist='.*cpuid\.'
 

-extra-label-ns

The -extra-label-ns flag specifies a comma-separated list of allowed feature label namespaces. By default, nfd-master only allows creating labels in the default feature.node.kubernetes.io and profile.node.kubernetes.io label namespaces and their sub-namespaces (e.g. vendor.feature.node.kubernetes.io and sub.ns.profile.node.kubernetes.io). This option can be used to allow other vendor or application specific namespaces for custom labels from the local and custom feature sources.

The same namespace control and this flag applies Extended Resources (created with -resource-labels), too.

Default: empty

Example:

nfd-master -extra-label-ns=vendor-1.com,vendor-2.io
 

-resource-labels

The -resource-labels flag specifies a comma-separated list of features to be advertised as extended resources instead of labels. Features that have integer values can be published as Extended Resources by listing them in this flag.

Default: empty

Example:

nfd-master -resource-labels=vendor-1.com/feature-1,vendor-2.io/feature-2
-

Logging

The following logging-related flags are inherited from the klog package.

-add_dir_header

If true, adds the file directory to the header of the log messages.

Default: false

-alsologtostderr

Log to standard error as well as files.

Default: false

-log_backtrace_at

When logging hits line file:N, emit a stack trace.

Default: empty

-log_dir

If non-empty, write log files in this directory.

Default: empty

-log_file

If non-empty, use this log file.

Default: empty

-log_file_max_size

Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited.

Default: 1800

-logtostderr

Log to standard error instead of files

Default: true

-skip_headers

If true, avoid header prefixes in the log messages.

Default: false

-skip_log_headers

If true, avoid headers when opening log files.

Default: false

-stderrthreshold

Logs at or above this threshold go to stderr.

Default: 2

-v

Number for the log level verbosity.

Default: 0

-vmodule

Comma-separated list of pattern=N settings for file-filtered logging.

Default: empty


Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file +

Logging

The following logging-related flags are inherited from the klog package.

-add_dir_header

If true, adds the file directory to the header of the log messages.

Default: false

-alsologtostderr

Log to standard error as well as files.

Default: false

-log_backtrace_at

When logging hits line file:N, emit a stack trace.

Default: empty

-log_dir

If non-empty, write log files in this directory.

Default: empty

-log_file

If non-empty, use this log file.

Default: empty

-log_file_max_size

Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited.

Default: 1800

-logtostderr

Log to standard error instead of files

Default: true

-skip_headers

If true, avoid header prefixes in the log messages.

Default: false

-skip_log_headers

If true, avoid headers when opening log files.

Default: false

-stderrthreshold

Logs at or above this threshold go to stderr.

Default: 2

-v

Number for the log level verbosity.

Default: 0

-vmodule

Comma-separated list of pattern=N settings for file-filtered logging.

Default: empty


Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file diff --git a/v0.11/advanced/topology-updater-commandline-reference.html b/v0.11/advanced/topology-updater-commandline-reference.html index 0c26ab843..6afbd5268 100644 --- a/v0.11/advanced/topology-updater-commandline-reference.html +++ b/v0.11/advanced/topology-updater-commandline-reference.html @@ -1,4 +1,4 @@ - Topology Updater Cmdline Reference · Node Feature Discovery

NFD-Topology-Updater Commandline Flags

Table of Contents

  1. NFD-Topology-Updater Commandline Flags
    1. -h, -help
    2. -version
    3. -server
    4. -ca-file
    5. -cert-file
    6. -key-file
    7. -server-name-override
    8. -no-publish
    9. -oneshot
    10. -sleep-interval
    11. -watch-namespace
    12. -kubelet-config-file
    13. -podresources-socket

To quickly view available command line flags execute nfd-topology-updater -help. In a docker container:

docker run gcr.io/k8s-staging-nfd/node-feature-discovery:master nfd-topology-updater -help
+        Topology Updater Cmdline Reference · Node Feature Discovery                      

NFD-Topology-Updater Commandline Flags

Table of Contents

  1. NFD-Topology-Updater Commandline Flags
    1. -h, -help
    2. -version
    3. -server
    4. -ca-file
    5. -cert-file
    6. -key-file
    7. -server-name-override
    8. -no-publish
    9. -oneshot
    10. -sleep-interval
    11. -watch-namespace
    12. -kubelet-config-file
    13. -podresources-socket

To quickly view available command line flags execute nfd-topology-updater -help. In a docker container:

docker run gcr.io/k8s-staging-nfd/node-feature-discovery:master nfd-topology-updater -help
 

-h, -help

Print usage and exit.

-version

Print version and exit.

-server

The -server flag specifies the address of the nfd-master endpoint where to connect to.

Default: localhost:8080

Example:

nfd-topology-updater -server=nfd-master.nfd.svc.cluster.local:443
 

-ca-file

The -ca-file is one of the three flags (together with -cert-file and -key-file) controlling the mutual TLS authentication on the topology-updater side. This flag specifies the TLS root certificate that is used for verifying the authenticity of nfd-master.

Default: empty

Note: Must be specified together with -cert-file and -key-file

Example:

nfd-topology-updater -ca-file=/opt/nfd/ca.crt -cert-file=/opt/nfd/updater.crt -key-file=/opt/nfd/updater.key
 

-cert-file

The -cert-file is one of the three flags (together with -ca-file and -key-file) controlling mutual TLS authentication on the topology-updater side. This flag specifies the TLS certificate presented for authenticating outgoing requests.

Default: empty

Note: Must be specified together with -ca-file and -key-file

Example:

nfd-topology-updater -cert-file=/opt/nfd/updater.crt -key-file=/opt/nfd/updater.key -ca-file=/opt/nfd/ca.crt
@@ -10,4 +10,4 @@
 

-watch-namespace

The -watch-namespace specifies the namespace to ensure that resource hardware topology examination only happens for the pods running in the specified namespace. Pods that are not running in the specified namespace are not considered during resource accounting. This is particularly useful for testing/debugging purpose. A "*" value would mean that all the pods would be considered during the accounting process.

Default: "*"

Example:

nfd-topology-updater -watch-namespace=rte
 

-kubelet-config-file

The -kubelet-config-file specifies the path to the Kubelet's configuration file.

Default: /host-var/lib/kubelet/config.yaml

Example:

nfd-topology-updater -kubelet-config-file=/var/lib/kubelet/config.yaml
 

-podresources-socket

The -podresources-socket specifies the path to the Unix socket where kubelet exports a gRPC service to enable discovery of in-use CPUs and devices, and to provide metadata for them.

Default: /host-var/lib/kubelet/pod-resources/kubelet.sock

Example:

nfd-topology-updater -podresources-socket=/var/lib/kubelet/pod-resources/kubelet.sock
-

Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file +

Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file diff --git a/v0.11/advanced/worker-commandline-reference.html b/v0.11/advanced/worker-commandline-reference.html index 9acbe5323..27003b123 100644 --- a/v0.11/advanced/worker-commandline-reference.html +++ b/v0.11/advanced/worker-commandline-reference.html @@ -1,4 +1,4 @@ - Worker cmdline reference · Node Feature Discovery

Commandline flags of nfd-worker

Table of contents

  1. -h, -help
  2. -version
  3. -config
  4. -options
  5. -server
  6. -ca-file
  7. -cert-file
  8. -key-file
  9. -server-name-override
  10. -feature-sources
  11. -label-sources
  12. -sources
  13. -no-publish
  14. -label-whitelist
  15. -oneshot
  16. -sleep-interval
  17. Logging

To quickly view available command line flags execute nfd-worker -help. In a docker container:

docker run k8s.gcr.io/nfd/node-feature-discovery:v0.11.1 nfd-worker -help
+        Worker cmdline reference · Node Feature Discovery                      

Commandline flags of nfd-worker

Table of contents

  1. -h, -help
  2. -version
  3. -config
  4. -options
  5. -server
  6. -ca-file
  7. -cert-file
  8. -key-file
  9. -server-name-override
  10. -feature-sources
  11. -label-sources
  12. -sources
  13. -no-publish
  14. -label-whitelist
  15. -oneshot
  16. -sleep-interval
  17. Logging

To quickly view available command line flags execute nfd-worker -help. In a docker container:

docker run k8s.gcr.io/nfd/node-feature-discovery:v0.11.2 nfd-worker -help
 

-h, -help

Print usage and exit.

-version

Print version and exit.

-config

The -config flag specifies the path of the nfd-worker configuration file to use.

Default: /etc/kubernetes/node-feature-discovery/nfd-worker.conf

Example:

nfd-worker -config=/opt/nfd/worker.conf
 

-options

The -options flag may be used to specify and override configuration file options directly from the command line. The required format is the same as in the config file i.e. JSON or YAML. Configuration options specified via this flag will override those from the configuration file:

Default: empty

Example:

nfd-worker -options='{"sources":{"cpu":{"cpuid":{"attributeWhitelist":["AVX","AVX2"]}}}}'
 

-server

The -server flag specifies the address of the nfd-master endpoint where to connect to.

Default: localhost:8080

Example:

nfd-worker -server=nfd-master.nfd.svc.cluster.local:443
@@ -12,4 +12,4 @@
 

-label-whitelist

The -label-whitelist specifies a regular expression for filtering feature labels based on their name. Each label must match against the given reqular expression in order to be published.

Note: The regular expression is only matches against the "basename" part of the label, i.e. to the part of the name after ‘/'. The label namespace is omitted.

Note: This flag takes precedence over the core.labelWhiteList configuration file option.

Default: empty

Example:

nfd-worker -label-whitelist='.*cpuid\.'
 

DEPRECATED: you should use the core.labelWhiteList option in the configuration file, instead.

-oneshot

The -oneshot flag causes nfd-worker to exit after one pass of feature detection.

Default: false

Example:

nfd-worker -oneshot -no-publish
 

-sleep-interval

The -sleep-interval specifies the interval between feature re-detection (and node re-labeling). A non-positive value implies infinite sleep interval, i.e. no re-detection or re-labeling is done.

Note: This flag takes precedence over the core.sleepInterval configuration file option.

Default: 60s

Example:

nfd-worker -sleep-interval=1h
-

DEPRECATED: you should use the core.sleepInterval option in the configuration file, instead.

Logging

The following logging-related flags are inherited from the klog package.

Note: The logger setup can also be specified via the core.klog configuration file options. However, the command line flags take precedence over any corresponding config file options specified.

-add_dir_header

If true, adds the file directory to the header of the log messages.

Default: false

-alsologtostderr

Log to standard error as well as files.

Default: false

-log_backtrace_at

When logging hits line file:N, emit a stack trace.

Default: empty

-log_dir

If non-empty, write log files in this directory.

Default: empty

-log_file

If non-empty, use this log file.

Default: empty

-log_file_max_size

Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited.

Default: 1800

-logtostderr

Log to standard error instead of files

Default: true

-skip_headers

If true, avoid header prefixes in the log messages.

Default: false

-skip_log_headers

If true, avoid headers when opening log files.

Default: false

-stderrthreshold

Logs at or above this threshold go to stderr.

Default: 2

-v

Number for the log level verbosity.

Default: 0

-vmodule

Comma-separated list of pattern=N settings for file-filtered logging.

Default: empty


Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file +

DEPRECATED: you should use the core.sleepInterval option in the configuration file, instead.

Logging

The following logging-related flags are inherited from the klog package.

Note: The logger setup can also be specified via the core.klog configuration file options. However, the command line flags take precedence over any corresponding config file options specified.

-add_dir_header

If true, adds the file directory to the header of the log messages.

Default: false

-alsologtostderr

Log to standard error as well as files.

Default: false

-log_backtrace_at

When logging hits line file:N, emit a stack trace.

Default: empty

-log_dir

If non-empty, write log files in this directory.

Default: empty

-log_file

If non-empty, use this log file.

Default: empty

-log_file_max_size

Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited.

Default: 1800

-logtostderr

Log to standard error instead of files

Default: true

-skip_headers

If true, avoid header prefixes in the log messages.

Default: false

-skip_log_headers

If true, avoid headers when opening log files.

Default: false

-stderrthreshold

Logs at or above this threshold go to stderr.

Default: 2

-v

Number for the log level verbosity.

Default: 0

-vmodule

Comma-separated list of pattern=N settings for file-filtered logging.

Default: empty


Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file diff --git a/v0.11/advanced/worker-configuration-reference.html b/v0.11/advanced/worker-configuration-reference.html index 38253957a..a581fe5af 100644 --- a/v0.11/advanced/worker-configuration-reference.html +++ b/v0.11/advanced/worker-configuration-reference.html @@ -1,4 +1,4 @@ - Worker config reference · Node Feature Discovery

Configuration file reference of nfd-worker

Table of contents

  1. core
    1. core.sleepInterval
    2. core.featureSources
    3. core.labelSources
    4. core.sources
    5. core.labelWhiteList
    6. core.noPublish
    7. core.klog
  2. sources
    1. sources.cpu
    2. sources.kernel
    3. soures.pci
    4. sources.usb
    5. sources.custom

See the sample configuration file for a full example configuration.

core

The core section contains common configuration settings that are not specific to any particular feature source.

core.sleepInterval

core.sleepInterval specifies the interval between consecutive passes of feature (re-)detection, and thus also the interval between node re-labeling. A non-positive value implies infinite sleep interval, i.e. no re-detection or re-labeling is done.

Note: Overridden by the deprecated -sleep-interval command line flag (if specified).

Default: 60s

Example:

core:
+        Worker config reference · Node Feature Discovery                      

Configuration file reference of nfd-worker

Table of contents

  1. core
    1. core.sleepInterval
    2. core.featureSources
    3. core.labelSources
    4. core.sources
    5. core.labelWhiteList
    6. core.noPublish
    7. core.klog
  2. sources
    1. sources.cpu
    2. sources.kernel
    3. soures.pci
    4. sources.usb
    5. sources.custom

See the sample configuration file for a full example configuration.

core

The core section contains common configuration settings that are not specific to any particular feature source.

core.sleepInterval

core.sleepInterval specifies the interval between consecutive passes of feature (re-)detection, and thus also the interval between node re-labeling. A non-positive value implies infinite sleep interval, i.e. no re-detection or re-labeling is done.

Note: Overridden by the deprecated -sleep-interval command line flag (if specified).

Default: 60s

Example:

core:
   sleepInterval: 60s
 

core.featureSources

core.featureSources specifies the list of enabled feature sources. A special value all enables all sources. Prefixing a source name with - indicates that the source will be disabled instead - this is only meaningful when used in conjunction with all. This option allows completely disabling the feature detection so that neither standard feature labels are generated nor the raw feature data is available for custom rule processing.

Default: [all]

Example:

core:
   # Enable all but cpu and local sources
@@ -65,4 +65,4 @@
           matchExpressions:
             class: {op: In, value: ["0200"]}
             vendor: {op: In, value: ["8086"]}
-

Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file +

Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file diff --git a/v0.11/contributing/index.html b/v0.11/contributing/index.html index 612f90ba1..8d83b70c0 100644 --- a/v0.11/contributing/index.html +++ b/v0.11/contributing/index.html @@ -1 +1 @@ - Contributing · Node Feature Discovery

Contributing


Community

You can reach us via the following channels:

Governance

This is a SIG-node subproject, hosted under the Kubernetes SIGs organization in Github. The project was established in 2016 and was migrated to Kubernetes SIGs in 2018.

License

This is open source software released under the Apache 2.0 License.


Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file + Contributing · Node Feature Discovery

Contributing


Community

You can reach us via the following channels:

Governance

This is a SIG-node subproject, hosted under the Kubernetes SIGs organization in Github. The project was established in 2016 and was migrated to Kubernetes SIGs in 2018.

License

This is open source software released under the Apache 2.0 License.


Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file diff --git a/v0.11/data.json b/v0.11/data.json index 6fd69641b..9d68f5b50 100644 --- a/v0.11/data.json +++ b/v0.11/data.json @@ -1 +1 @@ -[{"title":"Developer guide","layout":"default","sort":1,"content":"

Developer guide

\n\n

Table of contents

\n\n
    \n
  1. Building from source
      \n
    1. Download the source code
    2. \n
    3. Docker build
    4. \n
    5. Docker multi-arch builds with buildx
    6. \n
    7. Deployment
    8. \n
    9. Building locally
    10. \n
    11. Customizing the build
    12. \n
    13. Testing
    14. \n
    \n
  2. \n
  3. Running locally
      \n
    1. NFD-Master
    2. \n
    3. NFD-Worker
    4. \n
    5. NFD-Topology-Updater
    6. \n
    \n
  4. \n
  5. Documentation
  6. \n
\n\n
\n\n

Building from source

\n\n

Download the source code

\n\n
git clone https://github.com/kubernetes-sigs/node-feature-discovery\ncd node-feature-discovery\n
\n\n

Docker build

\n\n

Build the container image

\n\n

See customizing the build below for altering the\ncontainer image registry, for example.

\n\n
make\n
\n\n

Push the container image

\n\n

Optional, this example with Docker.

\n\n
docker push <IMAGE_TAG>\n
\n\n

Docker multi-arch builds with buildx

\n\n

The default set of architectures enabled for mulit-arch builds are linux/amd64\nand linux/arm64. If more architectures are needed one can override the\nIMAGE_ALL_PLATFORMS variable with a comma separated list of OS/ARCH tuples.

\n\n

Build the manifest-list with a container image per arch

\n\n
make image-all\n
\n\n

Currently docker does not support loading of manifest-lists meaning the images\nare not shown when executing docker images, see:\nbuildx issue #59.

\n\n

Push the manifest-list with container image per arch

\n\n
make push-all\n
\n\n

The resulting container image can be used in the same way on each arch by pulling\ne.g. node-feature-discovery:v0.11.0 without specifying the architecture. The\nmanifest-list will take care of providing the right architecture image.

\n\n

Change the job spec to use your custom image (optional)

\n\n

To use your published image from the step above instead of the\nk8s.gcr.io/nfd/node-feature-discovery image, edit image\nattribute in the spec template(s) to the new location\n(<registry-name>/<image-name>[:<version>]).

\n\n

Deployment

\n\n

The yamls makefile generates a kustomization.yaml matching your locally\nbuilt image and using the deploy/overlays/default deployment. See\nbuild customization below for configurability, e.g.\nchanging the deployment namespace.

\n\n
K8S_NAMESPACE=my-ns make yamls\nkubectl apply -k .\n
\n\n

You can use alternative deployment methods by modifying the auto-generated\nkustomization file. For example, deploying worker and master in the same pod by\npointing to deployment/overlays/default-combined.

\n\n

Building locally

\n\n

You can also build the binaries locally

\n\n
make build\n
\n\n

This will compile binaries under bin/

\n\n

Customizing the build

\n\n

There are several Makefile variables that control the build process and the\nname of the resulting container image. The following are targeted targeted for\nbuild customization and they can be specified via environment variables or\nmakefile overrides.

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
VariableDescriptionDefault value
HOSTMOUNT_PREFIXPrefix of system directories for feature discovery (local builds)/ (local builds) /host- (container builds)
IMAGE_BUILD_CMDCommand to build the imagedocker build
IMAGE_BUILD_EXTRA_OPTSExtra options to pass to build commandempty
IMAGE_BUILDX_CMDCommand to build and push multi-arch images with buildxDOCKER_CLI_EXPERIMENTAL=enabled docker buildx build –platform=${IMAGE_ALL_PLATFORMS} –progress=auto –pull
IMAGE_ALL_PLATFORMSComma seperated list of OS/ARCH tuples for mulit-arch buildslinux/amd64,linux/arm64
IMAGE_PUSH_CMDCommand to push the image to remote registrydocker push
IMAGE_REGISTRYContainer image registry to usek8s.gcr.io/nfd
IMAGE_TAG_NAMEContainer image tag name<nfd version>
IMAGE_EXTRA_TAG_NAMESAdditional container image tag(s) to create when building imageempty
K8S_NAMESPACEnfd-master and nfd-worker namespacenode-feature-discovery
KUBECONFIGKubeconfig for running e2e-testsempty
E2E_TEST_CONFIGParameterization file of e2e-tests (see example)empty
OPENSHIFTNon-empty value enables OpenShift specific support (currently only effective in e2e tests)empty
BASE_IMAGE_FULLContainer base image for target image full (–target full)debian:buster-slim
BASE_IMAGE_MINIMALContainer base image for target image minimal (–target minimal)gcr.io/distroless/base
\n\n

For example, to use a custom registry:

\n\n
make IMAGE_REGISTRY=<my custom registry uri>\n
\n\n

Or to specify a build tool different from Docker, It can be done in 2 ways:

\n\n
    \n
  1. \n

    via environment

    \n\n
     IMAGE_BUILD_CMD=\"buildah bud\" make\n
    \n
  2. \n
  3. \n

    by overriding the variable value

    \n\n
     make  IMAGE_BUILD_CMD=\"buildah bud\"\n
    \n
  4. \n
\n\n

Testing

\n\n

Unit tests are automatically run as part of the container image build. You can\nalso run them manually in the source code tree by simply running:

\n\n
make test\n
\n\n

End-to-end tests are built on top of the e2e test framework of Kubernetes, and,\nthey required a cluster to run them on. For running the tests on your test\ncluster you need to specify the kubeconfig to be used:

\n\n
make e2e-test KUBECONFIG=$HOME/.kube/config\n
\n\n

Running locally

\n\n

You can run NFD locally, either directly on your host OS or in containers for\ntesting and development purposes. This may be useful e.g. for checking\nfeatures-detection.

\n\n

NFD-Master

\n\n

When running as a standalone container labeling is expected to fail because\nKubernetes API is not available. Thus, it is recommended to use -no-publish\ncommand line flag. E.g.

\n\n
$ export NFD_CONTAINER_IMAGE=k8s.gcr.io/nfd/node-feature-discovery:v0.11.1\n$ docker run --rm --name=nfd-test ${NFD_CONTAINER_IMAGE} nfd-master -no-publish\n2019/02/01 14:48:21 Node Feature Discovery Master <NFD_VERSION>\n2019/02/01 14:48:21 gRPC server serving on port: 8080\n
\n\n

NFD-Worker

\n\n

In order to run nfd-worker as a “stand-alone” container against your\nstandalone nfd-master you need to run them in the same network namespace:

\n\n
$ docker run --rm --network=container:nfd-test ${NFD_CONTAINER_IMAGE} nfd-worker\n2019/02/01 14:48:56 Node Feature Discovery Worker <NFD_VERSION>\n...\n
\n\n

If you just want to try out feature discovery without connecting to nfd-master,\npass the -no-publish flag to nfd-worker.

\n\n

NOTE Some feature sources need certain directories and/or files from the\nhost mounted inside the NFD container. Thus, you need to provide Docker with the\ncorrect --volume options in order for them to work correctly when run\nstand-alone directly with docker run. See the\ndefault deployment\nfor up-to-date information about the required volume mounts.

\n\n

NFD-Topology-Updater

\n\n

In order to run nfd-topology-updater as a “stand-alone” container against your\nstandalone nfd-master you need to run them in the same network namespace:

\n\n
$ docker run --rm --network=container:nfd-test ${NFD_CONTAINER_IMAGE} nfd-topology-updater\n2019/02/01 14:48:56 Node Feature Discovery Topology Updater <NFD_VERSION>\n...\n
\n\n

If you just want to try out feature discovery without connecting to nfd-master,\npass the -no-publish flag to nfd-topology-updater.

\n\n

NOTE:

\n\n

NFD topology updater needs certain directories and/or files from the\nhost mounted inside the NFD container. Thus, you need to provide Docker with the\ncorrect --volume options in order for them to work correctly when run\nstand-alone directly with docker run. See the\ntemplate spec\nfor up-to-date information about the required volume mounts.

\n\n

PodResource API is a prerequisite for nfd-topology-updater.\nPreceding Kubernetes v1.23, the kubelet must be started with the following flag:\n--feature-gates=KubeletPodResourcesGetAllocatable=true.\nStarting Kubernetes v1.23, the GetAllocatableResources is enabled by default\nthrough KubeletPodResourcesGetAllocatable feature gate.

\n\n

Documentation

\n\n

All documentation resides under the\ndocs\ndirectory in the source tree. It is designed to be served as a html site by\nGitHub Pages.

\n\n

Building the documentation is containerized in order to fix the build\nenvironment. The recommended way for developing documentation is to run:

\n\n
make site-serve\n
\n\n

This will build the documentation in a container and serve it under\nlocalhost:4000/ making it easy to verify the results.\nAny changes made to the docs/ will automatically re-trigger a rebuild and are\nreflected in the served content and can be inspected with a simple browser\nrefresh.

\n\n

In order to just build the html documentation run:

\n\n
make site-build\n
\n\n

This will generate html documentation under docs/_site/.

\n\n\n","dir":"/advanced/","name":"developer-guide.md","path":"advanced/developer-guide.md","url":"/advanced/developer-guide.html"},{"title":"Get started","layout":"default","sort":1,"content":"

Node Feature Discovery

\n\n

Welcome to Node Feature Discovery – a Kubernetes add-on for detecting hardware\nfeatures and system configuration!

\n\n

Continue to:

\n\n\n\n

Quick-start – the short-short version

\n\n
$ kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.11.1\n  namespace/node-feature-discovery created\n  serviceaccount/nfd-master created\n  clusterrole.rbac.authorization.k8s.io/nfd-master created\n  clusterrolebinding.rbac.authorization.k8s.io/nfd-master created\n  configmap/nfd-worker-conf created\n  service/nfd-master created\n  deployment.apps/nfd-master created\n  daemonset.apps/nfd-worker created\n\n$ kubectl -n node-feature-discovery get all\n  NAME                              READY   STATUS    RESTARTS   AGE\n  pod/nfd-master-555458dbbc-sxg6w   1/1     Running   0          56s\n  pod/nfd-worker-mjg9f              1/1     Running   0          17s\n...\n\n$ kubectl get nodes -o json | jq .items[].metadata.labels\n  {\n    \"beta.kubernetes.io/arch\": \"amd64\",\n    \"beta.kubernetes.io/os\": \"linux\",\n    \"feature.node.kubernetes.io/cpu-cpuid.ADX\": \"true\",\n    \"feature.node.kubernetes.io/cpu-cpuid.AESNI\": \"true\",\n...\n\n
\n","dir":"/get-started/","name":"index.md","path":"get-started/index.md","url":"/get-started/"},{"title":"Introduction","layout":"default","sort":1,"content":"

Introduction

\n\n

Table of contents

\n\n
    \n
  1. NFD-Master
  2. \n
  3. NFD-Worker
  4. \n
  5. NFD-Topology-Updater
  6. \n
  7. Feature Discovery
  8. \n
  9. Node annotations
  10. \n
  11. NodeResourceTopology CR
  12. \n
\n\n
\n\n

This software enables node feature discovery for Kubernetes. It detects\nhardware features available on each node in a Kubernetes cluster, and\nadvertises those features using node labels.

\n\n

NFD consists of three software components:

\n\n
    \n
  1. nfd-master
  2. \n
  3. nfd-worker
  4. \n
  5. nfd-topology-updater
  6. \n
\n\n

NFD-Master

\n\n

NFD-Master is the daemon responsible for communication towards the Kubernetes\nAPI. That is, it receives labeling requests from the worker and modifies node\nobjects accordingly.

\n\n

NFD-Worker

\n\n

NFD-Worker is a daemon responsible for feature detection. It then communicates\nthe information to nfd-master which does the actual node labeling. One\ninstance of nfd-worker is supposed to be running on each node of the cluster,

\n\n

NFD-Topology-Updater

\n\n

NFD-Topology-Updater is a daemon responsible for examining allocated\nresources on a worker node to account for resources available to be allocated\nto new pod on a per-zone basis (where a zone can be a NUMA node). It then\ncommunicates the information to nfd-master which does the\nNodeResourceTopology CR creation corresponding\nto all the nodes in the cluster. One instance of nfd-topology-updater is\nsupposed to be running on each node of the cluster.

\n\n

Feature Discovery

\n\n

Feature discovery is divided into domain-specific feature sources:

\n\n\n\n

Each feature source is responsible for detecting a set of features which. in\nturn, are turned into node feature labels. Feature labels are prefixed with\nfeature.node.kubernetes.io/ and also contain the name of the feature source.\nNon-standard user-specific feature labels can be created with the local and\ncustom feature sources.

\n\n

An overview of the default feature labels:

\n\n
{\n  \"feature.node.kubernetes.io/cpu-<feature-name>\": \"true\",\n  \"feature.node.kubernetes.io/custom-<feature-name>\": \"true\",\n  \"feature.node.kubernetes.io/kernel-<feature name>\": \"<feature value>\",\n  \"feature.node.kubernetes.io/memory-<feature-name>\": \"true\",\n  \"feature.node.kubernetes.io/network-<feature-name>\": \"true\",\n  \"feature.node.kubernetes.io/pci-<device label>.present\": \"true\",\n  \"feature.node.kubernetes.io/storage-<feature-name>\": \"true\",\n  \"feature.node.kubernetes.io/system-<feature name>\": \"<feature value>\",\n  \"feature.node.kubernetes.io/usb-<device label>.present\": \"<feature value>\",\n  \"feature.node.kubernetes.io/<file name>-<feature name>\": \"<feature value>\"\n}\n
\n\n

Node annotations

\n\n

NFD also annotates nodes it is running on:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
AnnotationDescription
[<instance>.]nfd.node.kubernetes.io/master.versionVersion of the nfd-master instance running on the node. Informative use only.
[<instance>.]nfd.node.kubernetes.io/worker.versionVersion of the nfd-worker instance running on the node. Informative use only.
[<instance>.]nfd.node.kubernetes.io/feature-labelsComma-separated list of node labels managed by NFD. NFD uses this internally so must not be edited by users.
[<instance>.]nfd.node.kubernetes.io/extended-resourcesComma-separated list of node extended resources managed by NFD. NFD uses this internally so must not be edited by users.
\n\n

NOTE: the -instance\ncommand line flag affects the annotation names

\n\n

Unapplicable annotations are not created, i.e. for example master.version is\nonly created on nodes running nfd-master.

\n\n

NodeResourceTopology CR

\n\n

When run with NFD-Topology-Updater, NFD creates CR instances corresponding to\nnode resource hardware topology such as:

\n\n
apiVersion: topology.node.k8s.io/v1alpha1\nkind: NodeResourceTopology\nmetadata:\n  name: node1\ntopologyPolicies: [\"SingleNUMANodeContainerLevel\"]\nzones:\n  - name: node-0\n    type: Node\n    resources:\n      - name: cpu\n        capacity: 20\n        allocatable: 16\n        available: 10\n      - name: vendor/nic1\n        capacity: 3\n        allocatable: 3\n        available: 3\n  - name: node-1\n    type: Node\n    resources:\n      - name: cpu\n        capacity: 30\n        allocatable: 30\n        available: 15\n      - name: vendor/nic2\n        capacity: 6\n        allocatable: 6\n        available: 6\n  - name: node-2\n    type: Node\n    resources:\n      - name: cpu\n        capacity: 30\n        allocatable: 30\n        available: 15\n      - name: vendor/nic1\n        capacity: 3\n        allocatable: 3\n        available: 3\n
\n","dir":"/get-started/","name":"introduction.md","path":"get-started/introduction.md","url":"/get-started/introduction.html"},{"title":"Master cmdline reference","layout":"default","sort":2,"content":"

Commandline flags of nfd-master

\n\n

Table of contents

\n\n
    \n
  1. -h, -help
  2. \n
  3. -version
  4. \n
  5. -prune
  6. \n
  7. -port
  8. \n
  9. -instance
  10. \n
  11. -ca-file
  12. \n
  13. -cert-file
  14. \n
  15. -key-file
  16. \n
  17. -verify-node-name
  18. \n
  19. -no-publish
  20. \n
  21. -featurerules-controller
  22. \n
  23. -label-whitelist
  24. \n
  25. -extra-label-ns
  26. \n
  27. -resource-labels
  28. \n
  29. Logging
  30. \n
\n\n
\n\n

To quickly view available command line flags execute nfd-master -help.\nIn a docker container:

\n\n
docker run k8s.gcr.io/nfd/node-feature-discovery:v0.11.1 nfd-master -help\n
\n\n

-h, -help

\n\n

Print usage and exit.

\n\n

-version

\n\n

Print version and exit.

\n\n

-prune

\n\n

The -prune flag is a sub-command like option for cleaning up the cluster. It\ncauses nfd-master to remove all NFD related labels, annotations and extended\nresources from all Node objects of the cluster and exit.

\n\n

-port

\n\n

The -port flag specifies the TCP port that nfd-master listens for incoming requests.

\n\n

Default: 8080

\n\n

Example:

\n\n
nfd-master -port=443\n
\n\n

-instance

\n\n

The -instance flag makes it possible to run multiple NFD deployments in\nparallel. In practice, it separates the node annotations between deployments so\nthat each of them can store metadata independently. The instance name must\nstart and end with an alphanumeric character and may only contain alphanumeric\ncharacters, -, _ or ..

\n\n

Default: empty

\n\n

Example:

\n\n
nfd-master -instance=network\n
\n\n

-ca-file

\n\n

The -ca-file is one of the three flags (together with -cert-file and\n-key-file) controlling master-worker mutual TLS authentication on the\nnfd-master side. This flag specifies the TLS root certificate that is used for\nauthenticating incoming connections. NFD-Worker side needs to have matching key\nand cert files configured in order for the incoming requests to be accepted.

\n\n

Default: empty

\n\n

Note: Must be specified together with -cert-file and -key-file

\n\n

Example:

\n\n
nfd-master -ca-file=/opt/nfd/ca.crt -cert-file=/opt/nfd/master.crt -key-file=/opt/nfd/master.key\n
\n\n

-cert-file

\n\n

The -cert-file is one of the three flags (together with -ca-file and\n-key-file) controlling master-worker mutual TLS authentication on the\nnfd-master side. This flag specifies the TLS certificate presented for\nauthenticating outgoing traffic towards nfd-worker.

\n\n

Default: empty

\n\n

Note: Must be specified together with -ca-file and -key-file

\n\n

Example:

\n\n
nfd-master -cert-file=/opt/nfd/master.crt -key-file=/opt/nfd/master.key -ca-file=/opt/nfd/ca.crt\n
\n\n

-key-file

\n\n

The -key-file is one of the three flags (together with -ca-file and\n-cert-file) controlling master-worker mutual TLS authentication on the\nnfd-master side. This flag specifies the private key corresponding the given\ncertificate file (-cert-file) that is used for authenticating outgoing\ntraffic.

\n\n

Default: empty

\n\n

Note: Must be specified together with -cert-file and -ca-file

\n\n

Example:

\n\n
nfd-master -key-file=/opt/nfd/master.key -cert-file=/opt/nfd/master.crt -ca-file=/opt/nfd/ca.crt\n
\n\n

-verify-node-name

\n\n

The -verify-node-name flag controls the NodeName based authorization of\nincoming requests and only has effect when mTLS authentication has been enabled\n(with -ca-file, -cert-file and -key-file). If enabled, the worker node\nname of the incoming must match with the CN or a SAN in its TLS certificate. Thus,\nworkers are only able to label the node they are running on (or the node whose\ncertificate they present).

\n\n

Node Name based authorization is disabled by default.

\n\n

Default: false

\n\n

Example:

\n\n
nfd-master -verify-node-name -ca-file=/opt/nfd/ca.crt \\\n    -cert-file=/opt/nfd/master.crt -key-file=/opt/nfd/master.key\n
\n\n

-no-publish

\n\n

The -no-publish flag disables updates to the Node objects in the Kubernetes\nAPI server, making a “dry-run” flag for nfd-master. No Labels, Annotations or\nExtendedResources of nodes are updated.

\n\n

Default: false

\n\n

Example:

\n\n
nfd-master -no-publish\n
\n\n

-featurerules-controller

\n\n

The -featurerules-controller flag controlers the processing of\nNodeFeatureRule objects, effectively enabling/disabling labels from these\ncustom labeling rules.

\n\n

Default: true

\n\n

Example:

\n\n
nfd-master -featurerules-controller=false\n
\n\n

-label-whitelist

\n\n

The -label-whitelist specifies a regular expression for filtering feature\nlabels based on their name. Each label must match against the given reqular\nexpression in order to be published.

\n\n

Note: The regular expression is only matches against the “basename” part of the\nlabel, i.e. to the part of the name after ‘/’. The label namespace is omitted.

\n\n

Default: empty

\n\n

Example:

\n\n
nfd-master -label-whitelist='.*cpuid\\.'\n
\n\n

-extra-label-ns

\n\n

The -extra-label-ns flag specifies a comma-separated list of allowed feature\nlabel namespaces. By default, nfd-master only allows creating labels in the\ndefault feature.node.kubernetes.io and profile.node.kubernetes.io label\nnamespaces and their sub-namespaces (e.g. vendor.feature.node.kubernetes.io\nand sub.ns.profile.node.kubernetes.io). This option can be used to allow\nother vendor or application specific namespaces for custom labels from the\nlocal and custom feature sources.

\n\n

The same namespace control and this flag applies Extended Resources (created\nwith -resource-labels), too.

\n\n

Default: empty

\n\n

Example:

\n\n
nfd-master -extra-label-ns=vendor-1.com,vendor-2.io\n
\n\n

-resource-labels

\n\n

The -resource-labels flag specifies a comma-separated list of features to be\nadvertised as extended resources instead of labels. Features that have integer\nvalues can be published as Extended Resources by listing them in this flag.

\n\n

Default: empty

\n\n

Example:

\n\n
nfd-master -resource-labels=vendor-1.com/feature-1,vendor-2.io/feature-2\n
\n\n

Logging

\n\n

The following logging-related flags are inherited from the\nklog package.

\n\n

-add_dir_header

\n\n

If true, adds the file directory to the header of the log messages.

\n\n

Default: false

\n\n

-alsologtostderr

\n\n

Log to standard error as well as files.

\n\n

Default: false

\n\n

-log_backtrace_at

\n\n

When logging hits line file:N, emit a stack trace.

\n\n

Default: empty

\n\n

-log_dir

\n\n

If non-empty, write log files in this directory.

\n\n

Default: empty

\n\n

-log_file

\n\n

If non-empty, use this log file.

\n\n

Default: empty

\n\n

-log_file_max_size

\n\n

Defines the maximum size a log file can grow to. Unit is megabytes. If the\nvalue is 0, the maximum file size is unlimited.

\n\n

Default: 1800

\n\n

-logtostderr

\n\n

Log to standard error instead of files

\n\n

Default: true

\n\n

-skip_headers

\n\n

If true, avoid header prefixes in the log messages.

\n\n

Default: false

\n\n

-skip_log_headers

\n\n

If true, avoid headers when opening log files.

\n\n

Default: false

\n\n

-stderrthreshold

\n\n

Logs at or above this threshold go to stderr.

\n\n

Default: 2

\n\n

-v

\n\n

Number for the log level verbosity.

\n\n

Default: 0

\n\n

-vmodule

\n\n

Comma-separated list of pattern=N settings for file-filtered logging.

\n\n

Default: empty

\n","dir":"/advanced/","name":"master-commandline-reference.md","path":"advanced/master-commandline-reference.md","url":"/advanced/master-commandline-reference.html"},{"title":"Advanced","layout":"default","sort":2,"content":"

Advanced

\n\n

Advanced topics and reference.

\n","dir":"/advanced/","name":"index.md","path":"advanced/index.md","url":"/advanced/"},{"title":"Quick start","layout":"default","sort":2,"content":"

Quick start

\n\n

Minimal steps to deploy latest released version of NFD in your cluster.

\n\n

Installation

\n\n

Deploy with kustomize – creates a new namespace, service and required RBAC\nrules and deploys nfd-master and nfd-worker daemons.

\n\n
kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.11.1\n
\n\n

Verify

\n\n

Wait until NFD master and NFD worker are running.

\n\n
$ kubectl -n node-feature-discovery get ds,deploy\nNAME                         DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE\ndaemonset.apps/nfd-worker    2         2         2       2            2           <none>          10s\n\nNAME                         READY   UP-TO-DATE   AVAILABLE   AGE\ndeployment.apps/nfd-master   1/1     1            1           17s\n\n
\n\n

Check that NFD feature labels have been created

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

Use node labels

\n\n

Create a pod targeting a distinguishing feature (select a valid feature from\nthe list printed on the previous step)

\n\n
$ cat << EOF | kubectl apply -f -\napiVersion: v1\nkind: Pod\nmetadata:\n  name: feature-dependent-pod\nspec:\n  containers:\n  - image: k8s.gcr.io/pause\n    name: pause\n  nodeSelector:\n    # Select a valid feature\n    feature.node.kubernetes.io/cpu-cpuid.AESNI: 'true'\nEOF\npod/feature-dependent-pod created\n
\n\n

See that the pod is running on a desired node

\n\n
$ kubectl get po feature-dependent-pod -o wide\nNAME                    READY   STATUS    RESTARTS   AGE   IP          NODE     NOMINATED NODE   READINESS GATES\nfeature-dependent-pod   1/1     Running   0          23s   10.36.0.4   node-2   <none>           <none>\n
\n\n

Additional Optional Installation Steps

\n\n

In order to deploy nfd-master and nfd-topology-updater daemons\nuse topologyupdater overlay.

\n\n

Deploy with kustomize – creates a new namespace, service and required RBAC\nrules and nfd-master and nfd-topology-updater daemons.

\n\n
kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/topologyupdater?ref=v0.11.1\n
\n\n

NOTE:

\n\n

PodResource API is a prerequisite for nfd-topology-updater.

\n\n

Preceding Kubernetes v1.23, the kubelet must be started with the following flag:

\n\n

--feature-gates=KubeletPodResourcesGetAllocatable=true

\n\n

Starting Kubernetes v1.23, the GetAllocatableResources is enabled by default\nthrough KubeletPodResourcesGetAllocatable feature gate.

\n\n

Verify

\n\n

Wait until NFD master and NFD topologyupdater are running.

\n\n
$ kubectl -n node-feature-discovery get ds,deploy\nNAME                                  DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE\ndaemonset.apps/nfd-topology-updater   2         2         2       2            2           <none>          5s\n\nNAME                         READY   UP-TO-DATE   AVAILABLE   AGE\ndeployment.apps/nfd-master   1/1     1            1           17s\n\n
\n\n

Check that the NodeResourceTopology CR instances are created

\n\n
$ kubectl get noderesourcetopologies.topology.node.k8s.io\nNAME                 AGE\nkind-control-plane   23s\nkind-worker          23s\n
\n\n

Show the CR instances

\n\n
$ kubectl describe noderesourcetopologies.topology.node.k8s.io kind-control-plane\nName:         kind-control-plane\nNamespace:    default\nLabels:       <none>\nAnnotations:  <none>\nAPI Version:  topology.node.k8s.io/v1alpha1\nKind:         NodeResourceTopology\n...\nTopology Policies:\n  SingleNUMANodeContainerLevel\nZones:\n    Name:             node-0\n    Costs:\n      node-0:  10\n      node-1:  20\n    Resources:\n        Name:         Cpu\n        Allocatable:  3\n        Capacity:     3\n        Available:    3\n        Name:         vendor/nic1\n        Allocatable:  2\n        Capacity:     2\n        Available:    2\n        Name:         vendor/nic2\n        Allocatable:  2\n        Capacity:     2\n        Available:    2\n    Type:             Node\n    Name:             node-1\n    Costs:\n      node-0:  20\n      node-1:  10\n    Resources:\n        Name:         Cpu\n        Allocatable:  4\n        Capacity:     4\n        Available:    4\n        Name:         vendor/nic1\n        Allocatable:  2\n        Capacity:     2\n        Available:    2\n        Name:         vendor/nic2\n        Allocatable:  2\n        Capacity:     2\n        Available:    2\n    Type:             Node\nEvents:               <none>\n
\n\n

The CR instances created can be used to gain insight into the allocatable\nresources along with the granularity of those resources at a per-zone level\n(represented by node-0 and node-1 in the above example) or can be used by an\nexternal entity (e.g. topology-aware scheduler plugin) to take an action based\non the gathered information.

\n\n\n","dir":"/get-started/","name":"quick-start.md","path":"get-started/quick-start.md","url":"/get-started/quick-start.html"},{"title":"Contributing","layout":"default","sort":3,"content":"

Contributing

\n\n
\n\n

Community

\n\n

You can reach us via the following channels:

\n\n\n\n

Governance

\n\n

This is a\nSIG-node\nsubproject, hosted under the\nKubernetes SIGs organization in Github.\nThe project was established in 2016 and was migrated to Kubernetes SIGs in 2018.

\n\n

License

\n\n

This is open source software released under the Apache 2.0 License.

\n","dir":"/contributing/","name":"index.md","path":"contributing/index.md","url":"/contributing/"},{"title":"Worker cmdline reference","layout":"default","sort":3,"content":"

Commandline flags of nfd-worker

\n\n

Table of contents

\n\n
    \n
  1. -h, -help
  2. \n
  3. -version
  4. \n
  5. -config
  6. \n
  7. -options
  8. \n
  9. -server
  10. \n
  11. -ca-file
  12. \n
  13. -cert-file
  14. \n
  15. -key-file
  16. \n
  17. -server-name-override
  18. \n
  19. -feature-sources
  20. \n
  21. -label-sources
  22. \n
  23. -sources
  24. \n
  25. -no-publish
  26. \n
  27. -label-whitelist
  28. \n
  29. -oneshot
  30. \n
  31. -sleep-interval
  32. \n
  33. Logging
  34. \n
\n\n
\n\n

To quickly view available command line flags execute nfd-worker -help.\nIn a docker container:

\n\n
docker run k8s.gcr.io/nfd/node-feature-discovery:v0.11.1 nfd-worker -help\n
\n\n

-h, -help

\n\n

Print usage and exit.

\n\n

-version

\n\n

Print version and exit.

\n\n

-config

\n\n

The -config flag specifies the path of the nfd-worker configuration file to\nuse.

\n\n

Default: /etc/kubernetes/node-feature-discovery/nfd-worker.conf

\n\n

Example:

\n\n
nfd-worker -config=/opt/nfd/worker.conf\n
\n\n

-options

\n\n

The -options flag may be used to specify and override configuration file\noptions directly from the command line. The required format is the same as in\nthe config file i.e. JSON or YAML. Configuration options specified via this\nflag will override those from the configuration file:

\n\n

Default: empty

\n\n

Example:

\n\n
nfd-worker -options='{\"sources\":{\"cpu\":{\"cpuid\":{\"attributeWhitelist\":[\"AVX\",\"AVX2\"]}}}}'\n
\n\n

-server

\n\n

The -server flag specifies the address of the nfd-master endpoint where to\nconnect to.

\n\n

Default: localhost:8080

\n\n

Example:

\n\n
nfd-worker -server=nfd-master.nfd.svc.cluster.local:443\n
\n\n

-ca-file

\n\n

The -ca-file is one of the three flags (together with -cert-file and\n-key-file) controlling the mutual TLS authentication on the worker side.\nThis flag specifies the TLS root certificate that is used for verifying the\nauthenticity of nfd-master.

\n\n

Default: empty

\n\n

Note: Must be specified together with -cert-file and -key-file

\n\n

Example:

\n\n
nfd-worker -ca-file=/opt/nfd/ca.crt -cert-file=/opt/nfd/worker.crt -key-file=/opt/nfd/worker.key\n
\n\n

-cert-file

\n\n

The -cert-file is one of the three flags (together with -ca-file and\n-key-file) controlling mutual TLS authentication on the worker side. This\nflag specifies the TLS certificate presented for authenticating outgoing\nrequests.

\n\n

Default: empty

\n\n

Note: Must be specified together with -ca-file and -key-file

\n\n

Example:

\n\n
nfd-workerr -cert-file=/opt/nfd/worker.crt -key-file=/opt/nfd/worker.key -ca-file=/opt/nfd/ca.crt\n
\n\n

-key-file

\n\n

The -key-file is one of the three flags (together with -ca-file and\n-cert-file) controlling the mutual TLS authentication on the worker side.\nThis flag specifies the private key corresponding the given certificate file\n(-cert-file) that is used for authenticating outgoing requests.

\n\n

Default: empty

\n\n

Note: Must be specified together with -cert-file and -ca-file

\n\n

Example:

\n\n
nfd-worker -key-file=/opt/nfd/worker.key -cert-file=/opt/nfd/worker.crt -ca-file=/opt/nfd/ca.crt\n
\n\n

-server-name-override

\n\n

The -server-name-override flag specifies the common name (CN) which to\nexpect from the nfd-master TLS certificate. This flag is mostly intended for\ndevelopment and debugging purposes.

\n\n

Default: empty

\n\n

Example:

\n\n
nfd-worker -server-name-override=localhost\n
\n\n

-feature-sources

\n\n

The -feature-sources flag specifies a comma-separated list of enabled feature\nsources. A special value all enables all sources. Prefixing a source name\nwith - indicates that the source will be disabled instead - this is only\nmeaningful when used in conjunction with all. This command line flag allows\ncompletely disabling the feature detection so that neither standard feature\nlabels are generated nor the raw feature data is available for custom rule\nprocessing. Consider using the core.featureSources config file option,\ninstead, allowing dynamic configurability.

\n\n

Note: This flag takes precedence over the core.featureSources configuration\nfile option.

\n\n

Default: all

\n\n

Example:

\n\n
nfd-worker -feature-sources=all,-pci\n
\n\n

-label-sources

\n\n

The -label-sources flag specifies a comma-separated list of enabled label\nsources. A special value all enables all sources. Prefixing a source name\nwith - indicates that the source will be disabled instead - this is only\nmeaningful when used in conjunction with all. Consider using the\ncore.labelSources config file option, instead, allowing dynamic\nconfigurability.

\n\n

Note: This flag takes precedence over the core.labelSources configuration\nfile option.

\n\n

Default: all

\n\n

Example:

\n\n
nfd-worker -label-sources=kernel,system,local\n
\n\n

-sources

\n\n

DEPRECATED: use -label-sources instead.

\n\n

-no-publish

\n\n

The -no-publish flag disables all communication with the nfd-master, making\nit a “dry-run” flag for nfd-worker. NFD-Worker runs feature detection normally,\nbut no labeling requests are sent to nfd-master.

\n\n

Default: false

\n\n

Example:

\n\n
nfd-worker -no-publish\n
\n\n

-label-whitelist

\n\n

The -label-whitelist specifies a regular expression for filtering feature\nlabels based on their name. Each label must match against the given reqular\nexpression in order to be published.

\n\n

Note: The regular expression is only matches against the “basename” part of the\nlabel, i.e. to the part of the name after ‘/’. The label namespace is omitted.

\n\n

Note: This flag takes precedence over the core.labelWhiteList configuration\nfile option.

\n\n

Default: empty

\n\n

Example:

\n\n
nfd-worker -label-whitelist='.*cpuid\\.'\n
\n\n

DEPRECATED: you should use the core.labelWhiteList option in the\nconfiguration file, instead.

\n\n

-oneshot

\n\n

The -oneshot flag causes nfd-worker to exit after one pass of feature\ndetection.

\n\n

Default: false

\n\n

Example:

\n\n
nfd-worker -oneshot -no-publish\n
\n\n

-sleep-interval

\n\n

The -sleep-interval specifies the interval between feature re-detection (and\nnode re-labeling). A non-positive value implies infinite sleep interval, i.e.\nno re-detection or re-labeling is done.

\n\n

Note: This flag takes precedence over the core.sleepInterval configuration\nfile option.

\n\n

Default: 60s

\n\n

Example:

\n\n
nfd-worker -sleep-interval=1h\n
\n\n

DEPRECATED: you should use the core.sleepInterval option in the\nconfiguration file, instead.

\n\n

Logging

\n\n

The following logging-related flags are inherited from the\nklog package.

\n\n

Note: The logger setup can also be specified via the core.klog configuration\nfile options. However, the command line flags take precedence over any\ncorresponding config file options specified.

\n\n

-add_dir_header

\n\n

If true, adds the file directory to the header of the log messages.

\n\n

Default: false

\n\n

-alsologtostderr

\n\n

Log to standard error as well as files.

\n\n

Default: false

\n\n

-log_backtrace_at

\n\n

When logging hits line file:N, emit a stack trace.

\n\n

Default: empty

\n\n

-log_dir

\n\n

If non-empty, write log files in this directory.

\n\n

Default: empty

\n\n

-log_file

\n\n

If non-empty, use this log file.

\n\n

Default: empty

\n\n

-log_file_max_size

\n\n

Defines the maximum size a log file can grow to. Unit is megabytes. If the\nvalue is 0, the maximum file size is unlimited.

\n\n

Default: 1800

\n\n

-logtostderr

\n\n

Log to standard error instead of files

\n\n

Default: true

\n\n

-skip_headers

\n\n

If true, avoid header prefixes in the log messages.

\n\n

Default: false

\n\n

-skip_log_headers

\n\n

If true, avoid headers when opening log files.

\n\n

Default: false

\n\n

-stderrthreshold

\n\n

Logs at or above this threshold go to stderr.

\n\n

Default: 2

\n\n

-v

\n\n

Number for the log level verbosity.

\n\n

Default: 0

\n\n

-vmodule

\n\n

Comma-separated list of pattern=N settings for file-filtered logging.

\n\n

Default: empty

\n","dir":"/advanced/","name":"worker-commandline-reference.md","path":"advanced/worker-commandline-reference.md","url":"/advanced/worker-commandline-reference.html"},{"title":"Deployment and usage","layout":"default","sort":3,"content":"

Deployment and usage

\n\n

Table of contents

\n\n
    \n
  1. Image variants
      \n
    1. Full
    2. \n
    3. Minimal
    4. \n
    \n
  2. \n
  3. Deployment options
      \n
    1. Operator
    2. \n
    3. Deployment with kustomize
    4. \n
    5. Deployment with Helm
    6. \n
    7. Build your own
    8. \n
    \n
  4. \n
  5. Usage
      \n
    1. NFD-Master
    2. \n
    3. NFD-Worker
    4. \n
    5. NFD-Topology-Updater
    6. \n
    7. Communication security with TLS
    8. \n
    \n
  6. \n
  7. Worker configuration
  8. \n
  9. Using node labels
  10. \n
  11. Uninstallation
      \n
    1. Operator was used for deployment
    2. \n
    3. Manual
    4. \n
    5. Removing feature labels
    6. \n
    \n
  12. \n
\n\n
\n\n

Image variants

\n\n

NFD currently offers two variants of the container image. The “full” variant is\ncurrently deployed by default. Released container images are available for\nx86_64 and Arm64 architectures.

\n\n

Full

\n\n

This image is based on\ndebian:buster-slim and contains a full Linux\nsystem for running shell-based nfd-worker hooks and doing live debugging and\ndiagnosis of the NFD images.

\n\n

Minimal

\n\n

This is a minimal image based on\ngcr.io/distroless/base\nand only supports running statically linked binaries.

\n\n

The container image tag has suffix -minimal\n(e.g. k8s.gcr.io/nfd/node-feature-discovery:v0.11.1-minimal)

\n\n

Deployment options

\n\n

Operator

\n\n

Deployment using the\nNode Feature Discovery Operator\nis recommended to be done via\noperatorhub.io.

\n\n
    \n
  1. You need to have\nOLM\ninstalled. If you don’t, take a look at the\nlatest release\nfor detailed instructions.
  2. \n
  3. \n

    Install the operator:

    \n\n
    kubectl create -f https://operatorhub.io/install/nfd-operator.yaml\n
    \n
  4. \n
  5. \n

    Create NodeFeatureDiscovery object (in nfd namespace here):

    \n\n
    cat << EOF | kubectl apply -f -\napiVersion: v1\nkind: Namespace\nmetadata:\n  name: nfd\n---\napiVersion: nfd.kubernetes.io/v1\nkind: NodeFeatureDiscovery\nmetadata:\n  name: my-nfd-deployment\n  namespace: nfd\nspec:\n  operand:\n    image: k8s.gcr.io/nfd/node-feature-discovery:v0.11.1\n    imagePullPolicy: IfNotPresent\nEOF\n
    \n
  6. \n
\n\n

In order to deploy the minimal image you need to use

\n\n
  image: k8s.gcr.io/nfd/node-feature-discovery:v0.11.1-minimal\n
\n\n

in the NodeFeatureDiscovery object above.

\n\n

Deployment with kustomize

\n\n

This requires kubectl\nv1.21 or later. The kustomize overlays provided in the repo can be used\ndirectly:

\n\n
kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.11.1\n
\n\n

This will required RBAC rules and deploy nfd-master (as a deployment) and\nnfd-worker (as daemonset) in the node-feature-discovery namespace.

\n\n

NOTE: nfd-topology-updater is not deployed as part of the default overlay.\nPlease refer to the Master Worker Topologyupdater\nand Topologyupdater below.

\n\n

Alternatively you can clone the repository and customize the deployment by\ncreating your own overlays. For example, to deploy the minimal\nimage. See kustomize for more information about managing\ndeployment configurations.

\n\n

Default overlays

\n\n

The NFD repository hosts a set of overlays for different usages and deployment\nscenarios under\ndeployment/overlays

\n\n\n\n

Master-worker pod

\n\n

You can also run nfd-master and nfd-worker inside the same pod

\n\n
kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default-combined?ref=v0.11.1\n\n
\n\n

This creates a DaemonSet that runs nfd-worker and nfd-master in the same Pod.\nIn this case no nfd-master is run on the master node(s), but, the worker nodes\nare able to label themselves which may be desirable e.g. in single-node setups.

\n\n

NOTE: nfd-topology-updater is not deployed by the default-combined overlay.\nTo enable nfd-topology-updater in this scenario,the users must customize the\ndeployment themselves.

\n\n

Worker one-shot

\n\n

Feature discovery can alternatively be configured as a one-shot job.\nThe default-job overlay may be used to achieve this:

\n\n
NUM_NODES=$(kubectl get no -o jsonpath='{.items[*].metadata.name}' | wc -w)\nkubectl kustomize https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default-job?ref=v0.11.1 | \\\n    sed s\"/NUM_NODES/$NUM_NODES/\" | \\\n    kubectl apply -f -\n
\n\n

The example above launches as many jobs as there are non-master nodes. Note that\nthis approach does not guarantee running once on every node. For example,\ntainted, non-ready nodes or some other reasons in Job scheduling may cause some\nnode(s) will run extra job instance(s) to satisfy the request.

\n\n

Master Worker Topologyupdater

\n\n

NFD Master, NFD worker and NFD Topologyupdater can be configured to be deployed\nas separate pods. The master-worker-topologyupdater overlay may be used to\nachieve this:

\n\n
kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/master-worker-topologyupdater?ref=v0.11.1\n\n
\n\n

Topologyupdater

\n\n

In order to deploy just NFD master and NFD Topologyupdater (without nfd-worker)\nuse the topologyupdater overlay:

\n\n
kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/topologyupdater?ref=v0.11.1\n\n
\n\n

NFD Topologyupdater can be configured along with the default overlay\n(which deploys NFD worker and NFD master) where all the software components\nare deployed as separate pods. The topologyupdater overlay may be used\nalong with default overlay to achieve this:

\n\n
\nkubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.11.1\nkubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/topologyupdater?ref=v0.11.1\n\n
\n\n

Deployment with Helm

\n\n

Node Feature Discovery Helm chart allow to easily deploy and manage NFD.

\n\n

Prerequisites

\n\n

Helm package manager should be installed.

\n\n

Deployment

\n\n

To install the latest stable version:

\n\n
export NFD_NS=node-feature-discovery\nhelm repo add nfd https://kubernetes-sigs.github.io/node-feature-discovery/charts\nhelm repo update\nhelm install nfd/node-feature-discovery --namespace $NFD_NS --create-namespace --generate-name\n
\n\n

To install the latest development version you need to clone the NFD Git\nrepository and install from there.

\n\n
git clone https://github.com/kubernetes-sigs/node-feature-discovery/\ncd node-feature-discovery/deployment/helm\nexport NFD_NS=node-feature-discovery\nhelm install node-feature-discovery ./node-feature-discovery/ --namespace $NFD_NS --create-namespace\n
\n\n

See the configuration section below for instructions how to\nalter the deployment parameters.

\n\n

In order to deploy the minimal image you need to override the image\ntag:

\n\n
helm install node-feature-discovery ./node-feature-discovery/ --set image.tag=v0.11.1-minimal --namespace $NFD_NS --create-namespace\n
\n\n

Configuration

\n\n

You can override values from values.yaml and provide a file with custom values:

\n\n
export NFD_NS=node-feature-discovery\nhelm install nfd/node-feature-discovery -f <path/to/custom/values.yaml> --namespace $NFD_NS --create-namespace\n
\n\n

To specify each parameter separately you can provide them to helm install command:

\n\n
export NFD_NS=node-feature-discovery\nhelm install nfd/node-feature-discovery --set nameOverride=NFDinstance --set master.replicaCount=2 --namespace $NFD_NS --create-namespace\n
\n\n

Uninstalling the chart

\n\n

To uninstall the node-feature-discovery deployment:

\n\n
export NFD_NS=node-feature-discovery\nhelm uninstall node-feature-discovery --namespace $NFD_NS\n
\n\n

The command removes all the Kubernetes components associated with the chart and\ndeletes the release.

\n\n

Chart parameters

\n\n

In order to tailor the deployment of the Node Feature Discovery to your cluster needs\nWe have introduced the following Chart parameters.

\n\n
General parameters
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
NameTypeDefaultdescription
image.repositorystringk8s.gcr.io/nfd/node-feature-discoveryNFD image repository
image.tagstringv0.11.1NFD image tag
image.pullPolicystringAlwaysImage pull policy
imagePullSecretslist[]ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info
nameOverridestring Override the name of the chart
fullnameOverridestring Override a default fully qualified app name
nodeFeatureRule.createCRDbooltrueSpecifies whether to create the NodeFeatureRule CRD
tls.enableboolfalseSpecifies whether to use TLS for communications between components
tls.certManagerboolfalseIf enabled, requires cert-manager to be installed and will automatically create the required TLS certificates
\n\n
Master pod parameters
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
NameTypeDefaultdescription
master.*dict NFD master deployment configuration
master.instancestring Instance name. Used to separate annotation namespaces for multiple parallel deployments
master.extraLabelNsarray[]List of allowed extra label namespaces
master.resourceLabelsarray[]List of labels to be registered as extended resources
master.featureRulesControllerboolnullSpecifies whether the controller for processing of NodeFeatureRule objects is enabled. If not set, controller will be enabled if master.instance is empty.
master.replicaCountinteger1Number of desired pods. This is a pointer to distinguish between explicit zero and not specified
master.podSecurityContextdict{}PodSecurityContext holds pod-level security attributes and common container settings
master.securityContextdict{}Container security settings
master.serviceAccount.createbooltrueSpecifies whether a service account should be created
master.serviceAccount.annotationsdict{}Annotations to add to the service account
master.serviceAccount.namestring The name of the service account to use. If not set and create is true, a name is generated using the fullname template
master.rbac.createbooltrueSpecifies whether to create RBAC configuration for nfd-master
master.service.typestringClusterIPNFD master service type
master.service.portinteger8080NFD master service port
master.resourcesdict{}NFD master pod resources management
master.nodeSelectordict{}NFD master pod node selector
master.tolerationsdictScheduling to master node is disabledNFD master pod tolerations
master.annotationsdict{}NFD master pod annotations
master.affinitydict NFD master pod required node affinity
master.deploymentAnnotationsdict{}NFD master deployment annotations
\n\n
Worker pod parameters
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
NameTypeDefaultdescription
worker.*dict NFD worker daemonset configuration
worker.configdict NFD worker configuration
worker.podSecurityContextdict{}PodSecurityContext holds pod-level security attributes and common container settings
worker.securityContextdict{}Container security settings
worker.mountUsrSrcboolfalseSpecifies whether to allow users to mount the hostpath /user/src. Does not work on systems without /usr/src AND a read-only /usr
worker.resourcesdict{}NFD worker pod resources management
worker.nodeSelectordict{}NFD worker pod node selector
worker.tolerationsdict{}NFD worker pod node tolerations
worker.annotationsdict{}NFD worker pod annotations
worker.daemonsetAnnotationsdict{}NFD worker daemonset annotations
\n\n
Topology updater parameters
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
NameTypeDefaultdescription
topologyUpdater.*dict NFD Topology Updater configuration
topologyUpdater.enableboolfalseSpecifies whether the NFD Topology Updater should be created
topologyUpdater.createCRDsboolfalseSpecifies whether the NFD Topology Updater CRDs should be created
topologyUpdater.serviceAccount.createbooltrueSpecifies whether the service account for topology updater should be created
topologyUpdater.serviceAccount.annotationsdict{}Annotations to add to the service account for topology updater
topologyUpdater.serviceAccount.namestring The name of the service account for topology updater to use. If not set and create is true, a name is generated using the fullname template and -topology-updater suffix
topologyUpdater.rbacdict RBAC parameters for the topology updater
topologyUpdater.rbac.createboolfalseSpecifies whether the cluster role and binding for topology updater should be created
topologyUpdater.kubeletConfigPathstring””Specifies the kubelet config host path
topologyUpdater.kubeletPodResourcesSockPathstring””Specifies the kubelet sock path to read pod resources
topologyUpdater.updateIntervalstring60sTime to sleep between CR updates. Non-positive value implies no CR update.
topologyUpdater.watchNamespacestring*Namespace to watch pods, * for all namespaces
topologyUpdater.podSecurityContextdict{}PodSecurityContext holds pod-level security attributes and common container settings
topologyUpdater.securityContextdict{}Container security settings
topologyUpdater.resourcesdict{}Topology updater pod resources management
topologyUpdater.nodeSelectordict{}Topology updater pod node selector
topologyUpdater.tolerationsdict{}Topology updater pod node tolerations
topologyUpdater.annotationsdict{}Topology updater pod annotations
topologyUpdater.affinitydict{}Topology updater pod affinity
\n\n

Build your own

\n\n

If you want to use the latest development version (master branch) you need to\nbuild your own custom image.\nSee the Developer Guide for instructions how to\nbuild images and deploy them on your cluster.

\n\n

Usage

\n\n

NFD-Master

\n\n

NFD-Master runs as a deployment (with a replica count of 1), by default\nit prefers running on the cluster’s master nodes but will run on worker\nnodes if no master nodes are found.

\n\n

For High Availability, you should simply increase the replica count of\nthe deployment object. You should also look into adding\ninter-pod\naffinity to prevent masters from running on the same node.\nHowever note that inter-pod affinity is costly and is not recommended\nin bigger clusters.

\n\n

NFD-Master listens for connections from nfd-worker(s) and connects to the\nKubernetes API server to add node labels advertised by them.

\n\n

If you have RBAC authorization enabled (as is the default e.g. with clusters\ninitialized with kubeadm) you need to configure the appropriate ClusterRoles,\nClusterRoleBindings and a ServiceAccount in order for NFD to create node\nlabels. The provided template will configure these for you.

\n\n

NFD-Worker

\n\n

NFD-Worker is preferably run as a Kubernetes DaemonSet. This assures\nre-labeling on regular intervals capturing changes in the system configuration\nand makes sure that new nodes are labeled as they are added to the cluster.\nWorker connects to the nfd-master service to advertise hardware features.

\n\n

When run as a daemonset, nodes are re-labeled at an default interval of 60s.\nThis can be changed by using the\ncore.sleepInterval\nconfig option (or\n-sleep-interval\ncommand line flag).

\n\n

The worker configuration file is watched and re-read on every change which\nprovides a simple mechanism of dynamic run-time reconfiguration. See\nworker configuration for more details.

\n\n

NFD-Topology-Updater

\n\n

NFD-Topology-Updater is preferably run as a Kubernetes DaemonSet. This assures\nre-examination (and CR updates) on regular intervals capturing changes in\nthe allocated resources and hence the allocatable resources on a per zone\nbasis. It makes sure that more CR instances are created as new nodes get\nadded to the cluster. Topology-Updater connects to the nfd-master service\nto create CR instances corresponding to nodes.

\n\n

When run as a daemonset, nodes are re-examined for the allocated resources\n(to determine the information of the allocatable resources on a per zone basis\nwhere a zone can be a NUMA node) at an interval specified using the\n-sleep-interval option. The default sleep interval is set to 60s which is the\n the value when no -sleep-interval is specified.

\n\n

Communication security with TLS

\n\n

NFD supports mutual TLS authentication between the nfd-master and nfd-worker\ninstances. That is, nfd-worker and nfd-master both verify that the other end\npresents a valid certificate.

\n\n

TLS authentication is enabled by specifying -ca-file, -key-file and\n-cert-file args, on both the nfd-master and nfd-worker instances. The\ntemplate specs provided with NFD contain (commented out) example configuration\nfor enabling TLS authentication.

\n\n

The Common Name (CN) of the nfd-master certificate must match the DNS name of\nthe nfd-master Service of the cluster. By default, nfd-master only check that\nthe nfd-worker has been signed by the specified root certificate (-ca-file).

\n\n

Additional hardening can be enabled by specifying -verify-node-name in\nnfd-master args, in which case nfd-master verifies that the NodeName presented\nby nfd-worker matches the Common Name (CN) or a Subject Alternative Name (SAN)\nof its certificate. Note that -verify-node-name complicates certificate\nmanagement and is not yet supported in the helm or kustomize deployment\nmethods.

\n\n

Automated TLS certificate management using cert-manager

\n\n

cert-manager can be used to automate certificate\nmanagement between nfd-master and the nfd-worker pods.

\n\n

The NFD source code repository contains an example kustomize overlay and helm\nchart that can be used to deploy NFD with cert-manager supplied certificates\nenabled.

\n\n

To install cert-manager itself can be done as easily as this, below, or you\ncan refer to their documentation for other installation methods such as the\nhelm chart they provide.

\n\n
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.6.1/cert-manager.yaml\n
\n\n

To use the kustomize overlay to install node-feature-discovery with TLS enabled,\nyou may use the following:

\n\n
kubectl apply -k deployment/overlays/samples/cert-manager\n
\n\n

To make use of the helm chart, override values.yaml to enable both the\ntls.enabled and tls.certManager options. Note that if you do not enable\ntls.certManager, helm will successfully install the application, but\ndeployment will wait until certificates are manually created, as demonstrated\nbelow.

\n\n

See the sample installation commands in the Helm Deployment\nand Configuration sections above for how to either override\nindividual values, or provide a yaml file with which to override default\nvalues.

\n\n

Manual TLS certificate management

\n\n

If you do not with to make use of cert-manager, the certificates can be\nmanually created and stored as secrets within the NFD namespace.

\n\n

Create a CA certificate

\n\n
openssl req -x509 -newkey rsa:4096 -keyout ca.key -nodes \\\n        -subj \"/CN=nfd-ca\" -days 10000 -out ca.crt\n
\n\n

Create a common openssl config file.

\n\n
cat <<EOF > nfd-common.conf\n[ req ]\ndefault_bits = 4096\nprompt = no\ndefault_md = sha256\nreq_extensions = req_ext\ndistinguished_name = dn\n\n[ dn ]\nC = XX\nST = some-state\nL = some-city\nO = some-company\nOU = node-feature-discovery\n\n[ req_ext ]\nsubjectAltName = @alt_names\n\n[ v3_ext ]\nauthorityKeyIdentifier=keyid,issuer:always\nbasicConstraints=CA:FALSE\nkeyUsage=keyEncipherment,dataEncipherment\nextendedKeyUsage=serverAuth,clientAuth\nsubjectAltName=@alt_names\nEOF\n
\n\n

Now, create the nfd-master certificate.

\n\n
cat <<EOF > nfd-master.conf\n.include nfd-common.conf\n\n[ dn ]\nCN = nfd-master\n\n[ alt_names ]\nDNS.1 = nfd-master\nDNS.2 = nfd-master.node-feature-discovery.svc.cluster.local\nDNS.3 = localhost\nEOF\n\nopenssl req -new -newkey rsa:4096 -keyout nfd-master.key -nodes -out nfd-master.csr -config nfd-master.conf\n
\n\n

Create certificates for nfd-worker and nfd-topology-updater

\n\n
cat <<EOF > nfd-worker.conf\n.include nfd-common.conf\n\n[ dn ]\nCN = nfd-worker\n\n[ alt_names ]\nDNS.1 = nfd-worker\nDNS.2 = nfd-worker.node-feature-discovery.svc.cluster.local\nEOF\n\n# Config for topology updater is identical except for the DN and alt_names\nsed -e 's/worker/topology-updater/g' < nfd-worker.conf > nfd-topology-updater.conf\n\nopenssl req -new -newkey rsa:4096 -keyout nfd-worker.key -nodes -out nfd-worker.csr -config nfd-worker.conf\nopenssl req -new -newkey rsa:4096 -keyout nfd-topology-updater.key -nodes -out nfd-topology-updater.csr -config nfd-topology-updater.conf\n
\n\n

Now, sign the certificates with the CA created earlier.

\n\n
for cert in nfd-master nfd-worker nfd-topology-updater; do\n  echo signing $cert\n  openssl x509 -req -in $cert.csr -CA ca.crt -CAkey ca.key \\\n    -CAcreateserial -out $cert.crt -days 10000 \\\n    -extensions v3_ext -extfile $cert.conf\ndone\n
\n\n

Finally, turn these certificates into secrets.

\n\n
for cert in nfd-master nfd-worker nfd-topology-updater; do\n  echo creating secret for $cert in node-feature-discovery namespace\n  cat <<EOF | kubectl create -n node-feature-discovery -f -\n---\napiVersion: v1\nkind: Secret\ntype: kubernetes.io/tls\nmetadata:\n  name: ${cert}-cert\ndata:\n  ca.crt: $( cat ca.crt | base64 -w 0 )\n  tls.crt: $( cat $cert.crt | base64 -w 0 )\n  tls.key: $( cat $cert.key | base64 -w 0 )\nEOF\n\ndone\n
\n\n

Worker configuration

\n\n

NFD-Worker supports dynamic configuration through a configuration file. The\ndefault location is /etc/kubernetes/node-feature-discovery/nfd-worker.conf,\nbut, this can be changed by specifying the-config command line flag.\nConfiguration file is re-read whenever it is modified which makes run-time\nre-configuration of nfd-worker straightforward.

\n\n

Worker configuration file is read inside the container, and thus, Volumes and\nVolumeMounts are needed to make your configuration available for NFD. The\npreferred method is to use a ConfigMap which provides easy deployment and\nre-configurability.

\n\n

The provided nfd-worker deployment templates create an empty configmap and\nmount it inside the nfd-worker containers. In kustomize deployments,\nconfiguration can be edited with:

\n\n
kubectl -n ${NFD_NS} edit configmap nfd-worker-conf\n
\n\n

In Helm deployments, Worker pod parameter\nworker.config can be used to edit the respective configuration.

\n\n

See\nnfd-worker configuration file reference\nfor more details.\nThe (empty-by-default)\nexample config\ncontains all available configuration options and can be used as a reference\nfor creating creating a configuration.

\n\n

Configuration options can also be specified via the -options command line\nflag, in which case no mounts need to be used. The same format as in the config\nfile must be used, i.e. JSON (or YAML). For example:

\n\n
-options='{\"sources\": { \"pci\": { \"deviceClassWhitelist\": [\"12\"] } } }'\n
\n\n

Configuration options specified from the command line will override those read\nfrom the config file.

\n\n

Using node labels

\n\n

Nodes with specific features can be targeted using the nodeSelector field. The\nfollowing example shows how to target nodes with Intel TurboBoost enabled.

\n\n
apiVersion: v1\nkind: Pod\nmetadata:\n  labels:\n    env: test\n  name: golang-test\nspec:\n  containers:\n    - image: golang\n      name: go1\n  nodeSelector:\n    feature.node.kubernetes.io/cpu-pstate.turbo: 'true'\n
\n\n

For more details on targeting nodes, see\nnode selection.

\n\n

Uninstallation

\n\n

Operator was used for deployment

\n\n

If you followed the deployment instructions above you can simply do:

\n\n
kubectl -n nfd delete NodeFeatureDiscovery my-nfd-deployment\n
\n\n

Optionally, you can also remove the namespace:

\n\n
kubectl delete ns nfd\n
\n\n

See the node-feature-discovery-operator and OLM project\ndocumentation for instructions for uninstalling the operator and operator\nlifecycle manager, respectively.

\n\n

Manual

\n\n

Simplest way is to invoke kubectl delete on the deployment files you used.\nBeware that this will also delete the namespace that NFD is running in. For\nexample, in case the default deployment from the repo was used:

\n\n
\nkubectl delete -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.11.1\n
\n\n

Alternatively you can delete create objects one-by-one, depending on the type\nof deployment, for example:

\n\n
NFD_NS=node-feature-discovery\nkubectl -n $NFD_NS delete ds nfd-worker\nkubectl -n $NFD_NS delete deploy nfd-master\nkubectl -n $NFD_NS delete svc nfd-master\nkubectl -n $NFD_NS delete sa nfd-master\nkubectl delete clusterrole nfd-master\nkubectl delete clusterrolebinding nfd-master\n
\n\n

Removing feature labels

\n\n

NFD-Master has a special -prune command line flag for removing all\nnfd-related node labels, annotations and extended resources from the cluster.

\n\n
kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/prune?ref=v0.11.1\nkubectl -n node-feature-discovery wait job.batch/nfd-prune --for=condition=complete && \\\n    kubectl delete -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/prune?ref=v0.11.1\n
\n\n

NOTE: You must run prune before removing the RBAC rules (serviceaccount,\nclusterrole and clusterrolebinding).

\n\n\n","dir":"/get-started/","name":"deployment-and-usage.md","path":"get-started/deployment-and-usage.md","url":"/get-started/deployment-and-usage.html"},{"title":"Worker config reference","layout":"default","sort":4,"content":"

Configuration file reference of nfd-worker

\n\n

Table of contents

\n\n
    \n
  1. core
      \n
    1. core.sleepInterval
    2. \n
    3. core.featureSources
    4. \n
    5. core.labelSources
    6. \n
    7. core.sources
    8. \n
    9. core.labelWhiteList
    10. \n
    11. core.noPublish
    12. \n
    13. core.klog
    14. \n
    \n
  2. \n
  3. sources
      \n
    1. sources.cpu
    2. \n
    3. sources.kernel
    4. \n
    5. soures.pci
    6. \n
    7. sources.usb
    8. \n
    9. sources.custom
    10. \n
    \n
  4. \n
\n\n
\n\n

See the\nsample configuration file\nfor a full example configuration.

\n\n

core

\n\n

The core section contains common configuration settings that are not specific\nto any particular feature source.

\n\n

core.sleepInterval

\n\n

core.sleepInterval specifies the interval between consecutive passes of\nfeature (re-)detection, and thus also the interval between node re-labeling. A\nnon-positive value implies infinite sleep interval, i.e. no re-detection or\nre-labeling is done.

\n\n

Note: Overridden by the deprecated -sleep-interval command line flag (if\nspecified).

\n\n

Default: 60s

\n\n

Example:

\n\n
core:\n  sleepInterval: 60s\n
\n\n

core.featureSources

\n\n

core.featureSources specifies the list of enabled feature sources. A special\nvalue all enables all sources. Prefixing a source name with - indicates\nthat the source will be disabled instead - this is only meaningful when used in\nconjunction with all. This option allows completely disabling the feature\ndetection so that neither standard feature labels are generated nor the raw\nfeature data is available for custom rule processing.

\n\n

Default: [all]

\n\n

Example:

\n\n
core:\n  # Enable all but cpu and local sources\n  featureSources:\n    - \"all\"\n    - \"-cpu\"\n    - \"-local\"\n
\n\n
core:\n  # Enable only cpu and local sources\n  featureSources:\n    - \"cpu\"\n    - \"local\"\n
\n\n

core.labelSources

\n\n

core.labelSources specifies the list of enabled label sources. A special\nvalue all enables all sources. Prefixing a source name with - indicates\nthat the source will be disabled instead - this is only meaningful when used in\nconjunction with all. This configuration option affects the generation of\nnode labels but not the actual discovery of the underlying feature data that is\nused e.g. in custom/NodeFeatureRule rules.

\n\n

Note: Overridden by the -label-sources and -sources command line flags and\nthe core.sources configurations option (if any of them is specified).

\n\n

Default: [all]

\n\n

Example:

\n\n
core:\n  # Enable all but cpu and system sources\n  labelSources:\n    - \"all\"\n    - \"-cpu\"\n    - \"-system\"\n
\n\n
core:\n  # Enable only cpu and system sources\n  labelSources:\n    - \"cpu\"\n    - \"system\"\n
\n\n

core.sources

\n\n

DEPRECATED: use core.labelSources instead.

\n\n

Note: core.sources takes precedence over the core.labelSources\nconfiguration file option.

\n\n

core.labelWhiteList

\n\n

core.labelWhiteList specifies a regular expression for filtering feature\nlabels based on the label name. Non-matching labels are not published.

\n\n

Note: The regular expression is only matches against the “basename” part of the\nlabel, i.e. to the part of the name after ‘/’. The label prefix (or namespace)\nis omitted.

\n\n

Note: Overridden by the deprecated -label-whitelist command line flag (if\nspecified).

\n\n

Default: null

\n\n

Example:

\n\n
core:\n  labelWhiteList: '^cpu-cpuid'\n
\n\n

core.noPublish

\n\n

Setting core.noPublish to true disables all communication with the\nnfd-master. It is effectively a “dry-run” flag: nfd-worker runs feature\ndetection normally, but no labeling requests are sent to nfd-master.

\n\n

Note: Overridden by the -no-publish command line flag (if specified).

\n\n

Default: false

\n\n

Example:

\n\n
core:\n  noPublish: true\n
\n\n

core.klog

\n\n

The following options specify the logger configuration. Most of which can be\ndynamically adjusted at run-time.

\n\n

Note: The logger options can also be specified via command line flags which\ntake precedence over any corresponding config file options.

\n\n

core.klog.addDirHeader

\n\n

If true, adds the file directory to the header of the log messages.

\n\n

Default: false

\n\n

Run-time configurable: yes

\n\n

core.klog.alsologtostderr

\n\n

Log to standard error as well as files.

\n\n

Default: false

\n\n

Run-time configurable: yes

\n\n

core.klog.logBacktraceAt

\n\n

When logging hits line file:N, emit a stack trace.

\n\n

Default: empty

\n\n

Run-time configurable: yes

\n\n

core.klog.logDir

\n\n

If non-empty, write log files in this directory.

\n\n

Default: empty

\n\n

Run-time configurable: no

\n\n

core.klog.logFile

\n\n

If non-empty, use this log file.

\n\n

Default: empty

\n\n

Run-time configurable: no

\n\n

core.klog.logFileMaxSize

\n\n

Defines the maximum size a log file can grow to. Unit is megabytes. If the\nvalue is 0, the maximum file size is unlimited.

\n\n

Default: 1800

\n\n

Run-time configurable: no

\n\n

core.klog.logtostderr

\n\n

Log to standard error instead of files

\n\n

Default: true

\n\n

Run-time configurable: yes

\n\n

core.klog.skipHeaders

\n\n

If true, avoid header prefixes in the log messages.

\n\n

Default: false

\n\n

Run-time configurable: yes

\n\n

core.klog.skipLogHeaders

\n\n

If true, avoid headers when opening log files.

\n\n

Default: false

\n\n

Run-time configurable: no

\n\n

core.klog.stderrthreshold

\n\n

Logs at or above this threshold go to stderr (default 2)

\n\n

Run-time configurable: yes

\n\n

core.klog.v

\n\n

Number for the log level verbosity.

\n\n

Default: 0

\n\n

Run-time configurable: yes

\n\n

core.klog.vmodule

\n\n

Comma-separated list of pattern=N settings for file-filtered logging.

\n\n

Default: empty

\n\n

Run-time configurable: yes

\n\n

sources

\n\n

The sources section contains feature source specific configuration parameters.

\n\n

sources.cpu

\n\n

sources.cpu.cpuid

\n\n
sources.cpu.cpuid.attributeBlacklist
\n\n

Prevent publishing cpuid features listed in this option.

\n\n

Note: overridden by sources.cpu.cpuid.attributeWhitelist (if specified)

\n\n

Default: [BMI1, BMI2, CLMUL, CMOV, CX16, ERMS, F16C, HTT, LZCNT, MMX, MMXEXT,\nNX, POPCNT, RDRAND, RDSEED, RDTSCP, SGX, SGXLC, SSE, SSE2, SSE3, SSE4.1,\nSSE4.2, SSSE3]

\n\n

Example:

\n\n
sources:\n  cpu:\n    cpuid:\n      attributeBlacklist: [MMX, MMXEXT]\n
\n\n
sources.cpu.cpuid.attributeWhitelist
\n\n

Only publish the cpuid features listed in this option.

\n\n

Note: takes precedence over sources.cpu.cpuid.attributeBlacklist

\n\n

Default: empty

\n\n

Example:

\n\n
sources:\n  cpu:\n    cpuid:\n      attributeWhitelist: [AVX512BW, AVX512CD, AVX512DQ, AVX512F, AVX512VL]\n
\n\n

sources.kernel

\n\n

sources.kernel.kconfigFile

\n\n

Path of the kernel config file. If empty, NFD runs a search in the well-known\nstandard locations.

\n\n

Default: empty

\n\n

Example:

\n\n
sources:\n  kernel:\n    kconfigFile: \"/path/to/kconfig\"\n
\n\n

sources.kernel.configOpts

\n\n

Kernel configuration options to publish as feature labels.

\n\n

Default: [NO_HZ, NO_HZ_IDLE, NO_HZ_FULL, PREEMPT]

\n\n

Example:

\n\n
sources:\n  kernel:\n    configOpts: [NO_HZ, X86, DMI]\n
\n\n

soures.pci

\n\n

soures.pci.deviceClassWhitelist

\n\n

List of PCI device class IDs for which to\npublish a label. Can be specified as a main class only (e.g. 03) or full\nclass-subclass combination (e.g. 0300) - the former implies that all\nsubclasses are accepted. The format of the labels can be further configured\nwith deviceLabelFields.

\n\n

Default: [\"03\", \"0b40\", \"12\"]

\n\n

Example:

\n\n
sources:\n  pci:\n    deviceClassWhitelist: [\"0200\", \"03\"]\n
\n\n

soures.pci.deviceLabelFields

\n\n

The set of PCI ID fields to use when constructing the name of the feature\nlabel. Valid fields are class, vendor, device, subsystem_vendor and\nsubsystem_device.

\n\n

Default: [class, vendor]

\n\n

Example:

\n\n
sources:\n  pci:\n    deviceLabelFields: [class, vendor, device]\n
\n\n

With the example config above NFD would publish labels like:\nfeature.node.kubernetes.io/pci-<class-id>_<vendor-id>_<device-id>.present=true

\n\n

sources.usb

\n\n

soures.usb.deviceClassWhitelist

\n\n

List of USB device class IDs for\nwhich to publish a feature label. The format of the labels can be further\nconfigured with deviceLabelFields.

\n\n

Default: [\"0e\", \"ef\", \"fe\", \"ff\"]

\n\n

Example:

\n\n
sources:\n  usb:\n    deviceClassWhitelist: [\"ef\", \"ff\"]\n
\n\n

soures.usb.deviceLabelFields

\n\n

The set of USB ID fields from which to compose the name of the feature label.\nValid fields are class, vendor, device and serial.

\n\n

Default: [class, vendor, device]

\n\n

Example:

\n\n
sources:\n  pci:\n    deviceLabelFields: [class, vendor]\n
\n\n

With the example config above NFD would publish labels like:\nfeature.node.kubernetes.io/usb-<class-id>_<vendor-id>.present=true

\n\n

sources.custom

\n\n

List of rules to process in the custom feature source to create user-specific\nlabels. Refer to the documentation of the\ncustom feature source for\ndetails of the available rules and their configuration.

\n\n

Default: empty

\n\n

Example:

\n\n
sources:\n  custom:\n    - name: \"my custom rule\"\n      labels:\n        my-custom-feature: \"true\"\n      matchFeatures:\n        - feature: kernel.loadedmodule\n          matchExpressions:\n            e1000e: {op: Exists}\n        - feature: pci.device\n          matchExpressions:\n            class: {op: In, value: [\"0200\"]}\n            vendor: {op: In, value: [\"8086\"]}\n
\n","dir":"/advanced/","name":"worker-configuration-reference.md","path":"advanced/worker-configuration-reference.md","url":"/advanced/worker-configuration-reference.html"},{"title":"Feature labels","layout":"default","sort":4,"content":"

Feature labels

\n\n

Table of contents

\n\n
    \n
  1. Built-in labels
      \n
    1. CPU
    2. \n
    3. IOMMU (deprecated)
    4. \n
    5. Kernel
    6. \n
    7. Memory
    8. \n
    9. Network
    10. \n
    11. PCI
    12. \n
    13. USB
    14. \n
    15. Storage
    16. \n
    17. System
    18. \n
    19. Custom
    20. \n
    \n
  2. \n
  3. User defined labels
  4. \n
  5. Extended resources
  6. \n
\n\n
\n\n

Features are advertised as labels in the Kubernetes Node object.

\n\n

Built-in labels

\n\n

Label creation in nfd-worker is performed by a set of separate modules called\nlabel sources. The\ncore.labelSources\nconfiguration option (or\n-label-sources\nflag) of nfd-worker controls which sources to enable for label generation.

\n\n

All built-in labels use the feature.node.kubernetes.io label namespace and\nhave the following format.

\n\n
feature.node.kubernetes.io/<feature> = <value>\n
\n\n

Note: Consecutive runs of nfd-worker will update the labels on a\ngiven node. If features are not discovered on a consecutive run, the corresponding\nlabel will be removed. This includes any restrictions placed on the consecutive run,\nsuch as restricting discovered features with the -label-whitelist option.

\n\n

CPU

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Feature nameValueDescription
cpu-cpuid.<cpuid-flag>trueCPU capability is supported. NOTE: the capability might be supported but not enabled.
cpu-hardware_multithreadingtrueHardware multithreading, such as Intel HTT, enabled (number of logical CPUs is greater than physical CPUs)
cpu-power.sst_bf.enabledtrueIntel SST-BF (Intel Speed Select Technology - Base frequency) enabled
cpu-pstate.statusstringThe status of the Intel pstate driver when in use and enabled, either ‘active’ or ‘passive’.
cpu-pstate.turboboolSet to ‘true’ if turbo frequencies are enabled in Intel pstate driver, set to ‘false’ if they have been disabled.
cpu-pstate.scaling_governorstringThe value of the Intel pstate scaling_governor when in use, either ‘powersave’ or ‘performance’.
cpu-cstate.enabledboolSet to ‘true’ if cstates are set in the intel_idle driver, otherwise set to ‘false’. Unset if intel_idle cpuidle driver is not active.
cpu-rdt.<rdt-flag>trueIntel RDT capability is supported. See RDT flags for details.
cpu-sgx.enabledtrueSet to ‘true’ if Intel SGX is enabled in BIOS (based a non-zero sum value of SGX EPC section sizes).
cpu-se.enabledtrueSet to ‘true’ if IBM Secure Execution for Linux (IBM Z & LinuxONE) is available and enabled (requires /sys/firmware/uv/prot_virt_host facility)
cpu-model.vendor_idstringComparable CPU vendor ID.
cpu-model.familyintCPU family.
cpu-model.idintCPU model number.
\n\n

The CPU label source is configurable, see\nworker configuration and\nsources.cpu\nconfiguration options for details.

\n\n

X86 CPUID flags (partial list)

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FlagDescription
ADXMulti-Precision Add-Carry Instruction Extensions (ADX)
AESNIAdvanced Encryption Standard (AES) New Instructions (AES-NI)
AVXAdvanced Vector Extensions (AVX)
AVX2Advanced Vector Extensions 2 (AVX2)
AMXBF16Advanced Matrix Extension, tile multiplication operations on BFLOAT16 numbers
AMXINT8Advanced Matrix Extension, tile multiplication operations on 8-bit integers
AMXTILEAdvanced Matrix Extension, base tile architecture support
AVX512BF16AVX-512 BFLOAT16 instructions
AVX512BITALGAVX-512 bit Algorithms
AVX512BWAVX-512 byte and word Instructions
AVX512CDAVX-512 conflict detection instructions
AVX512DQAVX-512 doubleword and quadword instructions
AVX512ERAVX-512 exponential and reciprocal instructions
AVX512FAVX-512 foundation
AVX512FP16AVX-512 FP16 instructions
AVX512IFMAAVX-512 integer fused multiply-add instructions
AVX512PFAVX-512 prefetch instructions
AVX512VBMIAVX-512 vector bit manipulation instructions
AVX512VBMI2AVX-512 vector bit manipulation instructions, version 2
AVX512VLAVX-512 vector length extensions
AVX512VNNIAVX-512 vector neural network instructions
AVX512VP2INTERSECTAVX-512 intersect for D/Q
AVX512VPOPCNTDQAVX-512 vector population count doubleword and quadword
ENQCMDEnqueue Command
GFNIGalois Field New Instructions
HYPERVISORRunning under hypervisor
VAESAVX-512 vector AES instructions
VPCLMULQDQCarry-less multiplication quadword
\n\n

By default, the following CPUID flags have been blacklisted: BMI1, BMI2, CLMUL,\nCMOV, CX16, ERMS, F16C, HTT, LZCNT, MMX, MMXEXT, NX, POPCNT, RDRAND, RDSEED,\nRDTSCP, SGX, SSE, SSE2, SSE3, SSE4, SSE42 and SSSE3. See\nsources.cpu\nconfiguration options to change the behavior.

\n\n

See the full list in github.com/klauspost/cpuid.

\n\n

Arm CPUID flags (partial list)

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FlagDescription
IDIVAInteger divide instructions available in ARM mode
IDIVTInteger divide instructions available in Thumb mode
THUMBThumb instructions
FASTMULFast multiplication
VFPVector floating point instruction extension (VFP)
VFPv3Vector floating point extension v3
VFPv4Vector floating point extension v4
VFPD32VFP with 32 D-registers
HALFHalf-word loads and stores
EDSPDSP extensions
NEONNEON SIMD instructions
LPAELarge Physical Address Extensions
\n\n

Arm64 CPUID flags (partial list)

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FlagDescription
AESAnnouncing the Advanced Encryption Standard
EVSTRMEvent Stream Frequency Features
FPHPHalf Precision(16bit) Floating Point Data Processing Instructions
ASIMDHPHalf Precision(16bit) Asimd Data Processing Instructions
ATOMICSAtomic Instructions to the A64
ASIMRDMSupport for Rounding Double Multiply Add/Subtract
PMULLOptional Cryptographic and CRC32 Instructions
JSCVTPerform Conversion to Match Javascript
DCPOPPersistent Memory Support
\n\n

Intel RDT flags

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FlagDescription
RDTMONIntel RDT Monitoring Technology
RDTCMTIntel Cache Monitoring (CMT)
RDTMBMIntel Memory Bandwidth Monitoring (MBM)
RDTL3CAIntel L3 Cache Allocation Technology
RDTl2CAIntel L2 Cache Allocation Technology
RDTMBAIntel Memory Bandwidth Allocation (MBA) Technology
\n\n

IOMMU (deprecated)

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureValueDescription
iommu.enabledtrueIOMMU is present and enabled in the kernel
\n\n

DEPRECATED: The iommu source is deprecated and not enabled by default.

\n\n

Kernel

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureValueDescription
kernel-config.<option>trueKernel config option is enabled (set ‘y’ or ‘m’). Default options are NO_HZ, NO_HZ_IDLE, NO_HZ_FULL and PREEMPT
kernel-selinux.enabledtrueSelinux is enabled on the node
kernel-version.fullstringFull kernel version as reported by /proc/sys/kernel/osrelease (e.g. ‘4.5.6-7-g123abcde’)
kernel-version.majorstringFirst component of the kernel version (e.g. ‘4’)
kernel-version.minorstringSecond component of the kernel version (e.g. ‘5’)
kernel-version.revisionstringThird component of the kernel version (e.g. ‘6’)
\n\n

The kernel label source is configurable, see\nworker configuration and\nsources.kernel\nconfiguration options for details.

\n\n

Memory

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureValueDescription
memory-numatrueMultiple memory nodes i.e. NUMA architecture detected
memory-nv.presenttrueNVDIMM device(s) are present
memory-nv.daxtrueNVDIMM region(s) configured in DAX mode are present
\n\n

Network

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureValueDescription
network-sriov.capabletrueSingle Root Input/Output Virtualization (SR-IOV) enabled Network Interface Card(s) present
network-sriov.configuredtrueSR-IOV virtual functions have been configured
\n\n

PCI

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureValueDescription
pci-<device label>.presenttruePCI device is detected
pci-<device label>.sriov.capabletrueSingle Root Input/Output Virtualization (SR-IOV) enabled PCI device present
\n\n

<device label> is format is configurable and set to <class>_<vendor> by\ndefault. For more more details about configuration of the pci labels, see\nsources.pci options\nand worker configuration\ninstructions.

\n\n

USB

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureValueDescription
usb-<device label>.presenttrueUSB device is detected
\n\n

<device label> is format is configurable and set to\n<class>_<vendor>_<device> by default. For more more details about\nconfiguration of the usb labels, see\nsources.usb options\nand worker configuration\ninstructions.

\n\n

Storage

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureValueDescription
storage-nonrotationaldisktrueNon-rotational disk, like SSD, is present in the node
\n\n

System

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureValueDescription
system-os_release.IDstringOperating system identifier
system-os_release.VERSION_IDstringOperating system version identifier (e.g. ‘6.7’)
system-os_release.VERSION_ID.majorstringFirst component of the OS version id (e.g. ‘6’)
system-os_release.VERSION_ID.minorstringSecond component of the OS version id (e.g. ‘7’)
\n\n

Custom

\n\n

The custom label source is designed for creating\nuser defined labels. However, it has a few statically\ndefined built-in labels:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureValueDescription
custom-rdma.capabletrueThe node has an RDMA capable Network adapter
custom-rdma.enabledtrueThe node has the needed RDMA modules loaded to run RDMA traffic
\n\n

User defined labels

\n\n

NFD has many extension points for creating vendor and application specific\nlabels. See the customization guide for\ndetailed documentation.

\n\n

Extended resources

\n\n

This feature is experimental and by no means a replacement for the usage of\ndevice plugins.

\n\n

Labels which have integer values, can be promoted to Kubernetes extended\nresources by listing them to the master -resource-labels command line flag.\nThese labels won’t then show in the node label section, they will appear only\nas extended resources.

\n\n

An example use-case for the extended resources could be based on a hook which\ncreates a label for the node SGX EPC memory section size. By giving the name of\nthat label in the -resource-labels flag, that value will then turn into an\nextended resource of the node, allowing PODs to request that resource and the\nKubernetes scheduler to schedule such PODs to only those nodes which have a\nsufficient capacity of said resource left.

\n\n

Similar to labels, the default namespace feature.node.kubernetes.io is\nautomatically prefixed to the extended resource, if the promoted label doesn’t\nhave a namespace.

\n\n

Example usage of the command line arguments, using a new namespace:\nnfd-master -resource-labels=my_source-my.feature,sgx.some.ns/epc -extra-label-ns=sgx.some.ns

\n\n

The above would result in following extended resources provided that related\nlabels exist:

\n\n
  sgx.some.ns/epc: <label value>\n  feature.node.kubernetes.io/my_source-my.feature: <label value>\n
\n\n\n","dir":"/get-started/","name":"features.md","path":"get-started/features.md","url":"/get-started/features.html"},{"title":"Examples and demos","layout":"default","sort":5,"content":"

Examples and demos

\n\n

Table of contents

\n\n
    \n
  1. Demos
      \n
    1. Usage demo
    2. \n
    3. Demo use case
    4. \n
    \n
  2. \n
\n\n
\n\n

This page contains usage examples and demos.

\n\n

Demos

\n\n

Usage demo

\n\n

\"asciicast\"

\n\n

Demo use case

\n\n

A demo on the benefits of using node feature discovery can be found in the\nsource code repository under\ndemo/.

\n","dir":"/get-started/","name":"examples-and-demos.md","path":"get-started/examples-and-demos.md","url":"/get-started/examples-and-demos.html"},{"title":"Topology Updater Cmdline Reference","layout":"default","sort":5,"content":"

NFD-Topology-Updater Commandline Flags

\n\n

Table of Contents

\n\n
    \n
  1. NFD-Topology-Updater Commandline Flags
      \n
    1. -h, -help
    2. \n
    3. -version
    4. \n
    5. -server
    6. \n
    7. -ca-file
    8. \n
    9. -cert-file
    10. \n
    11. -key-file
    12. \n
    13. -server-name-override
    14. \n
    15. -no-publish
    16. \n
    17. -oneshot
    18. \n
    19. -sleep-interval
    20. \n
    21. -watch-namespace
    22. \n
    23. -kubelet-config-file
    24. \n
    25. -podresources-socket
    26. \n
    \n
  2. \n
\n\n
\n\n

To quickly view available command line flags execute nfd-topology-updater -help.\nIn a docker container:

\n\n
docker run gcr.io/k8s-staging-nfd/node-feature-discovery:master nfd-topology-updater -help\n
\n\n

-h, -help

\n\n

Print usage and exit.

\n\n

-version

\n\n

Print version and exit.

\n\n

-server

\n\n

The -server flag specifies the address of the nfd-master endpoint where to\nconnect to.

\n\n

Default: localhost:8080

\n\n

Example:

\n\n
nfd-topology-updater -server=nfd-master.nfd.svc.cluster.local:443\n
\n\n

-ca-file

\n\n

The -ca-file is one of the three flags (together with -cert-file and\n-key-file) controlling the mutual TLS authentication on the topology-updater side.\nThis flag specifies the TLS root certificate that is used for verifying the\nauthenticity of nfd-master.

\n\n

Default: empty

\n\n

Note: Must be specified together with -cert-file and -key-file

\n\n

Example:

\n\n
nfd-topology-updater -ca-file=/opt/nfd/ca.crt -cert-file=/opt/nfd/updater.crt -key-file=/opt/nfd/updater.key\n
\n\n

-cert-file

\n\n

The -cert-file is one of the three flags (together with -ca-file and\n-key-file) controlling mutual TLS authentication on the topology-updater\nside. This flag specifies the TLS certificate presented for authenticating\noutgoing requests.

\n\n

Default: empty

\n\n

Note: Must be specified together with -ca-file and -key-file

\n\n

Example:

\n\n
nfd-topology-updater -cert-file=/opt/nfd/updater.crt -key-file=/opt/nfd/updater.key -ca-file=/opt/nfd/ca.crt\n
\n\n

-key-file

\n\n

The -key-file is one of the three flags (together with -ca-file and\n-cert-file) controlling the mutual TLS authentication on topology-updater\nside. This flag specifies the private key corresponding the given certificate file\n(-cert-file) that is used for authenticating outgoing requests.

\n\n

Default: empty

\n\n

Note: Must be specified together with -cert-file and -ca-file

\n\n

Example:

\n\n
nfd-topology-updater -key-file=/opt/nfd/updater.key -cert-file=/opt/nfd/updater.crt -ca-file=/opt/nfd/ca.crt\n
\n\n

-server-name-override

\n\n

The -server-name-override flag specifies the common name (CN) which to\nexpect from the nfd-master TLS certificate. This flag is mostly intended for\ndevelopment and debugging purposes.

\n\n

Default: empty

\n\n

Example:

\n\n
nfd-topology-updater -server-name-override=localhost\n
\n\n

-no-publish

\n\n

The -no-publish flag disables all communication with the nfd-master, making\nit a “dry-run” flag for nfd-topology-updater. NFD-Topology-Updater runs\nresource hardware topology detection normally, but no CR requests are sent to\nnfd-master.

\n\n

Default: false

\n\n

Example:

\n\n
nfd-topology-updater -no-publish\n
\n\n

-oneshot

\n\n

The -oneshot flag causes nfd-topology-updater to exit after one pass of\nresource hardware topology detection.

\n\n

Default: false

\n\n

Example:

\n\n
nfd-topology-updater -oneshot -no-publish\n
\n\n

-sleep-interval

\n\n

The -sleep-interval specifies the interval between resource hardware\ntopology re-examination (and CR updates). A non-positive value implies\ninfinite sleep interval, i.e. no re-detection is done.

\n\n

Default: 60s

\n\n

Example:

\n\n
nfd-topology-updater -sleep-interval=1h\n
\n\n

-watch-namespace

\n\n

The -watch-namespace specifies the namespace to ensure that resource\nhardware topology examination only happens for the pods running in the\nspecified namespace. Pods that are not running in the specified namespace\nare not considered during resource accounting. This is particularly useful\nfor testing/debugging purpose. A “*” value would mean that all the pods would\nbe considered during the accounting process.

\n\n

Default: “*”

\n\n

Example:

\n\n
nfd-topology-updater -watch-namespace=rte\n
\n\n

-kubelet-config-file

\n\n

The -kubelet-config-file specifies the path to the Kubelet’s configuration\nfile.

\n\n

Default: /host-var/lib/kubelet/config.yaml

\n\n

Example:

\n\n
nfd-topology-updater -kubelet-config-file=/var/lib/kubelet/config.yaml\n
\n\n

-podresources-socket

\n\n

The -podresources-socket specifies the path to the Unix socket where kubelet\nexports a gRPC service to enable discovery of in-use CPUs and devices, and to\nprovide metadata for them.

\n\n

Default: /host-var/lib/kubelet/pod-resources/kubelet.sock

\n\n

Example:

\n\n
nfd-topology-updater -podresources-socket=/var/lib/kubelet/pod-resources/kubelet.sock\n
\n","dir":"/advanced/","name":"topology-updater-commandline-reference.md","path":"advanced/topology-updater-commandline-reference.md","url":"/advanced/topology-updater-commandline-reference.html"},{"title":"Customization guide","layout":"default","sort":5,"content":"

Customization guide

\n\n

Table of contents

\n\n
    \n
  1. Overview
  2. \n
  3. NodeFeatureRule custom resource
      \n
    1. A NodeFeatureRule example
    2. \n
    3. NodeFeatureRule controller
    4. \n
    \n
  4. \n
  5. Local feature source
      \n
    1. A hook example
    2. \n
    3. Hooks
    4. \n
    5. Feature files
    6. \n
    7. Input format
    8. \n
    9. Mounts
    10. \n
    \n
  6. \n
  7. Custom feature source
      \n
    1. An example custom feature source configuration
    2. \n
    3. Additional configuration directory
    4. \n
    \n
  8. \n
  9. Node labels
  10. \n
  11. Label rule format
      \n
    1. Fields
    2. \n
    3. Available features
    4. \n
    5. Templating
    6. \n
    7. Backreferences
    8. \n
    9. Examples
    10. \n
    \n
  12. \n
  13. Legacy custom rule syntax
      \n
    1. General nomenclature and definitions
    2. \n
    3. Custom features format (using the nomenclature defined above)
    4. \n
    5. Matching process
    6. \n
    7. Rules
    8. \n
    9. Legacy custom rule example
    10. \n
    \n
  14. \n
\n\n
\n\n

Overview

\n\n

NFD provides multiple extension points for vendor and application specific\nlabeling:

\n\n\n\n

NodeFeatureRule custom resource

\n\n

NodeFeatureRule objects provide an easy way to create vendor or application\nspecific labels. It uses a flexible rule-based mechanism for creating labels\nbased on node feature.

\n\n

A NodeFeatureRule example

\n\n

Consider the following referential example:

\n\n
apiVersion: nfd.k8s-sigs.io/v1alpha1\nkind: NodeFeatureRule\nmetadata:\n  name: my-sample-rule-object\nspec:\n  rules:\n    - name: \"my sample rule\"\n      labels:\n        \"my-sample-feature\": \"true\"\n      matchFeatures:\n        - feature: kernel.loadedmodule\n          matchExpressions:\n            dummy: {op: Exists}\n        - feature: kernel.config\n          matchExpressions:\n            X86: {op: In, value: [\"y\"]}\n
\n\n

It specifies one rule which creates node label\nfeature.node.kubenernetes.io/my-sample-feature=true if both of the following\nconditions are true (matchFeatures implements a logical AND over the\nmatchers):

\n\n\n\n

Create a NodeFeatureRule with a yaml file:

\n\n
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/node-feature-discovery/v0.11.1/examples/nodefeaturerule.yaml\n
\n\n

Now, on X86 platforms the feature label appears after doing modprobe dummy on\na system and correspondingly the label is removed after rmmod dummy. Note a\nre-labeling delay up to the sleep-interval of nfd-worker (1 minute by default).

\n\n

NodeFeatureRule controller

\n\n

NFD-Master acts as the controller for NodeFeatureRule objects. It applies these\nrules on raw feature data received from nfd-worker instances and creates node\nlabels, accordingly.

\n\n

NOTE nfd-master is stateless and (re-)labelling only happens when a request\nis received from nfd-worker. That is, in practice rules are evaluated and\nlabels for each node are created on intervals specified by the\ncore.sleepInterval\nconfiguration option (or\n-sleep-interval command line\nflag) of nfd-worker instances. This means that modification or creation of\nNodeFeatureRule objects does not instantly cause the node labels to be updated.\nInstead, the changes only come visible in node labels as nfd-worker instances\nsend their labelling requests.

\n\n

Local feature source

\n\n

NFD-Worker has a special feature source named local which is an integration\npoint for external feature detectors. It provides a mechanism for pluggable\nextensions, allowing the creation of new user-specific features and even\noverriding built-in labels.

\n\n

The local feature source has two methods for detecting features, hooks and\nfeature files. The features discovered by the local source can further be\nused in label rules specified in\nNodeFeatureRule objects and the\ncustom feature source.

\n\n

NOTE: Be careful when creating and/or updating hook or feature files while\nNFD is running. In order to avoid race conditions you should write into a\ntemporary file (outside the source.d and features.d directories), and,\natomically create/update the original file by doing a filesystem move\noperation.

\n\n

A hook example

\n\n

Consider a shell script\n/etc/kubernetes/node-feature-discovery/source.d/my-hook.sh having the\nfollowing stdout output, or alternatively, a plaintext file\n/etc/kubernetes/node-feature-discovery/features.d/my-features having the\nfollowing contents:

\n\n
my-feature.1\nmy-feature.2=myvalue\nmy.namespace/my-feature.3=456\n
\n\n

This will translate into the following node labels:

\n\n
feature.node.kubernetes.io/my-feature.1: \"true\"\nfeature.node.kubernetes.io/my-feature.2: \"myvalue\"\nmy.namespace/my-feature.3: \"456\"\n
\n\n

Note that in the example above -extra-label-ns=my.namespace must be specified\non the nfd-master command line.

\n\n

Hooks

\n\n

The local source executes hooks found in\n/etc/kubernetes/node-feature-discovery/source.d/. The hook files must be\nexecutable and they are supposed to print all discovered features in stdout.\nWith ELF binaries static linking is recommended as the selection of system\nlibraries available in the NFD release image is very limited. Other runtimes\ncurrently supported by the NFD image are bash and perl.

\n\n

stderr output of hooks is propagated to NFD log so it can be used for\ndebugging and logging.

\n\n

NFD tries to execute any regular files found from the hooks directory.\nAny additional data files the hook might need (e.g. a configuration file)\nshould be placed in a separate directory in order to avoid NFD unnecessarily\ntrying to execute them. A subdirectory under the hooks directory can be used,\nfor example /etc/kubernetes/node-feature-discovery/source.d/conf/.

\n\n

NOTE: NFD will blindly run any executables placed/mounted in the hooks\ndirectory. It is the user’s responsibility to review the hooks for e.g.\npossible security implications.

\n\n

NOTE: The minimal image\nvariant only supports running statically linked binaries.

\n\n

Feature files

\n\n

The local source reads files found in\n/etc/kubernetes/node-feature-discovery/features.d/.

\n\n

Input format

\n\n

The hook stdout and feature files are expected to contain features in simple\nkey-value pairs, separated by newlines:

\n\n
<name>[=<value>]\n
\n\n

The label value defaults to true, if not specified.

\n\n

Label namespace may be specified with <namespace>/<name>[=<value>]. The\nnamespace must be explicitly allowed with the -extra-label-ns command line\nflag of nfd-master if using something else than\n[<sub-ns>.]feature.node.kubernetes.io or\n[<sub-ns>.]profile.node.kubernetes.io.

\n\n

Mounts

\n\n

The standard NFD deployments contain hostPath mounts for\n/etc/kubernetes/node-feature-discovery/source.d/ and\n/etc/kubernetes/node-feature-discovery/features.d/, making these directories\nfrom the host available inside the nfd-worker container.

\n\n

Injecting labels from other pods

\n\n

One use case for the hooks and/or feature files is detecting features in other\nPods outside NFD, e.g. in Kubernetes device plugins. By using the same\nhostPath mounts for /etc/kubernetes/node-feature-discovery/source.d/ and\n/etc/kubernetes/node-feature-discovery/features.d/ in the side-car (e.g.\ndevice plugin) creates a shared area for deploying hooks and feature files to\nNFD. NFD will periodically scan the directories and run any hooks and read any\nfeature files it finds.

\n\n

Custom feature source

\n\n

The custom feature source in nfd-worker provides a rule-based mechanism for\nlabel creation, similar to the\nNodeFeatureRule objects. The difference is\nthat the rules are specified in the worker configuration instead of a\nKubernetes API object.

\n\n

See worker configuration\nfor instructions how to set-up and manage the worker configuration.

\n\n

An example custom feature source configuration

\n\n

Consider the following referential configuration for nfd-worker:

\n\n
core:\n  labelSources: [\"custom\"]\nsources:\n  custom:\n    - name: \"my sample rule\"\n      labels:\n        \"my-sample-feature\": \"true\"\n      matchFeatures:\n        - feature: kernel.loadedmodule\n          matchExpressions:\n            dummy: {op: Exists}\n        - feature: kernel.config\n          matchExpressions:\n            X86: {op: In, value: [\"y\"]}\n
\n\n

It specifies one rule which creates node label\nfeature.node.kubenernetes.io/my-sample-feature=true if both of the following\nconditions are true (matchFeatures implements a logical AND over the\nmatchers):

\n\n\n\n

In addition, the configuration only enables the custom source, disabling all\nbuilt-in labels.

\n\n

Now, on X86 platforms the feature label appears after doing modprobe dummy on\na system and correspondingly the label is removed after rmmod dummy. Note a\nre-labeling delay up to the sleep-interval of nfd-worker (1 minute by default).

\n\n

Additional configuration directory

\n\n

In addition to the rules defined in the nfd-worker configuration file, the\ncustom feature source can read more configuration files located in the\n/etc/kubernetes/node-feature-discovery/custom.d/ directory. This makes more\ndynamic and flexible configuration easier.

\n\n

As an example, consider having file\n/etc/kubernetes/node-feature-discovery/custom.d/my-rule.yaml with the\nfollowing content:

\n\n
- name: \"my e1000 rule\"\n  labels:\n    \"e1000.present\": \"true\"\n  matchFeatures:\n    - feature: kernel.loadedmodule\n      matchExpressions:\n        e1000: {op: Exists}\n
\n\n

This simple rule will create feature.node.kubenernetes.io/e1000.present=true\nlabel if the e1000 kernel module has been loaded.

\n\n

The\nsamples/custom-rules\nkustomize overlay sample contains an example for deploying a custom rule from a\nConfigMap.

\n\n

Node labels

\n\n

Feature labels have the following format:

\n\n
<namespace>/<name> = <value>\n
\n\n

The namespace part (i.e. prefix) of the labels is controlled by nfd:

\n\n\n\n

Label rule format

\n\n

This section describes the rule format used in\nNodeFeatureRule objects and in the\nconfiguration of the custom feature source.

\n\n

It is based on a generic feature matcher that covers all features discovered by\nnfd-worker. The rules rely on a unified data model of the available features\nand a generic expression-based format. Features that can be used in the rules\nare described in detail in available features below.

\n\n

Take this rule as a referential example:

\n\n
    - name: \"my feature rule\"\n      labels:\n        \"my-special-feature\": \"my-value\"\n      matchFeatures:\n        - feature: cpu.cpuid\n          matchExpressions:\n            AVX512F: {op: Exists}\n        - feature: kernel.version\n          matchExpressions:\n            major: {op: In, value: [\"5\"]}\n            minor: {op: Gt, value: [\"1\"]}\n        - feature: pci.device\n          matchExpressions:\n            vendor: {op: In, value: [\"8086\"]}\n            class: {op: In, value: [\"0200\"]}\n
\n\n

This will yield feature.node.kubenernetes.io/my-special-feature=my-value node\nlabel if all of these are true (matchFeatures implements a logical AND over\nthe matchers):

\n\n\n\n

Fields

\n\n

Name

\n\n

The .name field is required and used as an identifier of the rule.

\n\n

Labels

\n\n

The .labels is a map of the node labels to create if the rule matches.

\n\n

Labels template

\n\n

The .labelsTemplate field specifies a text template for dynamically creating\nlabels based on the matched features. See templating for\ndetails.

\n\n

NOTE The labels field has priority over labelsTemplate, i.e.\nlabels specified in the labels field will override anything\noriginating from labelsTemplate.

\n\n

Vars

\n\n

The .vars field is a map of values (key-value pairs) to store for subsequent\nrules to use. In other words, these are variables that are not advertised as\nnode labels. See backreferences for more details on the\nusage of vars.

\n\n

Vars template

\n\n

The .varsTemplate field specifies a text template for dynamically creating\nvars based on the matched features. See templating for details\non using templates and backreferences for more details on\nthe usage of vars.

\n\n

NOTE The vars field has priority over varsTemplate, i.e.\nvars specified in the vars field will override anything originating from\nvarsTemplate.

\n\n

MatchFeatures

\n\n

The .matchFeatures field specifies a feature matcher, consisting of a list of\nfeature matcher terms. It implements a logical AND over the terms i.e. all\nof them must match in order for the rule to trigger.

\n\n
      matchFeatures:\n        - feature: <feature-name>\n          matchExpressions:\n            <key>:\n              op: <op>\n              value:\n                - <value-1>\n                - ...\n
\n\n

The .matchFeatures[].feature field specifies the feature against which to\nmatch.

\n\n

The .matchFeatures[].matchExpressions field specifies a map of expressions\nwhich to evaluate against the elements of the feature.

\n\n

In each MatchExpression op specifies the operator to apply. Valid values are\ndescribed below.

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
OperatorNumber of valuesMatches when
In1 or greaterInput is equal to one of the values
NotIn1 or greaterInput is not equal to any of the values
InRegexp1 or greaterValues of the MatchExpression are treated as regexps and input matches one or more of them
Exists0The key exists
DoesNotExist0The key does not exists
Gt1Input is greater than the value. Both the input and value must be integer numbers.
Lt1Input is less than the value. Both the input and value must be integer numbers.
GtLt2Input is between two values. Both the input and value must be integer numbers.
IsTrue0Input is equal to “true”
IsFalse0Input is equal “false”
\n\n

The value field of MatchExpression is a list of string arguments to the\noperator.

\n\n

The behavior of MatchExpression depends on the feature type:\nfor flag and attribute features the MatchExpression operates on the feature\nelement whose name matches the <key>. However, for instance features all\nMatchExpressions are evaluated against the attributes of each instance\nseparately.

\n\n

MatchAny

\n\n

The .matchAny field is a list of of matchFeatures\nmatchers. A logical OR is applied over the matchers, i.e. at least one of them\nmust match in order for the rule to trigger.

\n\n

Consider the following example:

\n\n
      matchAny:\n        - matchFeatures:\n            - feature: kernel.loadedmodule\n              matchExpressions:\n                kmod-1: {op: Exists}\n            - feature: pci.device\n              matchExpressions:\n                vendor: {op: In, value: [\"0eee\"]}\n                class: {op: In, value: [\"0200\"]}\n        - matchFeatures:\n            - feature: kernel.loadedmodule\n              matchExpressions:\n                kmod-2: {op: Exists}\n            - feature: pci.device\n              matchExpressions:\n                vendor: {op: In, value: [\"0fff\"]}\n                class: {op: In, value: [\"0200\"]}\n
\n\n

This matches if kernel module kmod-1 is loaded and a network controller from\nvendor 0eee is present, OR, if kernel module kmod-2 has been loaded and a\nnetwork controller from vendor 0fff is present (OR both of these conditions are\ntrue).

\n\n

Available features

\n\n

Feature types

\n\n

Features are divided into three different types:

\n\n\n\n

List of features

\n\n

The following features are available for matching:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureFeature typeElementsValue typeDescription
cpu.cpuidflag  Supported CPU capabilities
  <cpuid-flag> CPUID flag is present
cpu.cstateattribute  Status of cstates in the intel_idle cpuidle driver
  enabledbool‘true’ if cstates are set, otherwise ‘false’. Does not exist of intel_idle driver is not active.
cpu.modelattribute  CPU model related attributes
  familyintCPU family
  vendor_idstringCPU vendor ID
  idintCPU model ID
cpu.pstateattribute  State of the Intel pstate driver. Does not exist if the driver is not enabled.
  statusstringStatus of the driver, possible values are ‘active’ and ‘passive’
  turbobool‘true’ if turbo frequencies are enabled, otherwise ‘false’
  scalingstringActive scaling_governor, possible values are ‘powersave’ or ‘performance’.
cpu.rdtflag  Intel RDT capabilities supported by the system
  <rdt-flag> RDT capability is supported, see RDT flags for details
cpu.sgxattribute  Intel SGX (Software Guard Extensions) capabilities
  enabledbooltrue if Intel SGX has been enabled, otherwise does not exist
cpu.sstattribute  Intel SST (Speed Select Technology) capabilities
  bf.enabledbooltrue if Intel SST-BF (Intel Speed Select Technology - Base frequency) has been enabled, otherwise does not exist
cpu.seattribute  IBM Secure Execution for Linux (IBM Z & LinuxONE)
  enabledbooltrue if IBM Secure Execution for Linux is available and has been enabled, otherwise does not exist
cpu.topologyattribute  CPU topology related features
  hardware_multithreadingboolHardware multithreading, such as Intel HTT, is enabled
kernel.configattribute  Kernel configuration options
  <config-flag>stringValue of the kconfig option
kernel.loadedmoduleflag  Loaded kernel modules
  mod-name Kernel module <mod-name> is loaded
kernel.selinuxattribute  Kernel SELinux related features
  enabledbooltrue if SELinux has been enabled and is in enforcing mode, otherwise false
kernel.versionattribute  Kernel version information
  fullstringFull kernel version (e.g. ‘4.5.6-7-g123abcde’)
  majorintFirst component of the kernel version (e.g. ‘4’)
  minorintSecond component of the kernel version (e.g. ‘5’)
  revisionintThird component of the kernel version (e.g. ‘6’)
local.labelattribute  Features from hooks and feature files, i.e. labels from the local feature source
  <label-name>stringLabel <label-name> created by the local feature source, value equals the value of the label
memory.nvinstance  NVDIMM devices present in the system
  <sysfs-attribute>stringValue of the sysfs device attribute, available attributes: devtype, mode
memory.numaattribute  NUMA nodes
  is_numabooltrue if NUMA architecture, false otherwise
  node_countintNumber of NUMA nodes
network.deviceinstance  Physical (non-virtual) network interfaces present in the system
  namestringName of the network interface
  <sysfs-attribute>stringSysfs network interface attribute, available attributes: operstate, speed, sriov_numvfs, sriov_totalvfs
pci.deviceinstance  PCI devices present in the system
  <sysfs-attribute>stringValue of the sysfs device attribute, available attributes: class, vendor, device, subsystem_vendor, subsystem_device, sriov_totalvfs, iommu_group/type, iommu/intel-iommu/version
storage.deviceinstance  Block storage devices present in the system
  namestringName of the block device
  <sysfs-attribute>stringSysfs network interface attribute, available attributes: dax, rotational, nr_zones, zoned
system.osreleaseattribute  System identification data from /etc/os-release
  <parameter>stringOne parameter from /etc/os-release
system.nameattribute  System name information
  nodenamestringName of the kubernetes node object
usb.deviceinstance  USB devices present in the system
  <sysfs-attribute>stringValue of the sysfs device attribute, available attributes: class, vendor, device, serial
rule.matchedattribute  Previously matched rules
  <label-or-var>stringLabel or var from a preceding rule that matched
\n\n

Templating

\n\n

Rules support template-based creation of labels and vars with the\n.labelsTemplate and .varsTemplate fields. These makes it possible to\ndynamically generate labels and vars based on the features that matched.

\n\n

The template must expand into a simple format with <key>=<value> pairs\nseparated by newline.

\n\n

Consider the following example:\n

\n\n
    labelsTemplate: |\n      {{ range .pci.device }}vendor-{{ .class }}-{{ .device }}.present=true\n      {{ end }}\n    matchFeatures:\n      - feature: pci.device\n        matchExpressions:\n          class: {op: InRegexp, value: [\"^02\"]}\n          vendor: [\"0fff\"]\n
\n\n\n

The rule above will create individual labels\nfeature.node.kubernetes.io/vendor-<class-id>-<device-id>.present=true for\neach network controller device (device class starting with 02) from vendor\n0ffff.

\n\n

All the matched features of each feature matcher term under matchFeatures\nfields are available for the template engine. Matched features can be\nreferenced with {{ .<feature-name> }} in the template, and\nthe available data could be described in yaml as follows:

\n\n
.\n  <key-feature>:\n    - Name: <matched-key>\n    - ...\n\n  <value-feature>:\n    - Name: <matched-key>\n      Value: <matched-value>\n    - ...\n\n  <instance-feature>:\n    - <attribute-1-name>: <attribute-1-value>\n      <attribute-2-name>: <attribute-2-value>\n      ...\n    - ...\n
\n\n

That is, the per-feature data is a list of objects whose data fields depend on\nthe type of the feature:

\n\n\n\n

A simple example of a template utilizing name and value from an attribute\nfeature:\n

\n\n
    labelsTemplate: |\n      {{ range .system.osrelease }}system-{{ .Name }}={{ .Value }}\n      {{ end }}\n    matchFeatures:\n      - feature: system.osRelease\n        matchExpressions:\n          ID: {op: Exists}\n          VERSION_ID.major: {op: Exists}\n
\n\n\n

NOTE In case of matchAny is specified, the template is executed separately\nagainst each individual matchFeatures field and the final set of labels will\nbe superset of all these separate template expansions. E.g. consider the\nfollowing:

\n\n
  - name: <name>\n    labelsTemplate: <template>\n    matchFeatures: <matcher#1>\n    matchAny:\n      - matchFeatures: <matcher#2>\n      - matchFeatures: <matcher#3>\n
\n\n

In the example above (assuming the overall result is a match) the template\nwould be executed on matcher#1 as well as on matcher#2 and/or matcher#3\n(depending on whether both or only one of them match). All the labels from\nthese separate expansions would be created, i.e. the end result would be a\nunion of all the individual expansions.

\n\n

Rule templates use the Golang text/template\npackage and all its built-in functionality (e.g. pipelines and functions) can\nbe used. An example template taking use of the built-in len function,\nadvertising the number of PCI network controllers from a specific vendor:\n

\n\n
    labelsTemplate: |\n      num-intel-network-controllers={{ .pci.device | len }}\n    matchFeatures:\n      - feature: pci.device\n        matchExpressions:\n          vendor: {op: In, value: [\"8086\"]}\n          class: {op: In, value: [\"0200\"]}\n\n
\n\n\n

Imaginative template pipelines are possible, but care must be taken in order to\nproduce understandable and maintainable rule sets.

\n\n

Backreferences

\n\n

Rules support referencing the output of preceding rules. This enables\nsophisticated scenarios where multiple rules are combined together\nto for more complex heuristics than a single rule can provide. The labels and\nvars created by the execution of preceding rules are available as a special\nrule.matched feature.

\n\n

Consider the following configuration:

\n\n
  - name: \"my kernel label rule\"\n    labels:\n      kernel-feature: \"true\"\n    matchFeatures:\n      - feature: kernel.version\n        matchExpressions:\n          major: {op: Gt, value: [\"4\"]}\n\n  - name: \"my var rule\"\n    vars:\n      nolabel-feature: \"true\"\n    matchFeatures:\n      - feature: cpu.cpuid\n        matchExpressions:\n          AVX512F: {op: Exists}\n      - feature: pci.device\n        matchExpressions:\n          vendor: {op: In, value: [\"0fff\"]}\n          device: {op: In, value: [\"1234\", \"1235\"]}\n\n  - name: \"my high level feature rule\"\n    labels:\n      high-level-feature: \"true\"\n    matchFeatures:\n      - feature: rule.matched\n        matchExpressions:\n          kernel-feature: {op: IsTrue}\n          nolabel-feature: {op: IsTrue}\n
\n\n

The feature.node.kubernetes.io/high-level-feature = true label depends on thw\ntwo previous rules.

\n\n

Note that when referencing rules across multiple\nNodeFeatureRule objects attention must be\npaid to the ordering. NodeFeatureRule objects are processed in alphabetical\norder (based on their .metadata.name).

\n\n

Examples

\n\n

Some more configuration examples below.

\n\n

Match certain CPUID features:

\n\n
  - name: \"example cpuid rule\"\n    labels:\n      my-special-cpu-feature: \"true\"\n    matchFeatures:\n      - feature: cpu.cpuid\n        matchExpressions:\n          AESNI: {op: Exists}\n          AVX: {op: Exists}\n
\n\n

Require a certain loaded kernel module and OS version:

\n\n
  - name: \"my multi-feature rule\"\n    labels:\n      my-special-multi-feature: \"true\"\n    matchFeatures:\n      - feature: kernel.loadedmodule\n        matchExpressions:\n          e1000: {op: Exists}\n      - feature: system.osrelease\n        matchExpressions:\n          NAME: {op: InRegexp, values: [\"^openSUSE\"]}\n          VERSION_ID.major: {op: Gt, values: [\"14\"]}\n
\n\n

Require a loaded kernel module and two specific PCI devices (both of which\nmust be present):

\n\n
  - name: \"my multi-device rule\"\n    labels:\n      my-multi-device-feature: \"true\"\n    matchFeatures:\n      - feature: kernel.loadedmodule\n        matchExpressions:\n          my-driver-module: {op: Exists}\n      - pci.device:\n          vendor: \"0fff\"\n          device: \"1234\"\n      - pci.device:\n          vendor: \"0fff\"\n          device: \"abcd\"\n
\n\n

Legacy custom rule syntax

\n\n

DEPRECATED: use the new rule syntax instead.

\n\n

The custom source supports the legacy matchOn rule syntax for\nbackwards-compatibility.

\n\n

To aid in making the legacy rule syntax clearer, we define a general and a per\nrule nomenclature, keeping things as consistent as possible.

\n\n

General nomenclature and definitions

\n\n
Rule        :Represents a matching logic that is used to match on a feature.\nRule Input  :The input a Rule is provided. This determines how a Rule performs the match operation.\nMatcher     :A composition of Rules, each Matcher may be composed of at most one instance of each Rule.\n
\n\n

Custom features format (using the nomenclature defined above)

\n\n

Rules are specified under sources.custom in the nfd-worker configuration\nfile.

\n\n
sources:\n  custom:\n  - name: <feature name>\n    value: <optional feature value, defaults to \"true\">\n    matchOn:\n    - <Rule-1>: <Rule-1 Input>\n      [<Rule-2>: <Rule-2 Input>]\n    - <Matcher-2>\n    - ...\n    - ...\n    - <Matcher-N>\n  - <custom feature 2>\n  - ...\n  - ...\n  - <custom feature M>\n
\n\n

The label is constructed by adding custom- prefix to the name field, label\nvalue defaults to true if not specified in the rule spec:

\n\n
feature.node.kubernetes.io/custom-<name> = <value>\n
\n\n

Matching process

\n\n

Specifying Rules to match on a feature is done by providing a list of Matchers.\nEach Matcher contains one or more Rules.

\n\n

Logical OR is performed between Matchers and logical AND is performed\nbetween Rules of a given Matcher.

\n\n

Rules

\n\n

pciid rule

\n\n
Nomenclature
\n\n
Attribute   :A PCI attribute.\nElement     :An identifier of the PCI attribute.\n
\n\n

The PciId Rule allows matching the PCI devices in the system on the following\nAttributes: class,vendor and device. A list of Elements is provided for\neach Attribute.

\n\n
Format
\n\n
pciId :\n  class: [<class id>, ...]\n  vendor: [<vendor id>,  ...]\n  device: [<device id>, ...]\n
\n\n

Matching is done by performing a logical OR between Elements of an Attribute\nand logical AND between the specified Attributes for each PCI device in the\nsystem. At least one Attribute must be specified. Missing attributes will not\npartake in the matching process.

\n\n

UsbId rule

\n\n
Nomenclature
\n\n
Attribute   :A USB attribute.\nElement     :An identifier of the USB attribute.\n
\n\n

The UsbId Rule allows matching the USB devices in the system on the following\nAttributes: class,vendor, device and serial. A list of Elements is\nprovided for each Attribute.

\n\n
Format
\n\n
usbId :\n  class: [<class id>, ...]\n  vendor: [<vendor id>,  ...]\n  device: [<device id>, ...]\n  serial: [<serial>, ...]\n
\n\n

Matching is done by performing a logical OR between Elements of an Attribute\nand logical AND between the specified Attributes for each USB device in the\nsystem. At least one Attribute must be specified. Missing attributes will not\npartake in the matching process.

\n\n

LoadedKMod rule

\n\n
Nomenclature
\n\n
Element     :A kernel module\n
\n\n

The LoadedKMod Rule allows matching the loaded kernel modules in the system\nagainst a provided list of Elements.

\n\n
Format
\n\n
loadedKMod : [<kernel module>, ...]\n
\n\n

Matching is done by performing logical AND for each provided Element, i.e\nthe Rule will match if all provided Elements (kernel modules) are loaded in the\nsystem.

\n\n

CpuId rule

\n\n
Nomenclature
\n\n
Element     :A CPUID flag\n
\n\n

The Rule allows matching the available CPUID flags in the system against a\nprovided list of Elements.

\n\n
Format
\n\n
cpuId : [<CPUID flag string>, ...]\n
\n\n

Matching is done by performing logical AND for each provided Element, i.e the\nRule will match if all provided Elements (CPUID flag strings) are available in\nthe system.

\n\n

Kconfig rule

\n\n
Nomenclature
\n\n
Element     :A Kconfig option\n
\n\n

The Rule allows matching the kconfig options in the system against a provided\nlist of Elements.

\n\n
Format
\n\n
kConfig: [<kernel config option ('y' or 'm') or '=<value>'>, ...]\n
\n\n

Matching is done by performing logical AND for each provided Element, i.e the\nRule will match if all provided Elements (kernel config options) are enabled\n(y or m) or matching =<value> in the kernel.

\n\n

Nodename rule

\n\n
Nomenclature
\n\n
Element     :A nodename regexp pattern\n
\n\n

The Rule allows matching the node’s name against a provided list of Elements.

\n\n
Format
\n\n
nodename: [ <nodename regexp pattern>, ... ]\n
\n\n

Matching is done by performing logical OR for each provided Element, i.e the\nRule will match if one of the provided Elements (nodename regexp pattern)\nmatches the node’s name.

\n\n

Legacy custom rule example

\n\n
custom:\n  - name: \"my.kernel.feature\"\n    matchOn:\n      - loadedKMod: [\"kmod1\", \"kmod2\"]\n  - name: \"my.pci.feature\"\n    matchOn:\n      - pciId:\n          vendor: [\"15b3\"]\n          device: [\"1014\", \"1017\"]\n  - name: \"my.usb.feature\"\n    matchOn:\n      - usbId:\n          vendor: [\"1d6b\"]\n          device: [\"0003\"]\n          serial: [\"090129a\"]\n  - name: \"my.combined.feature\"\n    matchOn:\n      - loadedKMod : [\"vendor_kmod1\", \"vendor_kmod2\"]\n        pciId:\n          vendor: [\"15b3\"]\n          device: [\"1014\", \"1017\"]\n  - name: \"vendor.feature.node.kubernetes.io/accumulated.feature\"\n    matchOn:\n      - loadedKMod : [\"some_kmod1\", \"some_kmod2\"]\n      - pciId:\n          vendor: [\"15b3\"]\n          device: [\"1014\", \"1017\"]\n  - name: \"my.kernel.featureneedscpu\"\n    matchOn:\n      - kConfig: [\"KVM_INTEL\"]\n      - cpuId: [\"VMX\"]\n  - name: \"my.kernel.modulecompiler\"\n    matchOn:\n      - kConfig: [\"GCC_VERSION=100101\"]\n        loadedKMod: [\"kmod1\"]\n  - name: \"profile.node.kubernetes.io/my-datacenter\"\n    value: \"datacenter-1\"\n    matchOn:\n      - nodename: [ \"node-datacenter1-rack.*-server.*\" ]\n
\n\n

In the example above:

\n\n\n\n","dir":"/advanced/","name":"customization-guide.md","path":"advanced/customization-guide.md","url":"/advanced/customization-guide.html"}] \ No newline at end of file +[{"title":"Developer guide","layout":"default","sort":1,"content":"

Developer guide

\n\n

Table of contents

\n\n
    \n
  1. Building from source
      \n
    1. Download the source code
    2. \n
    3. Docker build
    4. \n
    5. Docker multi-arch builds with buildx
    6. \n
    7. Deployment
    8. \n
    9. Building locally
    10. \n
    11. Customizing the build
    12. \n
    13. Testing
    14. \n
    \n
  2. \n
  3. Running locally
      \n
    1. NFD-Master
    2. \n
    3. NFD-Worker
    4. \n
    5. NFD-Topology-Updater
    6. \n
    \n
  4. \n
  5. Documentation
  6. \n
\n\n
\n\n

Building from source

\n\n

Download the source code

\n\n
git clone https://github.com/kubernetes-sigs/node-feature-discovery\ncd node-feature-discovery\n
\n\n

Docker build

\n\n

Build the container image

\n\n

See customizing the build below for altering the\ncontainer image registry, for example.

\n\n
make\n
\n\n

Push the container image

\n\n

Optional, this example with Docker.

\n\n
docker push <IMAGE_TAG>\n
\n\n

Docker multi-arch builds with buildx

\n\n

The default set of architectures enabled for mulit-arch builds are linux/amd64\nand linux/arm64. If more architectures are needed one can override the\nIMAGE_ALL_PLATFORMS variable with a comma separated list of OS/ARCH tuples.

\n\n

Build the manifest-list with a container image per arch

\n\n
make image-all\n
\n\n

Currently docker does not support loading of manifest-lists meaning the images\nare not shown when executing docker images, see:\nbuildx issue #59.

\n\n

Push the manifest-list with container image per arch

\n\n
make push-all\n
\n\n

The resulting container image can be used in the same way on each arch by pulling\ne.g. node-feature-discovery:v0.11.0 without specifying the architecture. The\nmanifest-list will take care of providing the right architecture image.

\n\n

Change the job spec to use your custom image (optional)

\n\n

To use your published image from the step above instead of the\nk8s.gcr.io/nfd/node-feature-discovery image, edit image\nattribute in the spec template(s) to the new location\n(<registry-name>/<image-name>[:<version>]).

\n\n

Deployment

\n\n

The yamls makefile generates a kustomization.yaml matching your locally\nbuilt image and using the deploy/overlays/default deployment. See\nbuild customization below for configurability, e.g.\nchanging the deployment namespace.

\n\n
K8S_NAMESPACE=my-ns make yamls\nkubectl apply -k .\n
\n\n

You can use alternative deployment methods by modifying the auto-generated\nkustomization file. For example, deploying worker and master in the same pod by\npointing to deployment/overlays/default-combined.

\n\n

Building locally

\n\n

You can also build the binaries locally

\n\n
make build\n
\n\n

This will compile binaries under bin/

\n\n

Customizing the build

\n\n

There are several Makefile variables that control the build process and the\nname of the resulting container image. The following are targeted targeted for\nbuild customization and they can be specified via environment variables or\nmakefile overrides.

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
VariableDescriptionDefault value
HOSTMOUNT_PREFIXPrefix of system directories for feature discovery (local builds)/ (local builds) /host- (container builds)
IMAGE_BUILD_CMDCommand to build the imagedocker build
IMAGE_BUILD_EXTRA_OPTSExtra options to pass to build commandempty
IMAGE_BUILDX_CMDCommand to build and push multi-arch images with buildxDOCKER_CLI_EXPERIMENTAL=enabled docker buildx build –platform=${IMAGE_ALL_PLATFORMS} –progress=auto –pull
IMAGE_ALL_PLATFORMSComma seperated list of OS/ARCH tuples for mulit-arch buildslinux/amd64,linux/arm64
IMAGE_PUSH_CMDCommand to push the image to remote registrydocker push
IMAGE_REGISTRYContainer image registry to usek8s.gcr.io/nfd
IMAGE_TAG_NAMEContainer image tag name<nfd version>
IMAGE_EXTRA_TAG_NAMESAdditional container image tag(s) to create when building imageempty
K8S_NAMESPACEnfd-master and nfd-worker namespacenode-feature-discovery
KUBECONFIGKubeconfig for running e2e-testsempty
E2E_TEST_CONFIGParameterization file of e2e-tests (see example)empty
OPENSHIFTNon-empty value enables OpenShift specific support (currently only effective in e2e tests)empty
BASE_IMAGE_FULLContainer base image for target image full (–target full)debian:buster-slim
BASE_IMAGE_MINIMALContainer base image for target image minimal (–target minimal)gcr.io/distroless/base
\n\n

For example, to use a custom registry:

\n\n
make IMAGE_REGISTRY=<my custom registry uri>\n
\n\n

Or to specify a build tool different from Docker, It can be done in 2 ways:

\n\n
    \n
  1. \n

    via environment

    \n\n
     IMAGE_BUILD_CMD=\"buildah bud\" make\n
    \n
  2. \n
  3. \n

    by overriding the variable value

    \n\n
     make  IMAGE_BUILD_CMD=\"buildah bud\"\n
    \n
  4. \n
\n\n

Testing

\n\n

Unit tests are automatically run as part of the container image build. You can\nalso run them manually in the source code tree by simply running:

\n\n
make test\n
\n\n

End-to-end tests are built on top of the e2e test framework of Kubernetes, and,\nthey required a cluster to run them on. For running the tests on your test\ncluster you need to specify the kubeconfig to be used:

\n\n
make e2e-test KUBECONFIG=$HOME/.kube/config\n
\n\n

Running locally

\n\n

You can run NFD locally, either directly on your host OS or in containers for\ntesting and development purposes. This may be useful e.g. for checking\nfeatures-detection.

\n\n

NFD-Master

\n\n

When running as a standalone container labeling is expected to fail because\nKubernetes API is not available. Thus, it is recommended to use -no-publish\ncommand line flag. E.g.

\n\n
$ export NFD_CONTAINER_IMAGE=k8s.gcr.io/nfd/node-feature-discovery:v0.11.2\n$ docker run --rm --name=nfd-test ${NFD_CONTAINER_IMAGE} nfd-master -no-publish\n2019/02/01 14:48:21 Node Feature Discovery Master <NFD_VERSION>\n2019/02/01 14:48:21 gRPC server serving on port: 8080\n
\n\n

NFD-Worker

\n\n

In order to run nfd-worker as a “stand-alone” container against your\nstandalone nfd-master you need to run them in the same network namespace:

\n\n
$ docker run --rm --network=container:nfd-test ${NFD_CONTAINER_IMAGE} nfd-worker\n2019/02/01 14:48:56 Node Feature Discovery Worker <NFD_VERSION>\n...\n
\n\n

If you just want to try out feature discovery without connecting to nfd-master,\npass the -no-publish flag to nfd-worker.

\n\n

NOTE Some feature sources need certain directories and/or files from the\nhost mounted inside the NFD container. Thus, you need to provide Docker with the\ncorrect --volume options in order for them to work correctly when run\nstand-alone directly with docker run. See the\ndefault deployment\nfor up-to-date information about the required volume mounts.

\n\n

NFD-Topology-Updater

\n\n

In order to run nfd-topology-updater as a “stand-alone” container against your\nstandalone nfd-master you need to run them in the same network namespace:

\n\n
$ docker run --rm --network=container:nfd-test ${NFD_CONTAINER_IMAGE} nfd-topology-updater\n2019/02/01 14:48:56 Node Feature Discovery Topology Updater <NFD_VERSION>\n...\n
\n\n

If you just want to try out feature discovery without connecting to nfd-master,\npass the -no-publish flag to nfd-topology-updater.

\n\n

NOTE:

\n\n

NFD topology updater needs certain directories and/or files from the\nhost mounted inside the NFD container. Thus, you need to provide Docker with the\ncorrect --volume options in order for them to work correctly when run\nstand-alone directly with docker run. See the\ntemplate spec\nfor up-to-date information about the required volume mounts.

\n\n

PodResource API is a prerequisite for nfd-topology-updater.\nPreceding Kubernetes v1.23, the kubelet must be started with the following flag:\n--feature-gates=KubeletPodResourcesGetAllocatable=true.\nStarting Kubernetes v1.23, the GetAllocatableResources is enabled by default\nthrough KubeletPodResourcesGetAllocatable feature gate.

\n\n

Documentation

\n\n

All documentation resides under the\ndocs\ndirectory in the source tree. It is designed to be served as a html site by\nGitHub Pages.

\n\n

Building the documentation is containerized in order to fix the build\nenvironment. The recommended way for developing documentation is to run:

\n\n
make site-serve\n
\n\n

This will build the documentation in a container and serve it under\nlocalhost:4000/ making it easy to verify the results.\nAny changes made to the docs/ will automatically re-trigger a rebuild and are\nreflected in the served content and can be inspected with a simple browser\nrefresh.

\n\n

In order to just build the html documentation run:

\n\n
make site-build\n
\n\n

This will generate html documentation under docs/_site/.

\n\n\n","dir":"/advanced/","name":"developer-guide.md","path":"advanced/developer-guide.md","url":"/advanced/developer-guide.html"},{"title":"Get started","layout":"default","sort":1,"content":"

Node Feature Discovery

\n\n

Welcome to Node Feature Discovery – a Kubernetes add-on for detecting hardware\nfeatures and system configuration!

\n\n

Continue to:

\n\n\n\n

Quick-start – the short-short version

\n\n
$ kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.11.2\n  namespace/node-feature-discovery created\n  serviceaccount/nfd-master created\n  clusterrole.rbac.authorization.k8s.io/nfd-master created\n  clusterrolebinding.rbac.authorization.k8s.io/nfd-master created\n  configmap/nfd-worker-conf created\n  service/nfd-master created\n  deployment.apps/nfd-master created\n  daemonset.apps/nfd-worker created\n\n$ kubectl -n node-feature-discovery get all\n  NAME                              READY   STATUS    RESTARTS   AGE\n  pod/nfd-master-555458dbbc-sxg6w   1/1     Running   0          56s\n  pod/nfd-worker-mjg9f              1/1     Running   0          17s\n...\n\n$ kubectl get nodes -o json | jq .items[].metadata.labels\n  {\n    \"beta.kubernetes.io/arch\": \"amd64\",\n    \"beta.kubernetes.io/os\": \"linux\",\n    \"feature.node.kubernetes.io/cpu-cpuid.ADX\": \"true\",\n    \"feature.node.kubernetes.io/cpu-cpuid.AESNI\": \"true\",\n...\n\n
\n","dir":"/get-started/","name":"index.md","path":"get-started/index.md","url":"/get-started/"},{"title":"Introduction","layout":"default","sort":1,"content":"

Introduction

\n\n

Table of contents

\n\n
    \n
  1. NFD-Master
  2. \n
  3. NFD-Worker
  4. \n
  5. NFD-Topology-Updater
  6. \n
  7. Feature Discovery
  8. \n
  9. Node annotations
  10. \n
  11. NodeResourceTopology CR
  12. \n
\n\n
\n\n

This software enables node feature discovery for Kubernetes. It detects\nhardware features available on each node in a Kubernetes cluster, and\nadvertises those features using node labels.

\n\n

NFD consists of three software components:

\n\n
    \n
  1. nfd-master
  2. \n
  3. nfd-worker
  4. \n
  5. nfd-topology-updater
  6. \n
\n\n

NFD-Master

\n\n

NFD-Master is the daemon responsible for communication towards the Kubernetes\nAPI. That is, it receives labeling requests from the worker and modifies node\nobjects accordingly.

\n\n

NFD-Worker

\n\n

NFD-Worker is a daemon responsible for feature detection. It then communicates\nthe information to nfd-master which does the actual node labeling. One\ninstance of nfd-worker is supposed to be running on each node of the cluster,

\n\n

NFD-Topology-Updater

\n\n

NFD-Topology-Updater is a daemon responsible for examining allocated\nresources on a worker node to account for resources available to be allocated\nto new pod on a per-zone basis (where a zone can be a NUMA node). It then\ncommunicates the information to nfd-master which does the\nNodeResourceTopology CR creation corresponding\nto all the nodes in the cluster. One instance of nfd-topology-updater is\nsupposed to be running on each node of the cluster.

\n\n

Feature Discovery

\n\n

Feature discovery is divided into domain-specific feature sources:

\n\n\n\n

Each feature source is responsible for detecting a set of features which. in\nturn, are turned into node feature labels. Feature labels are prefixed with\nfeature.node.kubernetes.io/ and also contain the name of the feature source.\nNon-standard user-specific feature labels can be created with the local and\ncustom feature sources.

\n\n

An overview of the default feature labels:

\n\n
{\n  \"feature.node.kubernetes.io/cpu-<feature-name>\": \"true\",\n  \"feature.node.kubernetes.io/custom-<feature-name>\": \"true\",\n  \"feature.node.kubernetes.io/kernel-<feature name>\": \"<feature value>\",\n  \"feature.node.kubernetes.io/memory-<feature-name>\": \"true\",\n  \"feature.node.kubernetes.io/network-<feature-name>\": \"true\",\n  \"feature.node.kubernetes.io/pci-<device label>.present\": \"true\",\n  \"feature.node.kubernetes.io/storage-<feature-name>\": \"true\",\n  \"feature.node.kubernetes.io/system-<feature name>\": \"<feature value>\",\n  \"feature.node.kubernetes.io/usb-<device label>.present\": \"<feature value>\",\n  \"feature.node.kubernetes.io/<file name>-<feature name>\": \"<feature value>\"\n}\n
\n\n

Node annotations

\n\n

NFD also annotates nodes it is running on:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
AnnotationDescription
[<instance>.]nfd.node.kubernetes.io/master.versionVersion of the nfd-master instance running on the node. Informative use only.
[<instance>.]nfd.node.kubernetes.io/worker.versionVersion of the nfd-worker instance running on the node. Informative use only.
[<instance>.]nfd.node.kubernetes.io/feature-labelsComma-separated list of node labels managed by NFD. NFD uses this internally so must not be edited by users.
[<instance>.]nfd.node.kubernetes.io/extended-resourcesComma-separated list of node extended resources managed by NFD. NFD uses this internally so must not be edited by users.
\n\n

NOTE: the -instance\ncommand line flag affects the annotation names

\n\n

Unapplicable annotations are not created, i.e. for example master.version is\nonly created on nodes running nfd-master.

\n\n

NodeResourceTopology CR

\n\n

When run with NFD-Topology-Updater, NFD creates CR instances corresponding to\nnode resource hardware topology such as:

\n\n
apiVersion: topology.node.k8s.io/v1alpha1\nkind: NodeResourceTopology\nmetadata:\n  name: node1\ntopologyPolicies: [\"SingleNUMANodeContainerLevel\"]\nzones:\n  - name: node-0\n    type: Node\n    resources:\n      - name: cpu\n        capacity: 20\n        allocatable: 16\n        available: 10\n      - name: vendor/nic1\n        capacity: 3\n        allocatable: 3\n        available: 3\n  - name: node-1\n    type: Node\n    resources:\n      - name: cpu\n        capacity: 30\n        allocatable: 30\n        available: 15\n      - name: vendor/nic2\n        capacity: 6\n        allocatable: 6\n        available: 6\n  - name: node-2\n    type: Node\n    resources:\n      - name: cpu\n        capacity: 30\n        allocatable: 30\n        available: 15\n      - name: vendor/nic1\n        capacity: 3\n        allocatable: 3\n        available: 3\n
\n","dir":"/get-started/","name":"introduction.md","path":"get-started/introduction.md","url":"/get-started/introduction.html"},{"title":"Master cmdline reference","layout":"default","sort":2,"content":"

Commandline flags of nfd-master

\n\n

Table of contents

\n\n
    \n
  1. -h, -help
  2. \n
  3. -version
  4. \n
  5. -prune
  6. \n
  7. -port
  8. \n
  9. -instance
  10. \n
  11. -ca-file
  12. \n
  13. -cert-file
  14. \n
  15. -key-file
  16. \n
  17. -verify-node-name
  18. \n
  19. -no-publish
  20. \n
  21. -featurerules-controller
  22. \n
  23. -label-whitelist
  24. \n
  25. -extra-label-ns
  26. \n
  27. -resource-labels
  28. \n
  29. Logging
  30. \n
\n\n
\n\n

To quickly view available command line flags execute nfd-master -help.\nIn a docker container:

\n\n
docker run k8s.gcr.io/nfd/node-feature-discovery:v0.11.2 nfd-master -help\n
\n\n

-h, -help

\n\n

Print usage and exit.

\n\n

-version

\n\n

Print version and exit.

\n\n

-prune

\n\n

The -prune flag is a sub-command like option for cleaning up the cluster. It\ncauses nfd-master to remove all NFD related labels, annotations and extended\nresources from all Node objects of the cluster and exit.

\n\n

-port

\n\n

The -port flag specifies the TCP port that nfd-master listens for incoming requests.

\n\n

Default: 8080

\n\n

Example:

\n\n
nfd-master -port=443\n
\n\n

-instance

\n\n

The -instance flag makes it possible to run multiple NFD deployments in\nparallel. In practice, it separates the node annotations between deployments so\nthat each of them can store metadata independently. The instance name must\nstart and end with an alphanumeric character and may only contain alphanumeric\ncharacters, -, _ or ..

\n\n

Default: empty

\n\n

Example:

\n\n
nfd-master -instance=network\n
\n\n

-ca-file

\n\n

The -ca-file is one of the three flags (together with -cert-file and\n-key-file) controlling master-worker mutual TLS authentication on the\nnfd-master side. This flag specifies the TLS root certificate that is used for\nauthenticating incoming connections. NFD-Worker side needs to have matching key\nand cert files configured in order for the incoming requests to be accepted.

\n\n

Default: empty

\n\n

Note: Must be specified together with -cert-file and -key-file

\n\n

Example:

\n\n
nfd-master -ca-file=/opt/nfd/ca.crt -cert-file=/opt/nfd/master.crt -key-file=/opt/nfd/master.key\n
\n\n

-cert-file

\n\n

The -cert-file is one of the three flags (together with -ca-file and\n-key-file) controlling master-worker mutual TLS authentication on the\nnfd-master side. This flag specifies the TLS certificate presented for\nauthenticating outgoing traffic towards nfd-worker.

\n\n

Default: empty

\n\n

Note: Must be specified together with -ca-file and -key-file

\n\n

Example:

\n\n
nfd-master -cert-file=/opt/nfd/master.crt -key-file=/opt/nfd/master.key -ca-file=/opt/nfd/ca.crt\n
\n\n

-key-file

\n\n

The -key-file is one of the three flags (together with -ca-file and\n-cert-file) controlling master-worker mutual TLS authentication on the\nnfd-master side. This flag specifies the private key corresponding the given\ncertificate file (-cert-file) that is used for authenticating outgoing\ntraffic.

\n\n

Default: empty

\n\n

Note: Must be specified together with -cert-file and -ca-file

\n\n

Example:

\n\n
nfd-master -key-file=/opt/nfd/master.key -cert-file=/opt/nfd/master.crt -ca-file=/opt/nfd/ca.crt\n
\n\n

-verify-node-name

\n\n

The -verify-node-name flag controls the NodeName based authorization of\nincoming requests and only has effect when mTLS authentication has been enabled\n(with -ca-file, -cert-file and -key-file). If enabled, the worker node\nname of the incoming must match with the CN or a SAN in its TLS certificate. Thus,\nworkers are only able to label the node they are running on (or the node whose\ncertificate they present).

\n\n

Node Name based authorization is disabled by default.

\n\n

Default: false

\n\n

Example:

\n\n
nfd-master -verify-node-name -ca-file=/opt/nfd/ca.crt \\\n    -cert-file=/opt/nfd/master.crt -key-file=/opt/nfd/master.key\n
\n\n

-no-publish

\n\n

The -no-publish flag disables updates to the Node objects in the Kubernetes\nAPI server, making a “dry-run” flag for nfd-master. No Labels, Annotations or\nExtendedResources of nodes are updated.

\n\n

Default: false

\n\n

Example:

\n\n
nfd-master -no-publish\n
\n\n

-featurerules-controller

\n\n

The -featurerules-controller flag controlers the processing of\nNodeFeatureRule objects, effectively enabling/disabling labels from these\ncustom labeling rules.

\n\n

Default: true

\n\n

Example:

\n\n
nfd-master -featurerules-controller=false\n
\n\n

-label-whitelist

\n\n

The -label-whitelist specifies a regular expression for filtering feature\nlabels based on their name. Each label must match against the given reqular\nexpression in order to be published.

\n\n

Note: The regular expression is only matches against the “basename” part of the\nlabel, i.e. to the part of the name after ‘/’. The label namespace is omitted.

\n\n

Default: empty

\n\n

Example:

\n\n
nfd-master -label-whitelist='.*cpuid\\.'\n
\n\n

-extra-label-ns

\n\n

The -extra-label-ns flag specifies a comma-separated list of allowed feature\nlabel namespaces. By default, nfd-master only allows creating labels in the\ndefault feature.node.kubernetes.io and profile.node.kubernetes.io label\nnamespaces and their sub-namespaces (e.g. vendor.feature.node.kubernetes.io\nand sub.ns.profile.node.kubernetes.io). This option can be used to allow\nother vendor or application specific namespaces for custom labels from the\nlocal and custom feature sources.

\n\n

The same namespace control and this flag applies Extended Resources (created\nwith -resource-labels), too.

\n\n

Default: empty

\n\n

Example:

\n\n
nfd-master -extra-label-ns=vendor-1.com,vendor-2.io\n
\n\n

-resource-labels

\n\n

The -resource-labels flag specifies a comma-separated list of features to be\nadvertised as extended resources instead of labels. Features that have integer\nvalues can be published as Extended Resources by listing them in this flag.

\n\n

Default: empty

\n\n

Example:

\n\n
nfd-master -resource-labels=vendor-1.com/feature-1,vendor-2.io/feature-2\n
\n\n

Logging

\n\n

The following logging-related flags are inherited from the\nklog package.

\n\n

-add_dir_header

\n\n

If true, adds the file directory to the header of the log messages.

\n\n

Default: false

\n\n

-alsologtostderr

\n\n

Log to standard error as well as files.

\n\n

Default: false

\n\n

-log_backtrace_at

\n\n

When logging hits line file:N, emit a stack trace.

\n\n

Default: empty

\n\n

-log_dir

\n\n

If non-empty, write log files in this directory.

\n\n

Default: empty

\n\n

-log_file

\n\n

If non-empty, use this log file.

\n\n

Default: empty

\n\n

-log_file_max_size

\n\n

Defines the maximum size a log file can grow to. Unit is megabytes. If the\nvalue is 0, the maximum file size is unlimited.

\n\n

Default: 1800

\n\n

-logtostderr

\n\n

Log to standard error instead of files

\n\n

Default: true

\n\n

-skip_headers

\n\n

If true, avoid header prefixes in the log messages.

\n\n

Default: false

\n\n

-skip_log_headers

\n\n

If true, avoid headers when opening log files.

\n\n

Default: false

\n\n

-stderrthreshold

\n\n

Logs at or above this threshold go to stderr.

\n\n

Default: 2

\n\n

-v

\n\n

Number for the log level verbosity.

\n\n

Default: 0

\n\n

-vmodule

\n\n

Comma-separated list of pattern=N settings for file-filtered logging.

\n\n

Default: empty

\n","dir":"/advanced/","name":"master-commandline-reference.md","path":"advanced/master-commandline-reference.md","url":"/advanced/master-commandline-reference.html"},{"title":"Advanced","layout":"default","sort":2,"content":"

Advanced

\n\n

Advanced topics and reference.

\n","dir":"/advanced/","name":"index.md","path":"advanced/index.md","url":"/advanced/"},{"title":"Quick start","layout":"default","sort":2,"content":"

Quick start

\n\n

Minimal steps to deploy latest released version of NFD in your cluster.

\n\n

Installation

\n\n

Deploy with kustomize – creates a new namespace, service and required RBAC\nrules and deploys nfd-master and nfd-worker daemons.

\n\n
kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.11.2\n
\n\n

Verify

\n\n

Wait until NFD master and NFD worker are running.

\n\n
$ kubectl -n node-feature-discovery get ds,deploy\nNAME                         DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE\ndaemonset.apps/nfd-worker    2         2         2       2            2           <none>          10s\n\nNAME                         READY   UP-TO-DATE   AVAILABLE   AGE\ndeployment.apps/nfd-master   1/1     1            1           17s\n\n
\n\n

Check that NFD feature labels have been created

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

Use node labels

\n\n

Create a pod targeting a distinguishing feature (select a valid feature from\nthe list printed on the previous step)

\n\n
$ cat << EOF | kubectl apply -f -\napiVersion: v1\nkind: Pod\nmetadata:\n  name: feature-dependent-pod\nspec:\n  containers:\n  - image: k8s.gcr.io/pause\n    name: pause\n  nodeSelector:\n    # Select a valid feature\n    feature.node.kubernetes.io/cpu-cpuid.AESNI: 'true'\nEOF\npod/feature-dependent-pod created\n
\n\n

See that the pod is running on a desired node

\n\n
$ kubectl get po feature-dependent-pod -o wide\nNAME                    READY   STATUS    RESTARTS   AGE   IP          NODE     NOMINATED NODE   READINESS GATES\nfeature-dependent-pod   1/1     Running   0          23s   10.36.0.4   node-2   <none>           <none>\n
\n\n

Additional Optional Installation Steps

\n\n

In order to deploy nfd-master and nfd-topology-updater daemons\nuse topologyupdater overlay.

\n\n

Deploy with kustomize – creates a new namespace, service and required RBAC\nrules and nfd-master and nfd-topology-updater daemons.

\n\n
kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/topologyupdater?ref=v0.11.2\n
\n\n

NOTE:

\n\n

PodResource API is a prerequisite for nfd-topology-updater.

\n\n

Preceding Kubernetes v1.23, the kubelet must be started with the following flag:

\n\n

--feature-gates=KubeletPodResourcesGetAllocatable=true

\n\n

Starting Kubernetes v1.23, the GetAllocatableResources is enabled by default\nthrough KubeletPodResourcesGetAllocatable feature gate.

\n\n

Verify

\n\n

Wait until NFD master and NFD topologyupdater are running.

\n\n
$ kubectl -n node-feature-discovery get ds,deploy\nNAME                                  DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE\ndaemonset.apps/nfd-topology-updater   2         2         2       2            2           <none>          5s\n\nNAME                         READY   UP-TO-DATE   AVAILABLE   AGE\ndeployment.apps/nfd-master   1/1     1            1           17s\n\n
\n\n

Check that the NodeResourceTopology CR instances are created

\n\n
$ kubectl get noderesourcetopologies.topology.node.k8s.io\nNAME                 AGE\nkind-control-plane   23s\nkind-worker          23s\n
\n\n

Show the CR instances

\n\n
$ kubectl describe noderesourcetopologies.topology.node.k8s.io kind-control-plane\nName:         kind-control-plane\nNamespace:    default\nLabels:       <none>\nAnnotations:  <none>\nAPI Version:  topology.node.k8s.io/v1alpha1\nKind:         NodeResourceTopology\n...\nTopology Policies:\n  SingleNUMANodeContainerLevel\nZones:\n    Name:             node-0\n    Costs:\n      node-0:  10\n      node-1:  20\n    Resources:\n        Name:         Cpu\n        Allocatable:  3\n        Capacity:     3\n        Available:    3\n        Name:         vendor/nic1\n        Allocatable:  2\n        Capacity:     2\n        Available:    2\n        Name:         vendor/nic2\n        Allocatable:  2\n        Capacity:     2\n        Available:    2\n    Type:             Node\n    Name:             node-1\n    Costs:\n      node-0:  20\n      node-1:  10\n    Resources:\n        Name:         Cpu\n        Allocatable:  4\n        Capacity:     4\n        Available:    4\n        Name:         vendor/nic1\n        Allocatable:  2\n        Capacity:     2\n        Available:    2\n        Name:         vendor/nic2\n        Allocatable:  2\n        Capacity:     2\n        Available:    2\n    Type:             Node\nEvents:               <none>\n
\n\n

The CR instances created can be used to gain insight into the allocatable\nresources along with the granularity of those resources at a per-zone level\n(represented by node-0 and node-1 in the above example) or can be used by an\nexternal entity (e.g. topology-aware scheduler plugin) to take an action based\non the gathered information.

\n\n\n","dir":"/get-started/","name":"quick-start.md","path":"get-started/quick-start.md","url":"/get-started/quick-start.html"},{"title":"Contributing","layout":"default","sort":3,"content":"

Contributing

\n\n
\n\n

Community

\n\n

You can reach us via the following channels:

\n\n\n\n

Governance

\n\n

This is a\nSIG-node\nsubproject, hosted under the\nKubernetes SIGs organization in Github.\nThe project was established in 2016 and was migrated to Kubernetes SIGs in 2018.

\n\n

License

\n\n

This is open source software released under the Apache 2.0 License.

\n","dir":"/contributing/","name":"index.md","path":"contributing/index.md","url":"/contributing/"},{"title":"Worker cmdline reference","layout":"default","sort":3,"content":"

Commandline flags of nfd-worker

\n\n

Table of contents

\n\n
    \n
  1. -h, -help
  2. \n
  3. -version
  4. \n
  5. -config
  6. \n
  7. -options
  8. \n
  9. -server
  10. \n
  11. -ca-file
  12. \n
  13. -cert-file
  14. \n
  15. -key-file
  16. \n
  17. -server-name-override
  18. \n
  19. -feature-sources
  20. \n
  21. -label-sources
  22. \n
  23. -sources
  24. \n
  25. -no-publish
  26. \n
  27. -label-whitelist
  28. \n
  29. -oneshot
  30. \n
  31. -sleep-interval
  32. \n
  33. Logging
  34. \n
\n\n
\n\n

To quickly view available command line flags execute nfd-worker -help.\nIn a docker container:

\n\n
docker run k8s.gcr.io/nfd/node-feature-discovery:v0.11.2 nfd-worker -help\n
\n\n

-h, -help

\n\n

Print usage and exit.

\n\n

-version

\n\n

Print version and exit.

\n\n

-config

\n\n

The -config flag specifies the path of the nfd-worker configuration file to\nuse.

\n\n

Default: /etc/kubernetes/node-feature-discovery/nfd-worker.conf

\n\n

Example:

\n\n
nfd-worker -config=/opt/nfd/worker.conf\n
\n\n

-options

\n\n

The -options flag may be used to specify and override configuration file\noptions directly from the command line. The required format is the same as in\nthe config file i.e. JSON or YAML. Configuration options specified via this\nflag will override those from the configuration file:

\n\n

Default: empty

\n\n

Example:

\n\n
nfd-worker -options='{\"sources\":{\"cpu\":{\"cpuid\":{\"attributeWhitelist\":[\"AVX\",\"AVX2\"]}}}}'\n
\n\n

-server

\n\n

The -server flag specifies the address of the nfd-master endpoint where to\nconnect to.

\n\n

Default: localhost:8080

\n\n

Example:

\n\n
nfd-worker -server=nfd-master.nfd.svc.cluster.local:443\n
\n\n

-ca-file

\n\n

The -ca-file is one of the three flags (together with -cert-file and\n-key-file) controlling the mutual TLS authentication on the worker side.\nThis flag specifies the TLS root certificate that is used for verifying the\nauthenticity of nfd-master.

\n\n

Default: empty

\n\n

Note: Must be specified together with -cert-file and -key-file

\n\n

Example:

\n\n
nfd-worker -ca-file=/opt/nfd/ca.crt -cert-file=/opt/nfd/worker.crt -key-file=/opt/nfd/worker.key\n
\n\n

-cert-file

\n\n

The -cert-file is one of the three flags (together with -ca-file and\n-key-file) controlling mutual TLS authentication on the worker side. This\nflag specifies the TLS certificate presented for authenticating outgoing\nrequests.

\n\n

Default: empty

\n\n

Note: Must be specified together with -ca-file and -key-file

\n\n

Example:

\n\n
nfd-workerr -cert-file=/opt/nfd/worker.crt -key-file=/opt/nfd/worker.key -ca-file=/opt/nfd/ca.crt\n
\n\n

-key-file

\n\n

The -key-file is one of the three flags (together with -ca-file and\n-cert-file) controlling the mutual TLS authentication on the worker side.\nThis flag specifies the private key corresponding the given certificate file\n(-cert-file) that is used for authenticating outgoing requests.

\n\n

Default: empty

\n\n

Note: Must be specified together with -cert-file and -ca-file

\n\n

Example:

\n\n
nfd-worker -key-file=/opt/nfd/worker.key -cert-file=/opt/nfd/worker.crt -ca-file=/opt/nfd/ca.crt\n
\n\n

-server-name-override

\n\n

The -server-name-override flag specifies the common name (CN) which to\nexpect from the nfd-master TLS certificate. This flag is mostly intended for\ndevelopment and debugging purposes.

\n\n

Default: empty

\n\n

Example:

\n\n
nfd-worker -server-name-override=localhost\n
\n\n

-feature-sources

\n\n

The -feature-sources flag specifies a comma-separated list of enabled feature\nsources. A special value all enables all sources. Prefixing a source name\nwith - indicates that the source will be disabled instead - this is only\nmeaningful when used in conjunction with all. This command line flag allows\ncompletely disabling the feature detection so that neither standard feature\nlabels are generated nor the raw feature data is available for custom rule\nprocessing. Consider using the core.featureSources config file option,\ninstead, allowing dynamic configurability.

\n\n

Note: This flag takes precedence over the core.featureSources configuration\nfile option.

\n\n

Default: all

\n\n

Example:

\n\n
nfd-worker -feature-sources=all,-pci\n
\n\n

-label-sources

\n\n

The -label-sources flag specifies a comma-separated list of enabled label\nsources. A special value all enables all sources. Prefixing a source name\nwith - indicates that the source will be disabled instead - this is only\nmeaningful when used in conjunction with all. Consider using the\ncore.labelSources config file option, instead, allowing dynamic\nconfigurability.

\n\n

Note: This flag takes precedence over the core.labelSources configuration\nfile option.

\n\n

Default: all

\n\n

Example:

\n\n
nfd-worker -label-sources=kernel,system,local\n
\n\n

-sources

\n\n

DEPRECATED: use -label-sources instead.

\n\n

-no-publish

\n\n

The -no-publish flag disables all communication with the nfd-master, making\nit a “dry-run” flag for nfd-worker. NFD-Worker runs feature detection normally,\nbut no labeling requests are sent to nfd-master.

\n\n

Default: false

\n\n

Example:

\n\n
nfd-worker -no-publish\n
\n\n

-label-whitelist

\n\n

The -label-whitelist specifies a regular expression for filtering feature\nlabels based on their name. Each label must match against the given reqular\nexpression in order to be published.

\n\n

Note: The regular expression is only matches against the “basename” part of the\nlabel, i.e. to the part of the name after ‘/’. The label namespace is omitted.

\n\n

Note: This flag takes precedence over the core.labelWhiteList configuration\nfile option.

\n\n

Default: empty

\n\n

Example:

\n\n
nfd-worker -label-whitelist='.*cpuid\\.'\n
\n\n

DEPRECATED: you should use the core.labelWhiteList option in the\nconfiguration file, instead.

\n\n

-oneshot

\n\n

The -oneshot flag causes nfd-worker to exit after one pass of feature\ndetection.

\n\n

Default: false

\n\n

Example:

\n\n
nfd-worker -oneshot -no-publish\n
\n\n

-sleep-interval

\n\n

The -sleep-interval specifies the interval between feature re-detection (and\nnode re-labeling). A non-positive value implies infinite sleep interval, i.e.\nno re-detection or re-labeling is done.

\n\n

Note: This flag takes precedence over the core.sleepInterval configuration\nfile option.

\n\n

Default: 60s

\n\n

Example:

\n\n
nfd-worker -sleep-interval=1h\n
\n\n

DEPRECATED: you should use the core.sleepInterval option in the\nconfiguration file, instead.

\n\n

Logging

\n\n

The following logging-related flags are inherited from the\nklog package.

\n\n

Note: The logger setup can also be specified via the core.klog configuration\nfile options. However, the command line flags take precedence over any\ncorresponding config file options specified.

\n\n

-add_dir_header

\n\n

If true, adds the file directory to the header of the log messages.

\n\n

Default: false

\n\n

-alsologtostderr

\n\n

Log to standard error as well as files.

\n\n

Default: false

\n\n

-log_backtrace_at

\n\n

When logging hits line file:N, emit a stack trace.

\n\n

Default: empty

\n\n

-log_dir

\n\n

If non-empty, write log files in this directory.

\n\n

Default: empty

\n\n

-log_file

\n\n

If non-empty, use this log file.

\n\n

Default: empty

\n\n

-log_file_max_size

\n\n

Defines the maximum size a log file can grow to. Unit is megabytes. If the\nvalue is 0, the maximum file size is unlimited.

\n\n

Default: 1800

\n\n

-logtostderr

\n\n

Log to standard error instead of files

\n\n

Default: true

\n\n

-skip_headers

\n\n

If true, avoid header prefixes in the log messages.

\n\n

Default: false

\n\n

-skip_log_headers

\n\n

If true, avoid headers when opening log files.

\n\n

Default: false

\n\n

-stderrthreshold

\n\n

Logs at or above this threshold go to stderr.

\n\n

Default: 2

\n\n

-v

\n\n

Number for the log level verbosity.

\n\n

Default: 0

\n\n

-vmodule

\n\n

Comma-separated list of pattern=N settings for file-filtered logging.

\n\n

Default: empty

\n","dir":"/advanced/","name":"worker-commandline-reference.md","path":"advanced/worker-commandline-reference.md","url":"/advanced/worker-commandline-reference.html"},{"title":"Deployment and usage","layout":"default","sort":3,"content":"

Deployment and usage

\n\n

Table of contents

\n\n
    \n
  1. Image variants
      \n
    1. Full
    2. \n
    3. Minimal
    4. \n
    \n
  2. \n
  3. Deployment options
      \n
    1. Operator
    2. \n
    3. Deployment with kustomize
    4. \n
    5. Deployment with Helm
    6. \n
    7. Build your own
    8. \n
    \n
  4. \n
  5. Usage
      \n
    1. NFD-Master
    2. \n
    3. NFD-Worker
    4. \n
    5. NFD-Topology-Updater
    6. \n
    7. Communication security with TLS
    8. \n
    \n
  6. \n
  7. Worker configuration
  8. \n
  9. Using node labels
  10. \n
  11. Uninstallation
      \n
    1. Operator was used for deployment
    2. \n
    3. Manual
    4. \n
    5. Removing feature labels
    6. \n
    \n
  12. \n
\n\n
\n\n

Image variants

\n\n

NFD currently offers two variants of the container image. The “full” variant is\ncurrently deployed by default. Released container images are available for\nx86_64 and Arm64 architectures.

\n\n

Full

\n\n

This image is based on\ndebian:buster-slim and contains a full Linux\nsystem for running shell-based nfd-worker hooks and doing live debugging and\ndiagnosis of the NFD images.

\n\n

Minimal

\n\n

This is a minimal image based on\ngcr.io/distroless/base\nand only supports running statically linked binaries.

\n\n

The container image tag has suffix -minimal\n(e.g. k8s.gcr.io/nfd/node-feature-discovery:v0.11.2-minimal)

\n\n

Deployment options

\n\n

Operator

\n\n

Deployment using the\nNode Feature Discovery Operator\nis recommended to be done via\noperatorhub.io.

\n\n
    \n
  1. You need to have\nOLM\ninstalled. If you don’t, take a look at the\nlatest release\nfor detailed instructions.
  2. \n
  3. \n

    Install the operator:

    \n\n
    kubectl create -f https://operatorhub.io/install/nfd-operator.yaml\n
    \n
  4. \n
  5. \n

    Create NodeFeatureDiscovery object (in nfd namespace here):

    \n\n
    cat << EOF | kubectl apply -f -\napiVersion: v1\nkind: Namespace\nmetadata:\n  name: nfd\n---\napiVersion: nfd.kubernetes.io/v1\nkind: NodeFeatureDiscovery\nmetadata:\n  name: my-nfd-deployment\n  namespace: nfd\nspec:\n  operand:\n    image: k8s.gcr.io/nfd/node-feature-discovery:v0.11.2\n    imagePullPolicy: IfNotPresent\nEOF\n
    \n
  6. \n
\n\n

In order to deploy the minimal image you need to use

\n\n
  image: k8s.gcr.io/nfd/node-feature-discovery:v0.11.2-minimal\n
\n\n

in the NodeFeatureDiscovery object above.

\n\n

Deployment with kustomize

\n\n

This requires kubectl\nv1.21 or later. The kustomize overlays provided in the repo can be used\ndirectly:

\n\n
kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.11.2\n
\n\n

This will required RBAC rules and deploy nfd-master (as a deployment) and\nnfd-worker (as daemonset) in the node-feature-discovery namespace.

\n\n

NOTE: nfd-topology-updater is not deployed as part of the default overlay.\nPlease refer to the Master Worker Topologyupdater\nand Topologyupdater below.

\n\n

Alternatively you can clone the repository and customize the deployment by\ncreating your own overlays. For example, to deploy the minimal\nimage. See kustomize for more information about managing\ndeployment configurations.

\n\n

Default overlays

\n\n

The NFD repository hosts a set of overlays for different usages and deployment\nscenarios under\ndeployment/overlays

\n\n\n\n

Master-worker pod

\n\n

You can also run nfd-master and nfd-worker inside the same pod

\n\n
kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default-combined?ref=v0.11.2\n\n
\n\n

This creates a DaemonSet that runs nfd-worker and nfd-master in the same Pod.\nIn this case no nfd-master is run on the master node(s), but, the worker nodes\nare able to label themselves which may be desirable e.g. in single-node setups.

\n\n

NOTE: nfd-topology-updater is not deployed by the default-combined overlay.\nTo enable nfd-topology-updater in this scenario,the users must customize the\ndeployment themselves.

\n\n

Worker one-shot

\n\n

Feature discovery can alternatively be configured as a one-shot job.\nThe default-job overlay may be used to achieve this:

\n\n
NUM_NODES=$(kubectl get no -o jsonpath='{.items[*].metadata.name}' | wc -w)\nkubectl kustomize https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default-job?ref=v0.11.2 | \\\n    sed s\"/NUM_NODES/$NUM_NODES/\" | \\\n    kubectl apply -f -\n
\n\n

The example above launches as many jobs as there are non-master nodes. Note that\nthis approach does not guarantee running once on every node. For example,\ntainted, non-ready nodes or some other reasons in Job scheduling may cause some\nnode(s) will run extra job instance(s) to satisfy the request.

\n\n

Master Worker Topologyupdater

\n\n

NFD Master, NFD worker and NFD Topologyupdater can be configured to be deployed\nas separate pods. The master-worker-topologyupdater overlay may be used to\nachieve this:

\n\n
kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/master-worker-topologyupdater?ref=v0.11.2\n\n
\n\n

Topologyupdater

\n\n

In order to deploy just NFD master and NFD Topologyupdater (without nfd-worker)\nuse the topologyupdater overlay:

\n\n
kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/topologyupdater?ref=v0.11.2\n\n
\n\n

NFD Topologyupdater can be configured along with the default overlay\n(which deploys NFD worker and NFD master) where all the software components\nare deployed as separate pods. The topologyupdater overlay may be used\nalong with default overlay to achieve this:

\n\n
\nkubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.11.2\nkubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/topologyupdater?ref=v0.11.2\n\n
\n\n

Deployment with Helm

\n\n

Node Feature Discovery Helm chart allow to easily deploy and manage NFD.

\n\n

Prerequisites

\n\n

Helm package manager should be installed.

\n\n

Deployment

\n\n

To install the latest stable version:

\n\n
export NFD_NS=node-feature-discovery\nhelm repo add nfd https://kubernetes-sigs.github.io/node-feature-discovery/charts\nhelm repo update\nhelm install nfd/node-feature-discovery --namespace $NFD_NS --create-namespace --generate-name\n
\n\n

To install the latest development version you need to clone the NFD Git\nrepository and install from there.

\n\n
git clone https://github.com/kubernetes-sigs/node-feature-discovery/\ncd node-feature-discovery/deployment/helm\nexport NFD_NS=node-feature-discovery\nhelm install node-feature-discovery ./node-feature-discovery/ --namespace $NFD_NS --create-namespace\n
\n\n

See the configuration section below for instructions how to\nalter the deployment parameters.

\n\n

In order to deploy the minimal image you need to override the image\ntag:

\n\n
helm install node-feature-discovery ./node-feature-discovery/ --set image.tag=v0.11.2-minimal --namespace $NFD_NS --create-namespace\n
\n\n

Configuration

\n\n

You can override values from values.yaml and provide a file with custom values:

\n\n
export NFD_NS=node-feature-discovery\nhelm install nfd/node-feature-discovery -f <path/to/custom/values.yaml> --namespace $NFD_NS --create-namespace\n
\n\n

To specify each parameter separately you can provide them to helm install command:

\n\n
export NFD_NS=node-feature-discovery\nhelm install nfd/node-feature-discovery --set nameOverride=NFDinstance --set master.replicaCount=2 --namespace $NFD_NS --create-namespace\n
\n\n

Uninstalling the chart

\n\n

To uninstall the node-feature-discovery deployment:

\n\n
export NFD_NS=node-feature-discovery\nhelm uninstall node-feature-discovery --namespace $NFD_NS\n
\n\n

The command removes all the Kubernetes components associated with the chart and\ndeletes the release.

\n\n

Chart parameters

\n\n

In order to tailor the deployment of the Node Feature Discovery to your cluster needs\nWe have introduced the following Chart parameters.

\n\n
General parameters
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
NameTypeDefaultdescription
image.repositorystringk8s.gcr.io/nfd/node-feature-discoveryNFD image repository
image.tagstringv0.11.2NFD image tag
image.pullPolicystringAlwaysImage pull policy
imagePullSecretslist[]ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info
nameOverridestring Override the name of the chart
fullnameOverridestring Override a default fully qualified app name
nodeFeatureRule.createCRDbooltrueSpecifies whether to create the NodeFeatureRule CRD
tls.enableboolfalseSpecifies whether to use TLS for communications between components
tls.certManagerboolfalseIf enabled, requires cert-manager to be installed and will automatically create the required TLS certificates
\n\n
Master pod parameters
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
NameTypeDefaultdescription
master.*dict NFD master deployment configuration
master.instancestring Instance name. Used to separate annotation namespaces for multiple parallel deployments
master.extraLabelNsarray[]List of allowed extra label namespaces
master.resourceLabelsarray[]List of labels to be registered as extended resources
master.featureRulesControllerboolnullSpecifies whether the controller for processing of NodeFeatureRule objects is enabled. If not set, controller will be enabled if master.instance is empty.
master.replicaCountinteger1Number of desired pods. This is a pointer to distinguish between explicit zero and not specified
master.podSecurityContextdict{}PodSecurityContext holds pod-level security attributes and common container settings
master.securityContextdict{}Container security settings
master.serviceAccount.createbooltrueSpecifies whether a service account should be created
master.serviceAccount.annotationsdict{}Annotations to add to the service account
master.serviceAccount.namestring The name of the service account to use. If not set and create is true, a name is generated using the fullname template
master.rbac.createbooltrueSpecifies whether to create RBAC configuration for nfd-master
master.service.typestringClusterIPNFD master service type
master.service.portinteger8080NFD master service port
master.resourcesdict{}NFD master pod resources management
master.nodeSelectordict{}NFD master pod node selector
master.tolerationsdictScheduling to master node is disabledNFD master pod tolerations
master.annotationsdict{}NFD master pod annotations
master.affinitydict NFD master pod required node affinity
master.deploymentAnnotationsdict{}NFD master deployment annotations
\n\n
Worker pod parameters
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
NameTypeDefaultdescription
worker.*dict NFD worker daemonset configuration
worker.configdict NFD worker configuration
worker.podSecurityContextdict{}PodSecurityContext holds pod-level security attributes and common container settings
worker.securityContextdict{}Container security settings
worker.mountUsrSrcboolfalseSpecifies whether to allow users to mount the hostpath /user/src. Does not work on systems without /usr/src AND a read-only /usr
worker.resourcesdict{}NFD worker pod resources management
worker.nodeSelectordict{}NFD worker pod node selector
worker.tolerationsdict{}NFD worker pod node tolerations
worker.annotationsdict{}NFD worker pod annotations
worker.daemonsetAnnotationsdict{}NFD worker daemonset annotations
\n\n
Topology updater parameters
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
NameTypeDefaultdescription
topologyUpdater.*dict NFD Topology Updater configuration
topologyUpdater.enableboolfalseSpecifies whether the NFD Topology Updater should be created
topologyUpdater.createCRDsboolfalseSpecifies whether the NFD Topology Updater CRDs should be created
topologyUpdater.serviceAccount.createbooltrueSpecifies whether the service account for topology updater should be created
topologyUpdater.serviceAccount.annotationsdict{}Annotations to add to the service account for topology updater
topologyUpdater.serviceAccount.namestring The name of the service account for topology updater to use. If not set and create is true, a name is generated using the fullname template and -topology-updater suffix
topologyUpdater.rbacdict RBAC parameters for the topology updater
topologyUpdater.rbac.createboolfalseSpecifies whether the cluster role and binding for topology updater should be created
topologyUpdater.kubeletConfigPathstring””Specifies the kubelet config host path
topologyUpdater.kubeletPodResourcesSockPathstring””Specifies the kubelet sock path to read pod resources
topologyUpdater.updateIntervalstring60sTime to sleep between CR updates. Non-positive value implies no CR update.
topologyUpdater.watchNamespacestring*Namespace to watch pods, * for all namespaces
topologyUpdater.podSecurityContextdict{}PodSecurityContext holds pod-level security attributes and common container settings
topologyUpdater.securityContextdict{}Container security settings
topologyUpdater.resourcesdict{}Topology updater pod resources management
topologyUpdater.nodeSelectordict{}Topology updater pod node selector
topologyUpdater.tolerationsdict{}Topology updater pod node tolerations
topologyUpdater.annotationsdict{}Topology updater pod annotations
topologyUpdater.affinitydict{}Topology updater pod affinity
\n\n

Build your own

\n\n

If you want to use the latest development version (master branch) you need to\nbuild your own custom image.\nSee the Developer Guide for instructions how to\nbuild images and deploy them on your cluster.

\n\n

Usage

\n\n

NFD-Master

\n\n

NFD-Master runs as a deployment (with a replica count of 1), by default\nit prefers running on the cluster’s master nodes but will run on worker\nnodes if no master nodes are found.

\n\n

For High Availability, you should simply increase the replica count of\nthe deployment object. You should also look into adding\ninter-pod\naffinity to prevent masters from running on the same node.\nHowever note that inter-pod affinity is costly and is not recommended\nin bigger clusters.

\n\n

NFD-Master listens for connections from nfd-worker(s) and connects to the\nKubernetes API server to add node labels advertised by them.

\n\n

If you have RBAC authorization enabled (as is the default e.g. with clusters\ninitialized with kubeadm) you need to configure the appropriate ClusterRoles,\nClusterRoleBindings and a ServiceAccount in order for NFD to create node\nlabels. The provided template will configure these for you.

\n\n

NFD-Worker

\n\n

NFD-Worker is preferably run as a Kubernetes DaemonSet. This assures\nre-labeling on regular intervals capturing changes in the system configuration\nand makes sure that new nodes are labeled as they are added to the cluster.\nWorker connects to the nfd-master service to advertise hardware features.

\n\n

When run as a daemonset, nodes are re-labeled at an default interval of 60s.\nThis can be changed by using the\ncore.sleepInterval\nconfig option (or\n-sleep-interval\ncommand line flag).

\n\n

The worker configuration file is watched and re-read on every change which\nprovides a simple mechanism of dynamic run-time reconfiguration. See\nworker configuration for more details.

\n\n

NFD-Topology-Updater

\n\n

NFD-Topology-Updater is preferably run as a Kubernetes DaemonSet. This assures\nre-examination (and CR updates) on regular intervals capturing changes in\nthe allocated resources and hence the allocatable resources on a per zone\nbasis. It makes sure that more CR instances are created as new nodes get\nadded to the cluster. Topology-Updater connects to the nfd-master service\nto create CR instances corresponding to nodes.

\n\n

When run as a daemonset, nodes are re-examined for the allocated resources\n(to determine the information of the allocatable resources on a per zone basis\nwhere a zone can be a NUMA node) at an interval specified using the\n-sleep-interval option. The default sleep interval is set to 60s which is the\n the value when no -sleep-interval is specified.

\n\n

Communication security with TLS

\n\n

NFD supports mutual TLS authentication between the nfd-master and nfd-worker\ninstances. That is, nfd-worker and nfd-master both verify that the other end\npresents a valid certificate.

\n\n

TLS authentication is enabled by specifying -ca-file, -key-file and\n-cert-file args, on both the nfd-master and nfd-worker instances. The\ntemplate specs provided with NFD contain (commented out) example configuration\nfor enabling TLS authentication.

\n\n

The Common Name (CN) of the nfd-master certificate must match the DNS name of\nthe nfd-master Service of the cluster. By default, nfd-master only check that\nthe nfd-worker has been signed by the specified root certificate (-ca-file).

\n\n

Additional hardening can be enabled by specifying -verify-node-name in\nnfd-master args, in which case nfd-master verifies that the NodeName presented\nby nfd-worker matches the Common Name (CN) or a Subject Alternative Name (SAN)\nof its certificate. Note that -verify-node-name complicates certificate\nmanagement and is not yet supported in the helm or kustomize deployment\nmethods.

\n\n

Automated TLS certificate management using cert-manager

\n\n

cert-manager can be used to automate certificate\nmanagement between nfd-master and the nfd-worker pods.

\n\n

The NFD source code repository contains an example kustomize overlay and helm\nchart that can be used to deploy NFD with cert-manager supplied certificates\nenabled.

\n\n

To install cert-manager itself can be done as easily as this, below, or you\ncan refer to their documentation for other installation methods such as the\nhelm chart they provide.

\n\n
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.6.1/cert-manager.yaml\n
\n\n

To use the kustomize overlay to install node-feature-discovery with TLS enabled,\nyou may use the following:

\n\n
kubectl apply -k deployment/overlays/samples/cert-manager\n
\n\n

To make use of the helm chart, override values.yaml to enable both the\ntls.enabled and tls.certManager options. Note that if you do not enable\ntls.certManager, helm will successfully install the application, but\ndeployment will wait until certificates are manually created, as demonstrated\nbelow.

\n\n

See the sample installation commands in the Helm Deployment\nand Configuration sections above for how to either override\nindividual values, or provide a yaml file with which to override default\nvalues.

\n\n

Manual TLS certificate management

\n\n

If you do not with to make use of cert-manager, the certificates can be\nmanually created and stored as secrets within the NFD namespace.

\n\n

Create a CA certificate

\n\n
openssl req -x509 -newkey rsa:4096 -keyout ca.key -nodes \\\n        -subj \"/CN=nfd-ca\" -days 10000 -out ca.crt\n
\n\n

Create a common openssl config file.

\n\n
cat <<EOF > nfd-common.conf\n[ req ]\ndefault_bits = 4096\nprompt = no\ndefault_md = sha256\nreq_extensions = req_ext\ndistinguished_name = dn\n\n[ dn ]\nC = XX\nST = some-state\nL = some-city\nO = some-company\nOU = node-feature-discovery\n\n[ req_ext ]\nsubjectAltName = @alt_names\n\n[ v3_ext ]\nauthorityKeyIdentifier=keyid,issuer:always\nbasicConstraints=CA:FALSE\nkeyUsage=keyEncipherment,dataEncipherment\nextendedKeyUsage=serverAuth,clientAuth\nsubjectAltName=@alt_names\nEOF\n
\n\n

Now, create the nfd-master certificate.

\n\n
cat <<EOF > nfd-master.conf\n.include nfd-common.conf\n\n[ dn ]\nCN = nfd-master\n\n[ alt_names ]\nDNS.1 = nfd-master\nDNS.2 = nfd-master.node-feature-discovery.svc.cluster.local\nDNS.3 = localhost\nEOF\n\nopenssl req -new -newkey rsa:4096 -keyout nfd-master.key -nodes -out nfd-master.csr -config nfd-master.conf\n
\n\n

Create certificates for nfd-worker and nfd-topology-updater

\n\n
cat <<EOF > nfd-worker.conf\n.include nfd-common.conf\n\n[ dn ]\nCN = nfd-worker\n\n[ alt_names ]\nDNS.1 = nfd-worker\nDNS.2 = nfd-worker.node-feature-discovery.svc.cluster.local\nEOF\n\n# Config for topology updater is identical except for the DN and alt_names\nsed -e 's/worker/topology-updater/g' < nfd-worker.conf > nfd-topology-updater.conf\n\nopenssl req -new -newkey rsa:4096 -keyout nfd-worker.key -nodes -out nfd-worker.csr -config nfd-worker.conf\nopenssl req -new -newkey rsa:4096 -keyout nfd-topology-updater.key -nodes -out nfd-topology-updater.csr -config nfd-topology-updater.conf\n
\n\n

Now, sign the certificates with the CA created earlier.

\n\n
for cert in nfd-master nfd-worker nfd-topology-updater; do\n  echo signing $cert\n  openssl x509 -req -in $cert.csr -CA ca.crt -CAkey ca.key \\\n    -CAcreateserial -out $cert.crt -days 10000 \\\n    -extensions v3_ext -extfile $cert.conf\ndone\n
\n\n

Finally, turn these certificates into secrets.

\n\n
for cert in nfd-master nfd-worker nfd-topology-updater; do\n  echo creating secret for $cert in node-feature-discovery namespace\n  cat <<EOF | kubectl create -n node-feature-discovery -f -\n---\napiVersion: v1\nkind: Secret\ntype: kubernetes.io/tls\nmetadata:\n  name: ${cert}-cert\ndata:\n  ca.crt: $( cat ca.crt | base64 -w 0 )\n  tls.crt: $( cat $cert.crt | base64 -w 0 )\n  tls.key: $( cat $cert.key | base64 -w 0 )\nEOF\n\ndone\n
\n\n

Worker configuration

\n\n

NFD-Worker supports dynamic configuration through a configuration file. The\ndefault location is /etc/kubernetes/node-feature-discovery/nfd-worker.conf,\nbut, this can be changed by specifying the-config command line flag.\nConfiguration file is re-read whenever it is modified which makes run-time\nre-configuration of nfd-worker straightforward.

\n\n

Worker configuration file is read inside the container, and thus, Volumes and\nVolumeMounts are needed to make your configuration available for NFD. The\npreferred method is to use a ConfigMap which provides easy deployment and\nre-configurability.

\n\n

The provided nfd-worker deployment templates create an empty configmap and\nmount it inside the nfd-worker containers. In kustomize deployments,\nconfiguration can be edited with:

\n\n
kubectl -n ${NFD_NS} edit configmap nfd-worker-conf\n
\n\n

In Helm deployments, Worker pod parameter\nworker.config can be used to edit the respective configuration.

\n\n

See\nnfd-worker configuration file reference\nfor more details.\nThe (empty-by-default)\nexample config\ncontains all available configuration options and can be used as a reference\nfor creating creating a configuration.

\n\n

Configuration options can also be specified via the -options command line\nflag, in which case no mounts need to be used. The same format as in the config\nfile must be used, i.e. JSON (or YAML). For example:

\n\n
-options='{\"sources\": { \"pci\": { \"deviceClassWhitelist\": [\"12\"] } } }'\n
\n\n

Configuration options specified from the command line will override those read\nfrom the config file.

\n\n

Using node labels

\n\n

Nodes with specific features can be targeted using the nodeSelector field. The\nfollowing example shows how to target nodes with Intel TurboBoost enabled.

\n\n
apiVersion: v1\nkind: Pod\nmetadata:\n  labels:\n    env: test\n  name: golang-test\nspec:\n  containers:\n    - image: golang\n      name: go1\n  nodeSelector:\n    feature.node.kubernetes.io/cpu-pstate.turbo: 'true'\n
\n\n

For more details on targeting nodes, see\nnode selection.

\n\n

Uninstallation

\n\n

Operator was used for deployment

\n\n

If you followed the deployment instructions above you can simply do:

\n\n
kubectl -n nfd delete NodeFeatureDiscovery my-nfd-deployment\n
\n\n

Optionally, you can also remove the namespace:

\n\n
kubectl delete ns nfd\n
\n\n

See the node-feature-discovery-operator and OLM project\ndocumentation for instructions for uninstalling the operator and operator\nlifecycle manager, respectively.

\n\n

Manual

\n\n

Simplest way is to invoke kubectl delete on the deployment files you used.\nBeware that this will also delete the namespace that NFD is running in. For\nexample, in case the default deployment from the repo was used:

\n\n
\nkubectl delete -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.11.2\n
\n\n

Alternatively you can delete create objects one-by-one, depending on the type\nof deployment, for example:

\n\n
NFD_NS=node-feature-discovery\nkubectl -n $NFD_NS delete ds nfd-worker\nkubectl -n $NFD_NS delete deploy nfd-master\nkubectl -n $NFD_NS delete svc nfd-master\nkubectl -n $NFD_NS delete sa nfd-master\nkubectl delete clusterrole nfd-master\nkubectl delete clusterrolebinding nfd-master\n
\n\n

Removing feature labels

\n\n

NFD-Master has a special -prune command line flag for removing all\nnfd-related node labels, annotations and extended resources from the cluster.

\n\n
kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/prune?ref=v0.11.2\nkubectl -n node-feature-discovery wait job.batch/nfd-prune --for=condition=complete && \\\n    kubectl delete -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/prune?ref=v0.11.2\n
\n\n

NOTE: You must run prune before removing the RBAC rules (serviceaccount,\nclusterrole and clusterrolebinding).

\n\n\n","dir":"/get-started/","name":"deployment-and-usage.md","path":"get-started/deployment-and-usage.md","url":"/get-started/deployment-and-usage.html"},{"title":"Worker config reference","layout":"default","sort":4,"content":"

Configuration file reference of nfd-worker

\n\n

Table of contents

\n\n
    \n
  1. core
      \n
    1. core.sleepInterval
    2. \n
    3. core.featureSources
    4. \n
    5. core.labelSources
    6. \n
    7. core.sources
    8. \n
    9. core.labelWhiteList
    10. \n
    11. core.noPublish
    12. \n
    13. core.klog
    14. \n
    \n
  2. \n
  3. sources
      \n
    1. sources.cpu
    2. \n
    3. sources.kernel
    4. \n
    5. soures.pci
    6. \n
    7. sources.usb
    8. \n
    9. sources.custom
    10. \n
    \n
  4. \n
\n\n
\n\n

See the\nsample configuration file\nfor a full example configuration.

\n\n

core

\n\n

The core section contains common configuration settings that are not specific\nto any particular feature source.

\n\n

core.sleepInterval

\n\n

core.sleepInterval specifies the interval between consecutive passes of\nfeature (re-)detection, and thus also the interval between node re-labeling. A\nnon-positive value implies infinite sleep interval, i.e. no re-detection or\nre-labeling is done.

\n\n

Note: Overridden by the deprecated -sleep-interval command line flag (if\nspecified).

\n\n

Default: 60s

\n\n

Example:

\n\n
core:\n  sleepInterval: 60s\n
\n\n

core.featureSources

\n\n

core.featureSources specifies the list of enabled feature sources. A special\nvalue all enables all sources. Prefixing a source name with - indicates\nthat the source will be disabled instead - this is only meaningful when used in\nconjunction with all. This option allows completely disabling the feature\ndetection so that neither standard feature labels are generated nor the raw\nfeature data is available for custom rule processing.

\n\n

Default: [all]

\n\n

Example:

\n\n
core:\n  # Enable all but cpu and local sources\n  featureSources:\n    - \"all\"\n    - \"-cpu\"\n    - \"-local\"\n
\n\n
core:\n  # Enable only cpu and local sources\n  featureSources:\n    - \"cpu\"\n    - \"local\"\n
\n\n

core.labelSources

\n\n

core.labelSources specifies the list of enabled label sources. A special\nvalue all enables all sources. Prefixing a source name with - indicates\nthat the source will be disabled instead - this is only meaningful when used in\nconjunction with all. This configuration option affects the generation of\nnode labels but not the actual discovery of the underlying feature data that is\nused e.g. in custom/NodeFeatureRule rules.

\n\n

Note: Overridden by the -label-sources and -sources command line flags and\nthe core.sources configurations option (if any of them is specified).

\n\n

Default: [all]

\n\n

Example:

\n\n
core:\n  # Enable all but cpu and system sources\n  labelSources:\n    - \"all\"\n    - \"-cpu\"\n    - \"-system\"\n
\n\n
core:\n  # Enable only cpu and system sources\n  labelSources:\n    - \"cpu\"\n    - \"system\"\n
\n\n

core.sources

\n\n

DEPRECATED: use core.labelSources instead.

\n\n

Note: core.sources takes precedence over the core.labelSources\nconfiguration file option.

\n\n

core.labelWhiteList

\n\n

core.labelWhiteList specifies a regular expression for filtering feature\nlabels based on the label name. Non-matching labels are not published.

\n\n

Note: The regular expression is only matches against the “basename” part of the\nlabel, i.e. to the part of the name after ‘/’. The label prefix (or namespace)\nis omitted.

\n\n

Note: Overridden by the deprecated -label-whitelist command line flag (if\nspecified).

\n\n

Default: null

\n\n

Example:

\n\n
core:\n  labelWhiteList: '^cpu-cpuid'\n
\n\n

core.noPublish

\n\n

Setting core.noPublish to true disables all communication with the\nnfd-master. It is effectively a “dry-run” flag: nfd-worker runs feature\ndetection normally, but no labeling requests are sent to nfd-master.

\n\n

Note: Overridden by the -no-publish command line flag (if specified).

\n\n

Default: false

\n\n

Example:

\n\n
core:\n  noPublish: true\n
\n\n

core.klog

\n\n

The following options specify the logger configuration. Most of which can be\ndynamically adjusted at run-time.

\n\n

Note: The logger options can also be specified via command line flags which\ntake precedence over any corresponding config file options.

\n\n

core.klog.addDirHeader

\n\n

If true, adds the file directory to the header of the log messages.

\n\n

Default: false

\n\n

Run-time configurable: yes

\n\n

core.klog.alsologtostderr

\n\n

Log to standard error as well as files.

\n\n

Default: false

\n\n

Run-time configurable: yes

\n\n

core.klog.logBacktraceAt

\n\n

When logging hits line file:N, emit a stack trace.

\n\n

Default: empty

\n\n

Run-time configurable: yes

\n\n

core.klog.logDir

\n\n

If non-empty, write log files in this directory.

\n\n

Default: empty

\n\n

Run-time configurable: no

\n\n

core.klog.logFile

\n\n

If non-empty, use this log file.

\n\n

Default: empty

\n\n

Run-time configurable: no

\n\n

core.klog.logFileMaxSize

\n\n

Defines the maximum size a log file can grow to. Unit is megabytes. If the\nvalue is 0, the maximum file size is unlimited.

\n\n

Default: 1800

\n\n

Run-time configurable: no

\n\n

core.klog.logtostderr

\n\n

Log to standard error instead of files

\n\n

Default: true

\n\n

Run-time configurable: yes

\n\n

core.klog.skipHeaders

\n\n

If true, avoid header prefixes in the log messages.

\n\n

Default: false

\n\n

Run-time configurable: yes

\n\n

core.klog.skipLogHeaders

\n\n

If true, avoid headers when opening log files.

\n\n

Default: false

\n\n

Run-time configurable: no

\n\n

core.klog.stderrthreshold

\n\n

Logs at or above this threshold go to stderr (default 2)

\n\n

Run-time configurable: yes

\n\n

core.klog.v

\n\n

Number for the log level verbosity.

\n\n

Default: 0

\n\n

Run-time configurable: yes

\n\n

core.klog.vmodule

\n\n

Comma-separated list of pattern=N settings for file-filtered logging.

\n\n

Default: empty

\n\n

Run-time configurable: yes

\n\n

sources

\n\n

The sources section contains feature source specific configuration parameters.

\n\n

sources.cpu

\n\n

sources.cpu.cpuid

\n\n
sources.cpu.cpuid.attributeBlacklist
\n\n

Prevent publishing cpuid features listed in this option.

\n\n

Note: overridden by sources.cpu.cpuid.attributeWhitelist (if specified)

\n\n

Default: [BMI1, BMI2, CLMUL, CMOV, CX16, ERMS, F16C, HTT, LZCNT, MMX, MMXEXT,\nNX, POPCNT, RDRAND, RDSEED, RDTSCP, SGX, SGXLC, SSE, SSE2, SSE3, SSE4.1,\nSSE4.2, SSSE3]

\n\n

Example:

\n\n
sources:\n  cpu:\n    cpuid:\n      attributeBlacklist: [MMX, MMXEXT]\n
\n\n
sources.cpu.cpuid.attributeWhitelist
\n\n

Only publish the cpuid features listed in this option.

\n\n

Note: takes precedence over sources.cpu.cpuid.attributeBlacklist

\n\n

Default: empty

\n\n

Example:

\n\n
sources:\n  cpu:\n    cpuid:\n      attributeWhitelist: [AVX512BW, AVX512CD, AVX512DQ, AVX512F, AVX512VL]\n
\n\n

sources.kernel

\n\n

sources.kernel.kconfigFile

\n\n

Path of the kernel config file. If empty, NFD runs a search in the well-known\nstandard locations.

\n\n

Default: empty

\n\n

Example:

\n\n
sources:\n  kernel:\n    kconfigFile: \"/path/to/kconfig\"\n
\n\n

sources.kernel.configOpts

\n\n

Kernel configuration options to publish as feature labels.

\n\n

Default: [NO_HZ, NO_HZ_IDLE, NO_HZ_FULL, PREEMPT]

\n\n

Example:

\n\n
sources:\n  kernel:\n    configOpts: [NO_HZ, X86, DMI]\n
\n\n

soures.pci

\n\n

soures.pci.deviceClassWhitelist

\n\n

List of PCI device class IDs for which to\npublish a label. Can be specified as a main class only (e.g. 03) or full\nclass-subclass combination (e.g. 0300) - the former implies that all\nsubclasses are accepted. The format of the labels can be further configured\nwith deviceLabelFields.

\n\n

Default: [\"03\", \"0b40\", \"12\"]

\n\n

Example:

\n\n
sources:\n  pci:\n    deviceClassWhitelist: [\"0200\", \"03\"]\n
\n\n

soures.pci.deviceLabelFields

\n\n

The set of PCI ID fields to use when constructing the name of the feature\nlabel. Valid fields are class, vendor, device, subsystem_vendor and\nsubsystem_device.

\n\n

Default: [class, vendor]

\n\n

Example:

\n\n
sources:\n  pci:\n    deviceLabelFields: [class, vendor, device]\n
\n\n

With the example config above NFD would publish labels like:\nfeature.node.kubernetes.io/pci-<class-id>_<vendor-id>_<device-id>.present=true

\n\n

sources.usb

\n\n

soures.usb.deviceClassWhitelist

\n\n

List of USB device class IDs for\nwhich to publish a feature label. The format of the labels can be further\nconfigured with deviceLabelFields.

\n\n

Default: [\"0e\", \"ef\", \"fe\", \"ff\"]

\n\n

Example:

\n\n
sources:\n  usb:\n    deviceClassWhitelist: [\"ef\", \"ff\"]\n
\n\n

soures.usb.deviceLabelFields

\n\n

The set of USB ID fields from which to compose the name of the feature label.\nValid fields are class, vendor, device and serial.

\n\n

Default: [class, vendor, device]

\n\n

Example:

\n\n
sources:\n  pci:\n    deviceLabelFields: [class, vendor]\n
\n\n

With the example config above NFD would publish labels like:\nfeature.node.kubernetes.io/usb-<class-id>_<vendor-id>.present=true

\n\n

sources.custom

\n\n

List of rules to process in the custom feature source to create user-specific\nlabels. Refer to the documentation of the\ncustom feature source for\ndetails of the available rules and their configuration.

\n\n

Default: empty

\n\n

Example:

\n\n
sources:\n  custom:\n    - name: \"my custom rule\"\n      labels:\n        my-custom-feature: \"true\"\n      matchFeatures:\n        - feature: kernel.loadedmodule\n          matchExpressions:\n            e1000e: {op: Exists}\n        - feature: pci.device\n          matchExpressions:\n            class: {op: In, value: [\"0200\"]}\n            vendor: {op: In, value: [\"8086\"]}\n
\n","dir":"/advanced/","name":"worker-configuration-reference.md","path":"advanced/worker-configuration-reference.md","url":"/advanced/worker-configuration-reference.html"},{"title":"Feature labels","layout":"default","sort":4,"content":"

Feature labels

\n\n

Table of contents

\n\n
    \n
  1. Built-in labels
      \n
    1. CPU
    2. \n
    3. IOMMU (deprecated)
    4. \n
    5. Kernel
    6. \n
    7. Memory
    8. \n
    9. Network
    10. \n
    11. PCI
    12. \n
    13. USB
    14. \n
    15. Storage
    16. \n
    17. System
    18. \n
    19. Custom
    20. \n
    \n
  2. \n
  3. User defined labels
  4. \n
  5. Extended resources
  6. \n
\n\n
\n\n

Features are advertised as labels in the Kubernetes Node object.

\n\n

Built-in labels

\n\n

Label creation in nfd-worker is performed by a set of separate modules called\nlabel sources. The\ncore.labelSources\nconfiguration option (or\n-label-sources\nflag) of nfd-worker controls which sources to enable for label generation.

\n\n

All built-in labels use the feature.node.kubernetes.io label namespace and\nhave the following format.

\n\n
feature.node.kubernetes.io/<feature> = <value>\n
\n\n

Note: Consecutive runs of nfd-worker will update the labels on a\ngiven node. If features are not discovered on a consecutive run, the corresponding\nlabel will be removed. This includes any restrictions placed on the consecutive run,\nsuch as restricting discovered features with the -label-whitelist option.

\n\n

CPU

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Feature nameValueDescription
cpu-cpuid.<cpuid-flag>trueCPU capability is supported. NOTE: the capability might be supported but not enabled.
cpu-hardware_multithreadingtrueHardware multithreading, such as Intel HTT, enabled (number of logical CPUs is greater than physical CPUs)
cpu-power.sst_bf.enabledtrueIntel SST-BF (Intel Speed Select Technology - Base frequency) enabled
cpu-pstate.statusstringThe status of the Intel pstate driver when in use and enabled, either ‘active’ or ‘passive’.
cpu-pstate.turboboolSet to ‘true’ if turbo frequencies are enabled in Intel pstate driver, set to ‘false’ if they have been disabled.
cpu-pstate.scaling_governorstringThe value of the Intel pstate scaling_governor when in use, either ‘powersave’ or ‘performance’.
cpu-cstate.enabledboolSet to ‘true’ if cstates are set in the intel_idle driver, otherwise set to ‘false’. Unset if intel_idle cpuidle driver is not active.
cpu-rdt.<rdt-flag>trueIntel RDT capability is supported. See RDT flags for details.
cpu-sgx.enabledtrueSet to ‘true’ if Intel SGX is enabled in BIOS (based a non-zero sum value of SGX EPC section sizes).
cpu-se.enabledtrueSet to ‘true’ if IBM Secure Execution for Linux (IBM Z & LinuxONE) is available and enabled (requires /sys/firmware/uv/prot_virt_host facility)
cpu-model.vendor_idstringComparable CPU vendor ID.
cpu-model.familyintCPU family.
cpu-model.idintCPU model number.
\n\n

The CPU label source is configurable, see\nworker configuration and\nsources.cpu\nconfiguration options for details.

\n\n

X86 CPUID flags (partial list)

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FlagDescription
ADXMulti-Precision Add-Carry Instruction Extensions (ADX)
AESNIAdvanced Encryption Standard (AES) New Instructions (AES-NI)
AVXAdvanced Vector Extensions (AVX)
AVX2Advanced Vector Extensions 2 (AVX2)
AMXBF16Advanced Matrix Extension, tile multiplication operations on BFLOAT16 numbers
AMXINT8Advanced Matrix Extension, tile multiplication operations on 8-bit integers
AMXTILEAdvanced Matrix Extension, base tile architecture support
AVX512BF16AVX-512 BFLOAT16 instructions
AVX512BITALGAVX-512 bit Algorithms
AVX512BWAVX-512 byte and word Instructions
AVX512CDAVX-512 conflict detection instructions
AVX512DQAVX-512 doubleword and quadword instructions
AVX512ERAVX-512 exponential and reciprocal instructions
AVX512FAVX-512 foundation
AVX512FP16AVX-512 FP16 instructions
AVX512IFMAAVX-512 integer fused multiply-add instructions
AVX512PFAVX-512 prefetch instructions
AVX512VBMIAVX-512 vector bit manipulation instructions
AVX512VBMI2AVX-512 vector bit manipulation instructions, version 2
AVX512VLAVX-512 vector length extensions
AVX512VNNIAVX-512 vector neural network instructions
AVX512VP2INTERSECTAVX-512 intersect for D/Q
AVX512VPOPCNTDQAVX-512 vector population count doubleword and quadword
ENQCMDEnqueue Command
GFNIGalois Field New Instructions
HYPERVISORRunning under hypervisor
VAESAVX-512 vector AES instructions
VPCLMULQDQCarry-less multiplication quadword
\n\n

By default, the following CPUID flags have been blacklisted: BMI1, BMI2, CLMUL,\nCMOV, CX16, ERMS, F16C, HTT, LZCNT, MMX, MMXEXT, NX, POPCNT, RDRAND, RDSEED,\nRDTSCP, SGX, SSE, SSE2, SSE3, SSE4, SSE42 and SSSE3. See\nsources.cpu\nconfiguration options to change the behavior.

\n\n

See the full list in github.com/klauspost/cpuid.

\n\n

Arm CPUID flags (partial list)

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FlagDescription
IDIVAInteger divide instructions available in ARM mode
IDIVTInteger divide instructions available in Thumb mode
THUMBThumb instructions
FASTMULFast multiplication
VFPVector floating point instruction extension (VFP)
VFPv3Vector floating point extension v3
VFPv4Vector floating point extension v4
VFPD32VFP with 32 D-registers
HALFHalf-word loads and stores
EDSPDSP extensions
NEONNEON SIMD instructions
LPAELarge Physical Address Extensions
\n\n

Arm64 CPUID flags (partial list)

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FlagDescription
AESAnnouncing the Advanced Encryption Standard
EVSTRMEvent Stream Frequency Features
FPHPHalf Precision(16bit) Floating Point Data Processing Instructions
ASIMDHPHalf Precision(16bit) Asimd Data Processing Instructions
ATOMICSAtomic Instructions to the A64
ASIMRDMSupport for Rounding Double Multiply Add/Subtract
PMULLOptional Cryptographic and CRC32 Instructions
JSCVTPerform Conversion to Match Javascript
DCPOPPersistent Memory Support
\n\n

Intel RDT flags

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FlagDescription
RDTMONIntel RDT Monitoring Technology
RDTCMTIntel Cache Monitoring (CMT)
RDTMBMIntel Memory Bandwidth Monitoring (MBM)
RDTL3CAIntel L3 Cache Allocation Technology
RDTl2CAIntel L2 Cache Allocation Technology
RDTMBAIntel Memory Bandwidth Allocation (MBA) Technology
\n\n

IOMMU (deprecated)

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureValueDescription
iommu.enabledtrueIOMMU is present and enabled in the kernel
\n\n

DEPRECATED: The iommu source is deprecated and not enabled by default.

\n\n

Kernel

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureValueDescription
kernel-config.<option>trueKernel config option is enabled (set ‘y’ or ‘m’). Default options are NO_HZ, NO_HZ_IDLE, NO_HZ_FULL and PREEMPT
kernel-selinux.enabledtrueSelinux is enabled on the node
kernel-version.fullstringFull kernel version as reported by /proc/sys/kernel/osrelease (e.g. ‘4.5.6-7-g123abcde’)
kernel-version.majorstringFirst component of the kernel version (e.g. ‘4’)
kernel-version.minorstringSecond component of the kernel version (e.g. ‘5’)
kernel-version.revisionstringThird component of the kernel version (e.g. ‘6’)
\n\n

The kernel label source is configurable, see\nworker configuration and\nsources.kernel\nconfiguration options for details.

\n\n

Memory

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureValueDescription
memory-numatrueMultiple memory nodes i.e. NUMA architecture detected
memory-nv.presenttrueNVDIMM device(s) are present
memory-nv.daxtrueNVDIMM region(s) configured in DAX mode are present
\n\n

Network

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureValueDescription
network-sriov.capabletrueSingle Root Input/Output Virtualization (SR-IOV) enabled Network Interface Card(s) present
network-sriov.configuredtrueSR-IOV virtual functions have been configured
\n\n

PCI

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureValueDescription
pci-<device label>.presenttruePCI device is detected
pci-<device label>.sriov.capabletrueSingle Root Input/Output Virtualization (SR-IOV) enabled PCI device present
\n\n

<device label> is format is configurable and set to <class>_<vendor> by\ndefault. For more more details about configuration of the pci labels, see\nsources.pci options\nand worker configuration\ninstructions.

\n\n

USB

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureValueDescription
usb-<device label>.presenttrueUSB device is detected
\n\n

<device label> is format is configurable and set to\n<class>_<vendor>_<device> by default. For more more details about\nconfiguration of the usb labels, see\nsources.usb options\nand worker configuration\ninstructions.

\n\n

Storage

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureValueDescription
storage-nonrotationaldisktrueNon-rotational disk, like SSD, is present in the node
\n\n

System

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureValueDescription
system-os_release.IDstringOperating system identifier
system-os_release.VERSION_IDstringOperating system version identifier (e.g. ‘6.7’)
system-os_release.VERSION_ID.majorstringFirst component of the OS version id (e.g. ‘6’)
system-os_release.VERSION_ID.minorstringSecond component of the OS version id (e.g. ‘7’)
\n\n

Custom

\n\n

The custom label source is designed for creating\nuser defined labels. However, it has a few statically\ndefined built-in labels:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureValueDescription
custom-rdma.capabletrueThe node has an RDMA capable Network adapter
custom-rdma.enabledtrueThe node has the needed RDMA modules loaded to run RDMA traffic
\n\n

User defined labels

\n\n

NFD has many extension points for creating vendor and application specific\nlabels. See the customization guide for\ndetailed documentation.

\n\n

Extended resources

\n\n

This feature is experimental and by no means a replacement for the usage of\ndevice plugins.

\n\n

Labels which have integer values, can be promoted to Kubernetes extended\nresources by listing them to the master -resource-labels command line flag.\nThese labels won’t then show in the node label section, they will appear only\nas extended resources.

\n\n

An example use-case for the extended resources could be based on a hook which\ncreates a label for the node SGX EPC memory section size. By giving the name of\nthat label in the -resource-labels flag, that value will then turn into an\nextended resource of the node, allowing PODs to request that resource and the\nKubernetes scheduler to schedule such PODs to only those nodes which have a\nsufficient capacity of said resource left.

\n\n

Similar to labels, the default namespace feature.node.kubernetes.io is\nautomatically prefixed to the extended resource, if the promoted label doesn’t\nhave a namespace.

\n\n

Example usage of the command line arguments, using a new namespace:\nnfd-master -resource-labels=my_source-my.feature,sgx.some.ns/epc -extra-label-ns=sgx.some.ns

\n\n

The above would result in following extended resources provided that related\nlabels exist:

\n\n
  sgx.some.ns/epc: <label value>\n  feature.node.kubernetes.io/my_source-my.feature: <label value>\n
\n\n\n","dir":"/get-started/","name":"features.md","path":"get-started/features.md","url":"/get-started/features.html"},{"title":"Examples and demos","layout":"default","sort":5,"content":"

Examples and demos

\n\n

Table of contents

\n\n
    \n
  1. Demos
      \n
    1. Usage demo
    2. \n
    3. Demo use case
    4. \n
    \n
  2. \n
\n\n
\n\n

This page contains usage examples and demos.

\n\n

Demos

\n\n

Usage demo

\n\n

\"asciicast\"

\n\n

Demo use case

\n\n

A demo on the benefits of using node feature discovery can be found in the\nsource code repository under\ndemo/.

\n","dir":"/get-started/","name":"examples-and-demos.md","path":"get-started/examples-and-demos.md","url":"/get-started/examples-and-demos.html"},{"title":"Topology Updater Cmdline Reference","layout":"default","sort":5,"content":"

NFD-Topology-Updater Commandline Flags

\n\n

Table of Contents

\n\n
    \n
  1. NFD-Topology-Updater Commandline Flags
      \n
    1. -h, -help
    2. \n
    3. -version
    4. \n
    5. -server
    6. \n
    7. -ca-file
    8. \n
    9. -cert-file
    10. \n
    11. -key-file
    12. \n
    13. -server-name-override
    14. \n
    15. -no-publish
    16. \n
    17. -oneshot
    18. \n
    19. -sleep-interval
    20. \n
    21. -watch-namespace
    22. \n
    23. -kubelet-config-file
    24. \n
    25. -podresources-socket
    26. \n
    \n
  2. \n
\n\n
\n\n

To quickly view available command line flags execute nfd-topology-updater -help.\nIn a docker container:

\n\n
docker run gcr.io/k8s-staging-nfd/node-feature-discovery:master nfd-topology-updater -help\n
\n\n

-h, -help

\n\n

Print usage and exit.

\n\n

-version

\n\n

Print version and exit.

\n\n

-server

\n\n

The -server flag specifies the address of the nfd-master endpoint where to\nconnect to.

\n\n

Default: localhost:8080

\n\n

Example:

\n\n
nfd-topology-updater -server=nfd-master.nfd.svc.cluster.local:443\n
\n\n

-ca-file

\n\n

The -ca-file is one of the three flags (together with -cert-file and\n-key-file) controlling the mutual TLS authentication on the topology-updater side.\nThis flag specifies the TLS root certificate that is used for verifying the\nauthenticity of nfd-master.

\n\n

Default: empty

\n\n

Note: Must be specified together with -cert-file and -key-file

\n\n

Example:

\n\n
nfd-topology-updater -ca-file=/opt/nfd/ca.crt -cert-file=/opt/nfd/updater.crt -key-file=/opt/nfd/updater.key\n
\n\n

-cert-file

\n\n

The -cert-file is one of the three flags (together with -ca-file and\n-key-file) controlling mutual TLS authentication on the topology-updater\nside. This flag specifies the TLS certificate presented for authenticating\noutgoing requests.

\n\n

Default: empty

\n\n

Note: Must be specified together with -ca-file and -key-file

\n\n

Example:

\n\n
nfd-topology-updater -cert-file=/opt/nfd/updater.crt -key-file=/opt/nfd/updater.key -ca-file=/opt/nfd/ca.crt\n
\n\n

-key-file

\n\n

The -key-file is one of the three flags (together with -ca-file and\n-cert-file) controlling the mutual TLS authentication on topology-updater\nside. This flag specifies the private key corresponding the given certificate file\n(-cert-file) that is used for authenticating outgoing requests.

\n\n

Default: empty

\n\n

Note: Must be specified together with -cert-file and -ca-file

\n\n

Example:

\n\n
nfd-topology-updater -key-file=/opt/nfd/updater.key -cert-file=/opt/nfd/updater.crt -ca-file=/opt/nfd/ca.crt\n
\n\n

-server-name-override

\n\n

The -server-name-override flag specifies the common name (CN) which to\nexpect from the nfd-master TLS certificate. This flag is mostly intended for\ndevelopment and debugging purposes.

\n\n

Default: empty

\n\n

Example:

\n\n
nfd-topology-updater -server-name-override=localhost\n
\n\n

-no-publish

\n\n

The -no-publish flag disables all communication with the nfd-master, making\nit a “dry-run” flag for nfd-topology-updater. NFD-Topology-Updater runs\nresource hardware topology detection normally, but no CR requests are sent to\nnfd-master.

\n\n

Default: false

\n\n

Example:

\n\n
nfd-topology-updater -no-publish\n
\n\n

-oneshot

\n\n

The -oneshot flag causes nfd-topology-updater to exit after one pass of\nresource hardware topology detection.

\n\n

Default: false

\n\n

Example:

\n\n
nfd-topology-updater -oneshot -no-publish\n
\n\n

-sleep-interval

\n\n

The -sleep-interval specifies the interval between resource hardware\ntopology re-examination (and CR updates). A non-positive value implies\ninfinite sleep interval, i.e. no re-detection is done.

\n\n

Default: 60s

\n\n

Example:

\n\n
nfd-topology-updater -sleep-interval=1h\n
\n\n

-watch-namespace

\n\n

The -watch-namespace specifies the namespace to ensure that resource\nhardware topology examination only happens for the pods running in the\nspecified namespace. Pods that are not running in the specified namespace\nare not considered during resource accounting. This is particularly useful\nfor testing/debugging purpose. A “*” value would mean that all the pods would\nbe considered during the accounting process.

\n\n

Default: “*”

\n\n

Example:

\n\n
nfd-topology-updater -watch-namespace=rte\n
\n\n

-kubelet-config-file

\n\n

The -kubelet-config-file specifies the path to the Kubelet’s configuration\nfile.

\n\n

Default: /host-var/lib/kubelet/config.yaml

\n\n

Example:

\n\n
nfd-topology-updater -kubelet-config-file=/var/lib/kubelet/config.yaml\n
\n\n

-podresources-socket

\n\n

The -podresources-socket specifies the path to the Unix socket where kubelet\nexports a gRPC service to enable discovery of in-use CPUs and devices, and to\nprovide metadata for them.

\n\n

Default: /host-var/lib/kubelet/pod-resources/kubelet.sock

\n\n

Example:

\n\n
nfd-topology-updater -podresources-socket=/var/lib/kubelet/pod-resources/kubelet.sock\n
\n","dir":"/advanced/","name":"topology-updater-commandline-reference.md","path":"advanced/topology-updater-commandline-reference.md","url":"/advanced/topology-updater-commandline-reference.html"},{"title":"Customization guide","layout":"default","sort":5,"content":"

Customization guide

\n\n

Table of contents

\n\n
    \n
  1. Overview
  2. \n
  3. NodeFeatureRule custom resource
      \n
    1. A NodeFeatureRule example
    2. \n
    3. NodeFeatureRule controller
    4. \n
    \n
  4. \n
  5. Local feature source
      \n
    1. A hook example
    2. \n
    3. Hooks
    4. \n
    5. Feature files
    6. \n
    7. Input format
    8. \n
    9. Mounts
    10. \n
    \n
  6. \n
  7. Custom feature source
      \n
    1. An example custom feature source configuration
    2. \n
    3. Additional configuration directory
    4. \n
    \n
  8. \n
  9. Node labels
  10. \n
  11. Label rule format
      \n
    1. Fields
    2. \n
    3. Available features
    4. \n
    5. Templating
    6. \n
    7. Backreferences
    8. \n
    9. Examples
    10. \n
    \n
  12. \n
  13. Legacy custom rule syntax
      \n
    1. General nomenclature and definitions
    2. \n
    3. Custom features format (using the nomenclature defined above)
    4. \n
    5. Matching process
    6. \n
    7. Rules
    8. \n
    9. Legacy custom rule example
    10. \n
    \n
  14. \n
\n\n
\n\n

Overview

\n\n

NFD provides multiple extension points for vendor and application specific\nlabeling:

\n\n\n\n

NodeFeatureRule custom resource

\n\n

NodeFeatureRule objects provide an easy way to create vendor or application\nspecific labels. It uses a flexible rule-based mechanism for creating labels\nbased on node feature.

\n\n

A NodeFeatureRule example

\n\n

Consider the following referential example:

\n\n
apiVersion: nfd.k8s-sigs.io/v1alpha1\nkind: NodeFeatureRule\nmetadata:\n  name: my-sample-rule-object\nspec:\n  rules:\n    - name: \"my sample rule\"\n      labels:\n        \"my-sample-feature\": \"true\"\n      matchFeatures:\n        - feature: kernel.loadedmodule\n          matchExpressions:\n            dummy: {op: Exists}\n        - feature: kernel.config\n          matchExpressions:\n            X86: {op: In, value: [\"y\"]}\n
\n\n

It specifies one rule which creates node label\nfeature.node.kubenernetes.io/my-sample-feature=true if both of the following\nconditions are true (matchFeatures implements a logical AND over the\nmatchers):

\n\n\n\n

Create a NodeFeatureRule with a yaml file:

\n\n
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/node-feature-discovery/v0.11.2/examples/nodefeaturerule.yaml\n
\n\n

Now, on X86 platforms the feature label appears after doing modprobe dummy on\na system and correspondingly the label is removed after rmmod dummy. Note a\nre-labeling delay up to the sleep-interval of nfd-worker (1 minute by default).

\n\n

NodeFeatureRule controller

\n\n

NFD-Master acts as the controller for NodeFeatureRule objects. It applies these\nrules on raw feature data received from nfd-worker instances and creates node\nlabels, accordingly.

\n\n

NOTE nfd-master is stateless and (re-)labelling only happens when a request\nis received from nfd-worker. That is, in practice rules are evaluated and\nlabels for each node are created on intervals specified by the\ncore.sleepInterval\nconfiguration option (or\n-sleep-interval command line\nflag) of nfd-worker instances. This means that modification or creation of\nNodeFeatureRule objects does not instantly cause the node labels to be updated.\nInstead, the changes only come visible in node labels as nfd-worker instances\nsend their labelling requests.

\n\n

Local feature source

\n\n

NFD-Worker has a special feature source named local which is an integration\npoint for external feature detectors. It provides a mechanism for pluggable\nextensions, allowing the creation of new user-specific features and even\noverriding built-in labels.

\n\n

The local feature source has two methods for detecting features, hooks and\nfeature files. The features discovered by the local source can further be\nused in label rules specified in\nNodeFeatureRule objects and the\ncustom feature source.

\n\n

NOTE: Be careful when creating and/or updating hook or feature files while\nNFD is running. In order to avoid race conditions you should write into a\ntemporary file (outside the source.d and features.d directories), and,\natomically create/update the original file by doing a filesystem move\noperation.

\n\n

A hook example

\n\n

Consider a shell script\n/etc/kubernetes/node-feature-discovery/source.d/my-hook.sh having the\nfollowing stdout output, or alternatively, a plaintext file\n/etc/kubernetes/node-feature-discovery/features.d/my-features having the\nfollowing contents:

\n\n
my-feature.1\nmy-feature.2=myvalue\nmy.namespace/my-feature.3=456\n
\n\n

This will translate into the following node labels:

\n\n
feature.node.kubernetes.io/my-feature.1: \"true\"\nfeature.node.kubernetes.io/my-feature.2: \"myvalue\"\nmy.namespace/my-feature.3: \"456\"\n
\n\n

Note that in the example above -extra-label-ns=my.namespace must be specified\non the nfd-master command line.

\n\n

Hooks

\n\n

The local source executes hooks found in\n/etc/kubernetes/node-feature-discovery/source.d/. The hook files must be\nexecutable and they are supposed to print all discovered features in stdout.\nWith ELF binaries static linking is recommended as the selection of system\nlibraries available in the NFD release image is very limited. Other runtimes\ncurrently supported by the NFD image are bash and perl.

\n\n

stderr output of hooks is propagated to NFD log so it can be used for\ndebugging and logging.

\n\n

NFD tries to execute any regular files found from the hooks directory.\nAny additional data files the hook might need (e.g. a configuration file)\nshould be placed in a separate directory in order to avoid NFD unnecessarily\ntrying to execute them. A subdirectory under the hooks directory can be used,\nfor example /etc/kubernetes/node-feature-discovery/source.d/conf/.

\n\n

NOTE: NFD will blindly run any executables placed/mounted in the hooks\ndirectory. It is the user’s responsibility to review the hooks for e.g.\npossible security implications.

\n\n

NOTE: The minimal image\nvariant only supports running statically linked binaries.

\n\n

Feature files

\n\n

The local source reads files found in\n/etc/kubernetes/node-feature-discovery/features.d/.

\n\n

Input format

\n\n

The hook stdout and feature files are expected to contain features in simple\nkey-value pairs, separated by newlines:

\n\n
<name>[=<value>]\n
\n\n

The label value defaults to true, if not specified.

\n\n

Label namespace may be specified with <namespace>/<name>[=<value>]. The\nnamespace must be explicitly allowed with the -extra-label-ns command line\nflag of nfd-master if using something else than\n[<sub-ns>.]feature.node.kubernetes.io or\n[<sub-ns>.]profile.node.kubernetes.io.

\n\n

Mounts

\n\n

The standard NFD deployments contain hostPath mounts for\n/etc/kubernetes/node-feature-discovery/source.d/ and\n/etc/kubernetes/node-feature-discovery/features.d/, making these directories\nfrom the host available inside the nfd-worker container.

\n\n

Injecting labels from other pods

\n\n

One use case for the hooks and/or feature files is detecting features in other\nPods outside NFD, e.g. in Kubernetes device plugins. By using the same\nhostPath mounts for /etc/kubernetes/node-feature-discovery/source.d/ and\n/etc/kubernetes/node-feature-discovery/features.d/ in the side-car (e.g.\ndevice plugin) creates a shared area for deploying hooks and feature files to\nNFD. NFD will periodically scan the directories and run any hooks and read any\nfeature files it finds.

\n\n

Custom feature source

\n\n

The custom feature source in nfd-worker provides a rule-based mechanism for\nlabel creation, similar to the\nNodeFeatureRule objects. The difference is\nthat the rules are specified in the worker configuration instead of a\nKubernetes API object.

\n\n

See worker configuration\nfor instructions how to set-up and manage the worker configuration.

\n\n

An example custom feature source configuration

\n\n

Consider the following referential configuration for nfd-worker:

\n\n
core:\n  labelSources: [\"custom\"]\nsources:\n  custom:\n    - name: \"my sample rule\"\n      labels:\n        \"my-sample-feature\": \"true\"\n      matchFeatures:\n        - feature: kernel.loadedmodule\n          matchExpressions:\n            dummy: {op: Exists}\n        - feature: kernel.config\n          matchExpressions:\n            X86: {op: In, value: [\"y\"]}\n
\n\n

It specifies one rule which creates node label\nfeature.node.kubenernetes.io/my-sample-feature=true if both of the following\nconditions are true (matchFeatures implements a logical AND over the\nmatchers):

\n\n\n\n

In addition, the configuration only enables the custom source, disabling all\nbuilt-in labels.

\n\n

Now, on X86 platforms the feature label appears after doing modprobe dummy on\na system and correspondingly the label is removed after rmmod dummy. Note a\nre-labeling delay up to the sleep-interval of nfd-worker (1 minute by default).

\n\n

Additional configuration directory

\n\n

In addition to the rules defined in the nfd-worker configuration file, the\ncustom feature source can read more configuration files located in the\n/etc/kubernetes/node-feature-discovery/custom.d/ directory. This makes more\ndynamic and flexible configuration easier.

\n\n

As an example, consider having file\n/etc/kubernetes/node-feature-discovery/custom.d/my-rule.yaml with the\nfollowing content:

\n\n
- name: \"my e1000 rule\"\n  labels:\n    \"e1000.present\": \"true\"\n  matchFeatures:\n    - feature: kernel.loadedmodule\n      matchExpressions:\n        e1000: {op: Exists}\n
\n\n

This simple rule will create feature.node.kubenernetes.io/e1000.present=true\nlabel if the e1000 kernel module has been loaded.

\n\n

The\nsamples/custom-rules\nkustomize overlay sample contains an example for deploying a custom rule from a\nConfigMap.

\n\n

Node labels

\n\n

Feature labels have the following format:

\n\n
<namespace>/<name> = <value>\n
\n\n

The namespace part (i.e. prefix) of the labels is controlled by nfd:

\n\n\n\n

Label rule format

\n\n

This section describes the rule format used in\nNodeFeatureRule objects and in the\nconfiguration of the custom feature source.

\n\n

It is based on a generic feature matcher that covers all features discovered by\nnfd-worker. The rules rely on a unified data model of the available features\nand a generic expression-based format. Features that can be used in the rules\nare described in detail in available features below.

\n\n

Take this rule as a referential example:

\n\n
    - name: \"my feature rule\"\n      labels:\n        \"my-special-feature\": \"my-value\"\n      matchFeatures:\n        - feature: cpu.cpuid\n          matchExpressions:\n            AVX512F: {op: Exists}\n        - feature: kernel.version\n          matchExpressions:\n            major: {op: In, value: [\"5\"]}\n            minor: {op: Gt, value: [\"1\"]}\n        - feature: pci.device\n          matchExpressions:\n            vendor: {op: In, value: [\"8086\"]}\n            class: {op: In, value: [\"0200\"]}\n
\n\n

This will yield feature.node.kubenernetes.io/my-special-feature=my-value node\nlabel if all of these are true (matchFeatures implements a logical AND over\nthe matchers):

\n\n\n\n

Fields

\n\n

Name

\n\n

The .name field is required and used as an identifier of the rule.

\n\n

Labels

\n\n

The .labels is a map of the node labels to create if the rule matches.

\n\n

Labels template

\n\n

The .labelsTemplate field specifies a text template for dynamically creating\nlabels based on the matched features. See templating for\ndetails.

\n\n

NOTE The labels field has priority over labelsTemplate, i.e.\nlabels specified in the labels field will override anything\noriginating from labelsTemplate.

\n\n

Vars

\n\n

The .vars field is a map of values (key-value pairs) to store for subsequent\nrules to use. In other words, these are variables that are not advertised as\nnode labels. See backreferences for more details on the\nusage of vars.

\n\n

Vars template

\n\n

The .varsTemplate field specifies a text template for dynamically creating\nvars based on the matched features. See templating for details\non using templates and backreferences for more details on\nthe usage of vars.

\n\n

NOTE The vars field has priority over varsTemplate, i.e.\nvars specified in the vars field will override anything originating from\nvarsTemplate.

\n\n

MatchFeatures

\n\n

The .matchFeatures field specifies a feature matcher, consisting of a list of\nfeature matcher terms. It implements a logical AND over the terms i.e. all\nof them must match in order for the rule to trigger.

\n\n
      matchFeatures:\n        - feature: <feature-name>\n          matchExpressions:\n            <key>:\n              op: <op>\n              value:\n                - <value-1>\n                - ...\n
\n\n

The .matchFeatures[].feature field specifies the feature against which to\nmatch.

\n\n

The .matchFeatures[].matchExpressions field specifies a map of expressions\nwhich to evaluate against the elements of the feature.

\n\n

In each MatchExpression op specifies the operator to apply. Valid values are\ndescribed below.

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
OperatorNumber of valuesMatches when
In1 or greaterInput is equal to one of the values
NotIn1 or greaterInput is not equal to any of the values
InRegexp1 or greaterValues of the MatchExpression are treated as regexps and input matches one or more of them
Exists0The key exists
DoesNotExist0The key does not exists
Gt1Input is greater than the value. Both the input and value must be integer numbers.
Lt1Input is less than the value. Both the input and value must be integer numbers.
GtLt2Input is between two values. Both the input and value must be integer numbers.
IsTrue0Input is equal to “true”
IsFalse0Input is equal “false”
\n\n

The value field of MatchExpression is a list of string arguments to the\noperator.

\n\n

The behavior of MatchExpression depends on the feature type:\nfor flag and attribute features the MatchExpression operates on the feature\nelement whose name matches the <key>. However, for instance features all\nMatchExpressions are evaluated against the attributes of each instance\nseparately.

\n\n

MatchAny

\n\n

The .matchAny field is a list of of matchFeatures\nmatchers. A logical OR is applied over the matchers, i.e. at least one of them\nmust match in order for the rule to trigger.

\n\n

Consider the following example:

\n\n
      matchAny:\n        - matchFeatures:\n            - feature: kernel.loadedmodule\n              matchExpressions:\n                kmod-1: {op: Exists}\n            - feature: pci.device\n              matchExpressions:\n                vendor: {op: In, value: [\"0eee\"]}\n                class: {op: In, value: [\"0200\"]}\n        - matchFeatures:\n            - feature: kernel.loadedmodule\n              matchExpressions:\n                kmod-2: {op: Exists}\n            - feature: pci.device\n              matchExpressions:\n                vendor: {op: In, value: [\"0fff\"]}\n                class: {op: In, value: [\"0200\"]}\n
\n\n

This matches if kernel module kmod-1 is loaded and a network controller from\nvendor 0eee is present, OR, if kernel module kmod-2 has been loaded and a\nnetwork controller from vendor 0fff is present (OR both of these conditions are\ntrue).

\n\n

Available features

\n\n

Feature types

\n\n

Features are divided into three different types:

\n\n\n\n

List of features

\n\n

The following features are available for matching:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureFeature typeElementsValue typeDescription
cpu.cpuidflag  Supported CPU capabilities
  <cpuid-flag> CPUID flag is present
cpu.cstateattribute  Status of cstates in the intel_idle cpuidle driver
  enabledbool‘true’ if cstates are set, otherwise ‘false’. Does not exist of intel_idle driver is not active.
cpu.modelattribute  CPU model related attributes
  familyintCPU family
  vendor_idstringCPU vendor ID
  idintCPU model ID
cpu.pstateattribute  State of the Intel pstate driver. Does not exist if the driver is not enabled.
  statusstringStatus of the driver, possible values are ‘active’ and ‘passive’
  turbobool‘true’ if turbo frequencies are enabled, otherwise ‘false’
  scalingstringActive scaling_governor, possible values are ‘powersave’ or ‘performance’.
cpu.rdtflag  Intel RDT capabilities supported by the system
  <rdt-flag> RDT capability is supported, see RDT flags for details
cpu.sgxattribute  Intel SGX (Software Guard Extensions) capabilities
  enabledbooltrue if Intel SGX has been enabled, otherwise does not exist
cpu.sstattribute  Intel SST (Speed Select Technology) capabilities
  bf.enabledbooltrue if Intel SST-BF (Intel Speed Select Technology - Base frequency) has been enabled, otherwise does not exist
cpu.seattribute  IBM Secure Execution for Linux (IBM Z & LinuxONE)
  enabledbooltrue if IBM Secure Execution for Linux is available and has been enabled, otherwise does not exist
cpu.topologyattribute  CPU topology related features
  hardware_multithreadingboolHardware multithreading, such as Intel HTT, is enabled
kernel.configattribute  Kernel configuration options
  <config-flag>stringValue of the kconfig option
kernel.loadedmoduleflag  Loaded kernel modules
  mod-name Kernel module <mod-name> is loaded
kernel.selinuxattribute  Kernel SELinux related features
  enabledbooltrue if SELinux has been enabled and is in enforcing mode, otherwise false
kernel.versionattribute  Kernel version information
  fullstringFull kernel version (e.g. ‘4.5.6-7-g123abcde’)
  majorintFirst component of the kernel version (e.g. ‘4’)
  minorintSecond component of the kernel version (e.g. ‘5’)
  revisionintThird component of the kernel version (e.g. ‘6’)
local.labelattribute  Features from hooks and feature files, i.e. labels from the local feature source
  <label-name>stringLabel <label-name> created by the local feature source, value equals the value of the label
memory.nvinstance  NVDIMM devices present in the system
  <sysfs-attribute>stringValue of the sysfs device attribute, available attributes: devtype, mode
memory.numaattribute  NUMA nodes
  is_numabooltrue if NUMA architecture, false otherwise
  node_countintNumber of NUMA nodes
network.deviceinstance  Physical (non-virtual) network interfaces present in the system
  namestringName of the network interface
  <sysfs-attribute>stringSysfs network interface attribute, available attributes: operstate, speed, sriov_numvfs, sriov_totalvfs
pci.deviceinstance  PCI devices present in the system
  <sysfs-attribute>stringValue of the sysfs device attribute, available attributes: class, vendor, device, subsystem_vendor, subsystem_device, sriov_totalvfs, iommu_group/type, iommu/intel-iommu/version
storage.deviceinstance  Block storage devices present in the system
  namestringName of the block device
  <sysfs-attribute>stringSysfs network interface attribute, available attributes: dax, rotational, nr_zones, zoned
system.osreleaseattribute  System identification data from /etc/os-release
  <parameter>stringOne parameter from /etc/os-release
system.nameattribute  System name information
  nodenamestringName of the kubernetes node object
usb.deviceinstance  USB devices present in the system
  <sysfs-attribute>stringValue of the sysfs device attribute, available attributes: class, vendor, device, serial
rule.matchedattribute  Previously matched rules
  <label-or-var>stringLabel or var from a preceding rule that matched
\n\n

Templating

\n\n

Rules support template-based creation of labels and vars with the\n.labelsTemplate and .varsTemplate fields. These makes it possible to\ndynamically generate labels and vars based on the features that matched.

\n\n

The template must expand into a simple format with <key>=<value> pairs\nseparated by newline.

\n\n

Consider the following example:\n

\n\n
    labelsTemplate: |\n      {{ range .pci.device }}vendor-{{ .class }}-{{ .device }}.present=true\n      {{ end }}\n    matchFeatures:\n      - feature: pci.device\n        matchExpressions:\n          class: {op: InRegexp, value: [\"^02\"]}\n          vendor: [\"0fff\"]\n
\n\n\n

The rule above will create individual labels\nfeature.node.kubernetes.io/vendor-<class-id>-<device-id>.present=true for\neach network controller device (device class starting with 02) from vendor\n0ffff.

\n\n

All the matched features of each feature matcher term under matchFeatures\nfields are available for the template engine. Matched features can be\nreferenced with {{ .<feature-name> }} in the template, and\nthe available data could be described in yaml as follows:

\n\n
.\n  <key-feature>:\n    - Name: <matched-key>\n    - ...\n\n  <value-feature>:\n    - Name: <matched-key>\n      Value: <matched-value>\n    - ...\n\n  <instance-feature>:\n    - <attribute-1-name>: <attribute-1-value>\n      <attribute-2-name>: <attribute-2-value>\n      ...\n    - ...\n
\n\n

That is, the per-feature data is a list of objects whose data fields depend on\nthe type of the feature:

\n\n\n\n

A simple example of a template utilizing name and value from an attribute\nfeature:\n

\n\n
    labelsTemplate: |\n      {{ range .system.osrelease }}system-{{ .Name }}={{ .Value }}\n      {{ end }}\n    matchFeatures:\n      - feature: system.osRelease\n        matchExpressions:\n          ID: {op: Exists}\n          VERSION_ID.major: {op: Exists}\n
\n\n\n

NOTE In case of matchAny is specified, the template is executed separately\nagainst each individual matchFeatures field and the final set of labels will\nbe superset of all these separate template expansions. E.g. consider the\nfollowing:

\n\n
  - name: <name>\n    labelsTemplate: <template>\n    matchFeatures: <matcher#1>\n    matchAny:\n      - matchFeatures: <matcher#2>\n      - matchFeatures: <matcher#3>\n
\n\n

In the example above (assuming the overall result is a match) the template\nwould be executed on matcher#1 as well as on matcher#2 and/or matcher#3\n(depending on whether both or only one of them match). All the labels from\nthese separate expansions would be created, i.e. the end result would be a\nunion of all the individual expansions.

\n\n

Rule templates use the Golang text/template\npackage and all its built-in functionality (e.g. pipelines and functions) can\nbe used. An example template taking use of the built-in len function,\nadvertising the number of PCI network controllers from a specific vendor:\n

\n\n
    labelsTemplate: |\n      num-intel-network-controllers={{ .pci.device | len }}\n    matchFeatures:\n      - feature: pci.device\n        matchExpressions:\n          vendor: {op: In, value: [\"8086\"]}\n          class: {op: In, value: [\"0200\"]}\n\n
\n\n\n

Imaginative template pipelines are possible, but care must be taken in order to\nproduce understandable and maintainable rule sets.

\n\n

Backreferences

\n\n

Rules support referencing the output of preceding rules. This enables\nsophisticated scenarios where multiple rules are combined together\nto for more complex heuristics than a single rule can provide. The labels and\nvars created by the execution of preceding rules are available as a special\nrule.matched feature.

\n\n

Consider the following configuration:

\n\n
  - name: \"my kernel label rule\"\n    labels:\n      kernel-feature: \"true\"\n    matchFeatures:\n      - feature: kernel.version\n        matchExpressions:\n          major: {op: Gt, value: [\"4\"]}\n\n  - name: \"my var rule\"\n    vars:\n      nolabel-feature: \"true\"\n    matchFeatures:\n      - feature: cpu.cpuid\n        matchExpressions:\n          AVX512F: {op: Exists}\n      - feature: pci.device\n        matchExpressions:\n          vendor: {op: In, value: [\"0fff\"]}\n          device: {op: In, value: [\"1234\", \"1235\"]}\n\n  - name: \"my high level feature rule\"\n    labels:\n      high-level-feature: \"true\"\n    matchFeatures:\n      - feature: rule.matched\n        matchExpressions:\n          kernel-feature: {op: IsTrue}\n          nolabel-feature: {op: IsTrue}\n
\n\n

The feature.node.kubernetes.io/high-level-feature = true label depends on thw\ntwo previous rules.

\n\n

Note that when referencing rules across multiple\nNodeFeatureRule objects attention must be\npaid to the ordering. NodeFeatureRule objects are processed in alphabetical\norder (based on their .metadata.name).

\n\n

Examples

\n\n

Some more configuration examples below.

\n\n

Match certain CPUID features:

\n\n
  - name: \"example cpuid rule\"\n    labels:\n      my-special-cpu-feature: \"true\"\n    matchFeatures:\n      - feature: cpu.cpuid\n        matchExpressions:\n          AESNI: {op: Exists}\n          AVX: {op: Exists}\n
\n\n

Require a certain loaded kernel module and OS version:

\n\n
  - name: \"my multi-feature rule\"\n    labels:\n      my-special-multi-feature: \"true\"\n    matchFeatures:\n      - feature: kernel.loadedmodule\n        matchExpressions:\n          e1000: {op: Exists}\n      - feature: system.osrelease\n        matchExpressions:\n          NAME: {op: InRegexp, values: [\"^openSUSE\"]}\n          VERSION_ID.major: {op: Gt, values: [\"14\"]}\n
\n\n

Require a loaded kernel module and two specific PCI devices (both of which\nmust be present):

\n\n
  - name: \"my multi-device rule\"\n    labels:\n      my-multi-device-feature: \"true\"\n    matchFeatures:\n      - feature: kernel.loadedmodule\n        matchExpressions:\n          my-driver-module: {op: Exists}\n      - pci.device:\n          vendor: \"0fff\"\n          device: \"1234\"\n      - pci.device:\n          vendor: \"0fff\"\n          device: \"abcd\"\n
\n\n

Legacy custom rule syntax

\n\n

DEPRECATED: use the new rule syntax instead.

\n\n

The custom source supports the legacy matchOn rule syntax for\nbackwards-compatibility.

\n\n

To aid in making the legacy rule syntax clearer, we define a general and a per\nrule nomenclature, keeping things as consistent as possible.

\n\n

General nomenclature and definitions

\n\n
Rule        :Represents a matching logic that is used to match on a feature.\nRule Input  :The input a Rule is provided. This determines how a Rule performs the match operation.\nMatcher     :A composition of Rules, each Matcher may be composed of at most one instance of each Rule.\n
\n\n

Custom features format (using the nomenclature defined above)

\n\n

Rules are specified under sources.custom in the nfd-worker configuration\nfile.

\n\n
sources:\n  custom:\n  - name: <feature name>\n    value: <optional feature value, defaults to \"true\">\n    matchOn:\n    - <Rule-1>: <Rule-1 Input>\n      [<Rule-2>: <Rule-2 Input>]\n    - <Matcher-2>\n    - ...\n    - ...\n    - <Matcher-N>\n  - <custom feature 2>\n  - ...\n  - ...\n  - <custom feature M>\n
\n\n

The label is constructed by adding custom- prefix to the name field, label\nvalue defaults to true if not specified in the rule spec:

\n\n
feature.node.kubernetes.io/custom-<name> = <value>\n
\n\n

Matching process

\n\n

Specifying Rules to match on a feature is done by providing a list of Matchers.\nEach Matcher contains one or more Rules.

\n\n

Logical OR is performed between Matchers and logical AND is performed\nbetween Rules of a given Matcher.

\n\n

Rules

\n\n

pciid rule

\n\n
Nomenclature
\n\n
Attribute   :A PCI attribute.\nElement     :An identifier of the PCI attribute.\n
\n\n

The PciId Rule allows matching the PCI devices in the system on the following\nAttributes: class,vendor and device. A list of Elements is provided for\neach Attribute.

\n\n
Format
\n\n
pciId :\n  class: [<class id>, ...]\n  vendor: [<vendor id>,  ...]\n  device: [<device id>, ...]\n
\n\n

Matching is done by performing a logical OR between Elements of an Attribute\nand logical AND between the specified Attributes for each PCI device in the\nsystem. At least one Attribute must be specified. Missing attributes will not\npartake in the matching process.

\n\n

UsbId rule

\n\n
Nomenclature
\n\n
Attribute   :A USB attribute.\nElement     :An identifier of the USB attribute.\n
\n\n

The UsbId Rule allows matching the USB devices in the system on the following\nAttributes: class,vendor, device and serial. A list of Elements is\nprovided for each Attribute.

\n\n
Format
\n\n
usbId :\n  class: [<class id>, ...]\n  vendor: [<vendor id>,  ...]\n  device: [<device id>, ...]\n  serial: [<serial>, ...]\n
\n\n

Matching is done by performing a logical OR between Elements of an Attribute\nand logical AND between the specified Attributes for each USB device in the\nsystem. At least one Attribute must be specified. Missing attributes will not\npartake in the matching process.

\n\n

LoadedKMod rule

\n\n
Nomenclature
\n\n
Element     :A kernel module\n
\n\n

The LoadedKMod Rule allows matching the loaded kernel modules in the system\nagainst a provided list of Elements.

\n\n
Format
\n\n
loadedKMod : [<kernel module>, ...]\n
\n\n

Matching is done by performing logical AND for each provided Element, i.e\nthe Rule will match if all provided Elements (kernel modules) are loaded in the\nsystem.

\n\n

CpuId rule

\n\n
Nomenclature
\n\n
Element     :A CPUID flag\n
\n\n

The Rule allows matching the available CPUID flags in the system against a\nprovided list of Elements.

\n\n
Format
\n\n
cpuId : [<CPUID flag string>, ...]\n
\n\n

Matching is done by performing logical AND for each provided Element, i.e the\nRule will match if all provided Elements (CPUID flag strings) are available in\nthe system.

\n\n

Kconfig rule

\n\n
Nomenclature
\n\n
Element     :A Kconfig option\n
\n\n

The Rule allows matching the kconfig options in the system against a provided\nlist of Elements.

\n\n
Format
\n\n
kConfig: [<kernel config option ('y' or 'm') or '=<value>'>, ...]\n
\n\n

Matching is done by performing logical AND for each provided Element, i.e the\nRule will match if all provided Elements (kernel config options) are enabled\n(y or m) or matching =<value> in the kernel.

\n\n

Nodename rule

\n\n
Nomenclature
\n\n
Element     :A nodename regexp pattern\n
\n\n

The Rule allows matching the node’s name against a provided list of Elements.

\n\n
Format
\n\n
nodename: [ <nodename regexp pattern>, ... ]\n
\n\n

Matching is done by performing logical OR for each provided Element, i.e the\nRule will match if one of the provided Elements (nodename regexp pattern)\nmatches the node’s name.

\n\n

Legacy custom rule example

\n\n
custom:\n  - name: \"my.kernel.feature\"\n    matchOn:\n      - loadedKMod: [\"kmod1\", \"kmod2\"]\n  - name: \"my.pci.feature\"\n    matchOn:\n      - pciId:\n          vendor: [\"15b3\"]\n          device: [\"1014\", \"1017\"]\n  - name: \"my.usb.feature\"\n    matchOn:\n      - usbId:\n          vendor: [\"1d6b\"]\n          device: [\"0003\"]\n          serial: [\"090129a\"]\n  - name: \"my.combined.feature\"\n    matchOn:\n      - loadedKMod : [\"vendor_kmod1\", \"vendor_kmod2\"]\n        pciId:\n          vendor: [\"15b3\"]\n          device: [\"1014\", \"1017\"]\n  - name: \"vendor.feature.node.kubernetes.io/accumulated.feature\"\n    matchOn:\n      - loadedKMod : [\"some_kmod1\", \"some_kmod2\"]\n      - pciId:\n          vendor: [\"15b3\"]\n          device: [\"1014\", \"1017\"]\n  - name: \"my.kernel.featureneedscpu\"\n    matchOn:\n      - kConfig: [\"KVM_INTEL\"]\n      - cpuId: [\"VMX\"]\n  - name: \"my.kernel.modulecompiler\"\n    matchOn:\n      - kConfig: [\"GCC_VERSION=100101\"]\n        loadedKMod: [\"kmod1\"]\n  - name: \"profile.node.kubernetes.io/my-datacenter\"\n    value: \"datacenter-1\"\n    matchOn:\n      - nodename: [ \"node-datacenter1-rack.*-server.*\" ]\n
\n\n

In the example above:

\n\n\n\n","dir":"/advanced/","name":"customization-guide.md","path":"advanced/customization-guide.md","url":"/advanced/customization-guide.html"}] \ No newline at end of file diff --git a/v0.11/get-started/deployment-and-usage.html b/v0.11/get-started/deployment-and-usage.html index 4b5990eb4..0358ee18c 100644 --- a/v0.11/get-started/deployment-and-usage.html +++ b/v0.11/get-started/deployment-and-usage.html @@ -1,4 +1,4 @@ - Deployment and usage · Node Feature Discovery

Deployment and usage

Table of contents

  1. Image variants
    1. Full
    2. Minimal
  2. Deployment options
    1. Operator
    2. Deployment with kustomize
    3. Deployment with Helm
    4. Build your own
  3. Usage
    1. NFD-Master
    2. NFD-Worker
    3. NFD-Topology-Updater
    4. Communication security with TLS
  4. Worker configuration
  5. Using node labels
  6. Uninstallation
    1. Operator was used for deployment
    2. Manual
    3. Removing feature labels

Image variants

NFD currently offers two variants of the container image. The "full" variant is currently deployed by default. Released container images are available for x86_64 and Arm64 architectures.

Full

This image is based on debian:buster-slim and contains a full Linux system for running shell-based nfd-worker hooks and doing live debugging and diagnosis of the NFD images.

Minimal

This is a minimal image based on gcr.io/distroless/base and only supports running statically linked binaries.

The container image tag has suffix -minimal (e.g. k8s.gcr.io/nfd/node-feature-discovery:v0.11.1-minimal)

Deployment options

Operator

Deployment using the Node Feature Discovery Operator is recommended to be done via operatorhub.io.

  1. You need to have OLM installed. If you don't, take a look at the latest release for detailed instructions.
  2. Install the operator:

    kubectl create -f https://operatorhub.io/install/nfd-operator.yaml
    +        Deployment and usage · Node Feature Discovery                      

    Deployment and usage

    Table of contents

    1. Image variants
      1. Full
      2. Minimal
    2. Deployment options
      1. Operator
      2. Deployment with kustomize
      3. Deployment with Helm
      4. Build your own
    3. Usage
      1. NFD-Master
      2. NFD-Worker
      3. NFD-Topology-Updater
      4. Communication security with TLS
    4. Worker configuration
    5. Using node labels
    6. Uninstallation
      1. Operator was used for deployment
      2. Manual
      3. Removing feature labels

    Image variants

    NFD currently offers two variants of the container image. The "full" variant is currently deployed by default. Released container images are available for x86_64 and Arm64 architectures.

    Full

    This image is based on debian:buster-slim and contains a full Linux system for running shell-based nfd-worker hooks and doing live debugging and diagnosis of the NFD images.

    Minimal

    This is a minimal image based on gcr.io/distroless/base and only supports running statically linked binaries.

    The container image tag has suffix -minimal (e.g. k8s.gcr.io/nfd/node-feature-discovery:v0.11.2-minimal)

    Deployment options

    Operator

    Deployment using the Node Feature Discovery Operator is recommended to be done via operatorhub.io.

    1. You need to have OLM installed. If you don't, take a look at the latest release for detailed instructions.
    2. Install the operator:

      kubectl create -f https://operatorhub.io/install/nfd-operator.yaml
       
    3. Create NodeFeatureDiscovery object (in nfd namespace here):

      cat << EOF | kubectl apply -f -
       apiVersion: v1
       kind: Namespace
      @@ -12,24 +12,24 @@ metadata:
         namespace: nfd
       spec:
         operand:
      -    image: k8s.gcr.io/nfd/node-feature-discovery:v0.11.1
      +    image: k8s.gcr.io/nfd/node-feature-discovery:v0.11.2
           imagePullPolicy: IfNotPresent
       EOF
      -

    In order to deploy the minimal image you need to use

      image: k8s.gcr.io/nfd/node-feature-discovery:v0.11.1-minimal
    -

    in the NodeFeatureDiscovery object above.

    Deployment with kustomize

    This requires kubectl v1.21 or later. The kustomize overlays provided in the repo can be used directly:

    kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.11.1
    -

    This will required RBAC rules and deploy nfd-master (as a deployment) and nfd-worker (as daemonset) in the node-feature-discovery namespace.

    NOTE: nfd-topology-updater is not deployed as part of the default overlay. Please refer to the Master Worker Topologyupdater and Topologyupdater below.

    Alternatively you can clone the repository and customize the deployment by creating your own overlays. For example, to deploy the minimal image. See kustomize for more information about managing deployment configurations.

    Default overlays

    The NFD repository hosts a set of overlays for different usages and deployment scenarios under deployment/overlays

    Master-worker pod

    You can also run nfd-master and nfd-worker inside the same pod

    kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default-combined?ref=v0.11.1
    +

In order to deploy the minimal image you need to use

  image: k8s.gcr.io/nfd/node-feature-discovery:v0.11.2-minimal
+

in the NodeFeatureDiscovery object above.

Deployment with kustomize

This requires kubectl v1.21 or later. The kustomize overlays provided in the repo can be used directly:

kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.11.2
+

This will required RBAC rules and deploy nfd-master (as a deployment) and nfd-worker (as daemonset) in the node-feature-discovery namespace.

NOTE: nfd-topology-updater is not deployed as part of the default overlay. Please refer to the Master Worker Topologyupdater and Topologyupdater below.

Alternatively you can clone the repository and customize the deployment by creating your own overlays. For example, to deploy the minimal image. See kustomize for more information about managing deployment configurations.

Default overlays

The NFD repository hosts a set of overlays for different usages and deployment scenarios under deployment/overlays

Master-worker pod

You can also run nfd-master and nfd-worker inside the same pod

kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default-combined?ref=v0.11.2
 
 

This creates a DaemonSet that runs nfd-worker and nfd-master in the same Pod. In this case no nfd-master is run on the master node(s), but, the worker nodes are able to label themselves which may be desirable e.g. in single-node setups.

NOTE: nfd-topology-updater is not deployed by the default-combined overlay. To enable nfd-topology-updater in this scenario,the users must customize the deployment themselves.

Worker one-shot

Feature discovery can alternatively be configured as a one-shot job. The default-job overlay may be used to achieve this:

NUM_NODES=$(kubectl get no -o jsonpath='{.items[*].metadata.name}' | wc -w)
-kubectl kustomize https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default-job?ref=v0.11.1 | \
+kubectl kustomize https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default-job?ref=v0.11.2 | \
     sed s"/NUM_NODES/$NUM_NODES/" | \
     kubectl apply -f -
-

The example above launches as many jobs as there are non-master nodes. Note that this approach does not guarantee running once on every node. For example, tainted, non-ready nodes or some other reasons in Job scheduling may cause some node(s) will run extra job instance(s) to satisfy the request.

Master Worker Topologyupdater

NFD Master, NFD worker and NFD Topologyupdater can be configured to be deployed as separate pods. The master-worker-topologyupdater overlay may be used to achieve this:

kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/master-worker-topologyupdater?ref=v0.11.1
+

The example above launches as many jobs as there are non-master nodes. Note that this approach does not guarantee running once on every node. For example, tainted, non-ready nodes or some other reasons in Job scheduling may cause some node(s) will run extra job instance(s) to satisfy the request.

Master Worker Topologyupdater

NFD Master, NFD worker and NFD Topologyupdater can be configured to be deployed as separate pods. The master-worker-topologyupdater overlay may be used to achieve this:

kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/master-worker-topologyupdater?ref=v0.11.2
 
-

Topologyupdater

In order to deploy just NFD master and NFD Topologyupdater (without nfd-worker) use the topologyupdater overlay:

kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/topologyupdater?ref=v0.11.1
+

Topologyupdater

In order to deploy just NFD master and NFD Topologyupdater (without nfd-worker) use the topologyupdater overlay:

kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/topologyupdater?ref=v0.11.2
 
 

NFD Topologyupdater can be configured along with the default overlay (which deploys NFD worker and NFD master) where all the software components are deployed as separate pods. The topologyupdater overlay may be used along with default overlay to achieve this:


-kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.11.1
-kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/topologyupdater?ref=v0.11.1
+kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.11.2
+kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/topologyupdater?ref=v0.11.2
 
 

Deployment with Helm

Node Feature Discovery Helm chart allow to easily deploy and manage NFD.

Prerequisites

Helm package manager should be installed.

Deployment

To install the latest stable version:

export NFD_NS=node-feature-discovery
 helm repo add nfd https://kubernetes-sigs.github.io/node-feature-discovery/charts
@@ -39,14 +39,14 @@ helm install nfd/node-feature-discovery cd node-feature-discovery/deployment/helm
 export NFD_NS=node-feature-discovery
 helm install node-feature-discovery ./node-feature-discovery/ --namespace $NFD_NS --create-namespace
-

See the configuration section below for instructions how to alter the deployment parameters.

In order to deploy the minimal image you need to override the image tag:

helm install node-feature-discovery ./node-feature-discovery/ --set image.tag=v0.11.1-minimal --namespace $NFD_NS --create-namespace
+

See the configuration section below for instructions how to alter the deployment parameters.

In order to deploy the minimal image you need to override the image tag:

helm install node-feature-discovery ./node-feature-discovery/ --set image.tag=v0.11.2-minimal --namespace $NFD_NS --create-namespace
 

Configuration

You can override values from values.yaml and provide a file with custom values:

export NFD_NS=node-feature-discovery
 helm install nfd/node-feature-discovery -f <path/to/custom/values.yaml> --namespace $NFD_NS --create-namespace
 

To specify each parameter separately you can provide them to helm install command:

export NFD_NS=node-feature-discovery
 helm install nfd/node-feature-discovery --set nameOverride=NFDinstance --set master.replicaCount=2 --namespace $NFD_NS --create-namespace
 

Uninstalling the chart

To uninstall the node-feature-discovery deployment:

export NFD_NS=node-feature-discovery
 helm uninstall node-feature-discovery --namespace $NFD_NS
-

The command removes all the Kubernetes components associated with the chart and deletes the release.

Chart parameters

In order to tailor the deployment of the Node Feature Discovery to your cluster needs We have introduced the following Chart parameters.

General parameters
Name Type Default description
image.repository string k8s.gcr.io/nfd/node-feature-discovery NFD image repository
image.tag string v0.11.1 NFD image tag
image.pullPolicy string Always Image pull policy
imagePullSecrets list [] ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info
nameOverride string   Override the name of the chart
fullnameOverride string   Override a default fully qualified app name
nodeFeatureRule.createCRD bool true Specifies whether to create the NodeFeatureRule CRD
tls.enable bool false Specifies whether to use TLS for communications between components
tls.certManager bool false If enabled, requires cert-manager to be installed and will automatically create the required TLS certificates
Master pod parameters
Name Type Default description
master.* dict   NFD master deployment configuration
master.instance string   Instance name. Used to separate annotation namespaces for multiple parallel deployments
master.extraLabelNs array [] List of allowed extra label namespaces
master.resourceLabels array [] List of labels to be registered as extended resources
master.featureRulesController bool null Specifies whether the controller for processing of NodeFeatureRule objects is enabled. If not set, controller will be enabled if master.instance is empty.
master.replicaCount integer 1 Number of desired pods. This is a pointer to distinguish between explicit zero and not specified
master.podSecurityContext dict {} PodSecurityContext holds pod-level security attributes and common container settings
master.securityContext dict {} Container security settings
master.serviceAccount.create bool true Specifies whether a service account should be created
master.serviceAccount.annotations dict {} Annotations to add to the service account
master.serviceAccount.name string   The name of the service account to use. If not set and create is true, a name is generated using the fullname template
master.rbac.create bool true Specifies whether to create RBAC configuration for nfd-master
master.service.type string ClusterIP NFD master service type
master.service.port integer 8080 NFD master service port
master.resources dict {} NFD master pod resources management
master.nodeSelector dict {} NFD master pod node selector
master.tolerations dict Scheduling to master node is disabled NFD master pod tolerations
master.annotations dict {} NFD master pod annotations
master.affinity dict   NFD master pod required node affinity
master.deploymentAnnotations dict {} NFD master deployment annotations
Worker pod parameters
Name Type Default description
worker.* dict   NFD worker daemonset configuration
worker.config dict   NFD worker configuration
worker.podSecurityContext dict {} PodSecurityContext holds pod-level security attributes and common container settings
worker.securityContext dict {} Container security settings
worker.mountUsrSrc bool false Specifies whether to allow users to mount the hostpath /user/src. Does not work on systems without /usr/src AND a read-only /usr
worker.resources dict {} NFD worker pod resources management
worker.nodeSelector dict {} NFD worker pod node selector
worker.tolerations dict {} NFD worker pod node tolerations
worker.annotations dict {} NFD worker pod annotations
worker.daemonsetAnnotations dict {} NFD worker daemonset annotations
Topology updater parameters
Name Type Default description
topologyUpdater.* dict   NFD Topology Updater configuration
topologyUpdater.enable bool false Specifies whether the NFD Topology Updater should be created
topologyUpdater.createCRDs bool false Specifies whether the NFD Topology Updater CRDs should be created
topologyUpdater.serviceAccount.create bool true Specifies whether the service account for topology updater should be created
topologyUpdater.serviceAccount.annotations dict {} Annotations to add to the service account for topology updater
topologyUpdater.serviceAccount.name string   The name of the service account for topology updater to use. If not set and create is true, a name is generated using the fullname template and -topology-updater suffix
topologyUpdater.rbac dict   RBAC parameters for the topology updater
topologyUpdater.rbac.create bool false Specifies whether the cluster role and binding for topology updater should be created
topologyUpdater.kubeletConfigPath string "" Specifies the kubelet config host path
topologyUpdater.kubeletPodResourcesSockPath string "" Specifies the kubelet sock path to read pod resources
topologyUpdater.updateInterval string 60s Time to sleep between CR updates. Non-positive value implies no CR update.
topologyUpdater.watchNamespace string * Namespace to watch pods, * for all namespaces
topologyUpdater.podSecurityContext dict {} PodSecurityContext holds pod-level security attributes and common container settings
topologyUpdater.securityContext dict {} Container security settings
topologyUpdater.resources dict {} Topology updater pod resources management
topologyUpdater.nodeSelector dict {} Topology updater pod node selector
topologyUpdater.tolerations dict {} Topology updater pod node tolerations
topologyUpdater.annotations dict {} Topology updater pod annotations
topologyUpdater.affinity dict {} Topology updater pod affinity

Build your own

If you want to use the latest development version (master branch) you need to build your own custom image. See the Developer Guide for instructions how to build images and deploy them on your cluster.

Usage

NFD-Master

NFD-Master runs as a deployment (with a replica count of 1), by default it prefers running on the cluster's master nodes but will run on worker nodes if no master nodes are found.

For High Availability, you should simply increase the replica count of the deployment object. You should also look into adding inter-pod affinity to prevent masters from running on the same node. However note that inter-pod affinity is costly and is not recommended in bigger clusters.

NFD-Master listens for connections from nfd-worker(s) and connects to the Kubernetes API server to add node labels advertised by them.

If you have RBAC authorization enabled (as is the default e.g. with clusters initialized with kubeadm) you need to configure the appropriate ClusterRoles, ClusterRoleBindings and a ServiceAccount in order for NFD to create node labels. The provided template will configure these for you.

NFD-Worker

NFD-Worker is preferably run as a Kubernetes DaemonSet. This assures re-labeling on regular intervals capturing changes in the system configuration and makes sure that new nodes are labeled as they are added to the cluster. Worker connects to the nfd-master service to advertise hardware features.

When run as a daemonset, nodes are re-labeled at an default interval of 60s. This can be changed by using the core.sleepInterval config option (or -sleep-interval command line flag).

The worker configuration file is watched and re-read on every change which provides a simple mechanism of dynamic run-time reconfiguration. See worker configuration for more details.

NFD-Topology-Updater

NFD-Topology-Updater is preferably run as a Kubernetes DaemonSet. This assures re-examination (and CR updates) on regular intervals capturing changes in the allocated resources and hence the allocatable resources on a per zone basis. It makes sure that more CR instances are created as new nodes get added to the cluster. Topology-Updater connects to the nfd-master service to create CR instances corresponding to nodes.

When run as a daemonset, nodes are re-examined for the allocated resources (to determine the information of the allocatable resources on a per zone basis where a zone can be a NUMA node) at an interval specified using the -sleep-interval option. The default sleep interval is set to 60s which is the the value when no -sleep-interval is specified.

Communication security with TLS

NFD supports mutual TLS authentication between the nfd-master and nfd-worker instances. That is, nfd-worker and nfd-master both verify that the other end presents a valid certificate.

TLS authentication is enabled by specifying -ca-file, -key-file and -cert-file args, on both the nfd-master and nfd-worker instances. The template specs provided with NFD contain (commented out) example configuration for enabling TLS authentication.

The Common Name (CN) of the nfd-master certificate must match the DNS name of the nfd-master Service of the cluster. By default, nfd-master only check that the nfd-worker has been signed by the specified root certificate (-ca-file).

Additional hardening can be enabled by specifying -verify-node-name in nfd-master args, in which case nfd-master verifies that the NodeName presented by nfd-worker matches the Common Name (CN) or a Subject Alternative Name (SAN) of its certificate. Note that -verify-node-name complicates certificate management and is not yet supported in the helm or kustomize deployment methods.

Automated TLS certificate management using cert-manager

cert-manager can be used to automate certificate management between nfd-master and the nfd-worker pods.

The NFD source code repository contains an example kustomize overlay and helm chart that can be used to deploy NFD with cert-manager supplied certificates enabled.

To install cert-manager itself can be done as easily as this, below, or you can refer to their documentation for other installation methods such as the helm chart they provide.

kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.6.1/cert-manager.yaml
+

The command removes all the Kubernetes components associated with the chart and deletes the release.

Chart parameters

In order to tailor the deployment of the Node Feature Discovery to your cluster needs We have introduced the following Chart parameters.

General parameters
Name Type Default description
image.repository string k8s.gcr.io/nfd/node-feature-discovery NFD image repository
image.tag string v0.11.2 NFD image tag
image.pullPolicy string Always Image pull policy
imagePullSecrets list [] ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info
nameOverride string   Override the name of the chart
fullnameOverride string   Override a default fully qualified app name
nodeFeatureRule.createCRD bool true Specifies whether to create the NodeFeatureRule CRD
tls.enable bool false Specifies whether to use TLS for communications between components
tls.certManager bool false If enabled, requires cert-manager to be installed and will automatically create the required TLS certificates
Master pod parameters
Name Type Default description
master.* dict   NFD master deployment configuration
master.instance string   Instance name. Used to separate annotation namespaces for multiple parallel deployments
master.extraLabelNs array [] List of allowed extra label namespaces
master.resourceLabels array [] List of labels to be registered as extended resources
master.featureRulesController bool null Specifies whether the controller for processing of NodeFeatureRule objects is enabled. If not set, controller will be enabled if master.instance is empty.
master.replicaCount integer 1 Number of desired pods. This is a pointer to distinguish between explicit zero and not specified
master.podSecurityContext dict {} PodSecurityContext holds pod-level security attributes and common container settings
master.securityContext dict {} Container security settings
master.serviceAccount.create bool true Specifies whether a service account should be created
master.serviceAccount.annotations dict {} Annotations to add to the service account
master.serviceAccount.name string   The name of the service account to use. If not set and create is true, a name is generated using the fullname template
master.rbac.create bool true Specifies whether to create RBAC configuration for nfd-master
master.service.type string ClusterIP NFD master service type
master.service.port integer 8080 NFD master service port
master.resources dict {} NFD master pod resources management
master.nodeSelector dict {} NFD master pod node selector
master.tolerations dict Scheduling to master node is disabled NFD master pod tolerations
master.annotations dict {} NFD master pod annotations
master.affinity dict   NFD master pod required node affinity
master.deploymentAnnotations dict {} NFD master deployment annotations
Worker pod parameters
Name Type Default description
worker.* dict   NFD worker daemonset configuration
worker.config dict   NFD worker configuration
worker.podSecurityContext dict {} PodSecurityContext holds pod-level security attributes and common container settings
worker.securityContext dict {} Container security settings
worker.mountUsrSrc bool false Specifies whether to allow users to mount the hostpath /user/src. Does not work on systems without /usr/src AND a read-only /usr
worker.resources dict {} NFD worker pod resources management
worker.nodeSelector dict {} NFD worker pod node selector
worker.tolerations dict {} NFD worker pod node tolerations
worker.annotations dict {} NFD worker pod annotations
worker.daemonsetAnnotations dict {} NFD worker daemonset annotations
Topology updater parameters
Name Type Default description
topologyUpdater.* dict   NFD Topology Updater configuration
topologyUpdater.enable bool false Specifies whether the NFD Topology Updater should be created
topologyUpdater.createCRDs bool false Specifies whether the NFD Topology Updater CRDs should be created
topologyUpdater.serviceAccount.create bool true Specifies whether the service account for topology updater should be created
topologyUpdater.serviceAccount.annotations dict {} Annotations to add to the service account for topology updater
topologyUpdater.serviceAccount.name string   The name of the service account for topology updater to use. If not set and create is true, a name is generated using the fullname template and -topology-updater suffix
topologyUpdater.rbac dict   RBAC parameters for the topology updater
topologyUpdater.rbac.create bool false Specifies whether the cluster role and binding for topology updater should be created
topologyUpdater.kubeletConfigPath string "" Specifies the kubelet config host path
topologyUpdater.kubeletPodResourcesSockPath string "" Specifies the kubelet sock path to read pod resources
topologyUpdater.updateInterval string 60s Time to sleep between CR updates. Non-positive value implies no CR update.
topologyUpdater.watchNamespace string * Namespace to watch pods, * for all namespaces
topologyUpdater.podSecurityContext dict {} PodSecurityContext holds pod-level security attributes and common container settings
topologyUpdater.securityContext dict {} Container security settings
topologyUpdater.resources dict {} Topology updater pod resources management
topologyUpdater.nodeSelector dict {} Topology updater pod node selector
topologyUpdater.tolerations dict {} Topology updater pod node tolerations
topologyUpdater.annotations dict {} Topology updater pod annotations
topologyUpdater.affinity dict {} Topology updater pod affinity

Build your own

If you want to use the latest development version (master branch) you need to build your own custom image. See the Developer Guide for instructions how to build images and deploy them on your cluster.

Usage

NFD-Master

NFD-Master runs as a deployment (with a replica count of 1), by default it prefers running on the cluster's master nodes but will run on worker nodes if no master nodes are found.

For High Availability, you should simply increase the replica count of the deployment object. You should also look into adding inter-pod affinity to prevent masters from running on the same node. However note that inter-pod affinity is costly and is not recommended in bigger clusters.

NFD-Master listens for connections from nfd-worker(s) and connects to the Kubernetes API server to add node labels advertised by them.

If you have RBAC authorization enabled (as is the default e.g. with clusters initialized with kubeadm) you need to configure the appropriate ClusterRoles, ClusterRoleBindings and a ServiceAccount in order for NFD to create node labels. The provided template will configure these for you.

NFD-Worker

NFD-Worker is preferably run as a Kubernetes DaemonSet. This assures re-labeling on regular intervals capturing changes in the system configuration and makes sure that new nodes are labeled as they are added to the cluster. Worker connects to the nfd-master service to advertise hardware features.

When run as a daemonset, nodes are re-labeled at an default interval of 60s. This can be changed by using the core.sleepInterval config option (or -sleep-interval command line flag).

The worker configuration file is watched and re-read on every change which provides a simple mechanism of dynamic run-time reconfiguration. See worker configuration for more details.

NFD-Topology-Updater

NFD-Topology-Updater is preferably run as a Kubernetes DaemonSet. This assures re-examination (and CR updates) on regular intervals capturing changes in the allocated resources and hence the allocatable resources on a per zone basis. It makes sure that more CR instances are created as new nodes get added to the cluster. Topology-Updater connects to the nfd-master service to create CR instances corresponding to nodes.

When run as a daemonset, nodes are re-examined for the allocated resources (to determine the information of the allocatable resources on a per zone basis where a zone can be a NUMA node) at an interval specified using the -sleep-interval option. The default sleep interval is set to 60s which is the the value when no -sleep-interval is specified.

Communication security with TLS

NFD supports mutual TLS authentication between the nfd-master and nfd-worker instances. That is, nfd-worker and nfd-master both verify that the other end presents a valid certificate.

TLS authentication is enabled by specifying -ca-file, -key-file and -cert-file args, on both the nfd-master and nfd-worker instances. The template specs provided with NFD contain (commented out) example configuration for enabling TLS authentication.

The Common Name (CN) of the nfd-master certificate must match the DNS name of the nfd-master Service of the cluster. By default, nfd-master only check that the nfd-worker has been signed by the specified root certificate (-ca-file).

Additional hardening can be enabled by specifying -verify-node-name in nfd-master args, in which case nfd-master verifies that the NodeName presented by nfd-worker matches the Common Name (CN) or a Subject Alternative Name (SAN) of its certificate. Note that -verify-node-name complicates certificate management and is not yet supported in the helm or kustomize deployment methods.

Automated TLS certificate management using cert-manager

cert-manager can be used to automate certificate management between nfd-master and the nfd-worker pods.

The NFD source code repository contains an example kustomize overlay and helm chart that can be used to deploy NFD with cert-manager supplied certificates enabled.

To install cert-manager itself can be done as easily as this, below, or you can refer to their documentation for other installation methods such as the helm chart they provide.

kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.6.1/cert-manager.yaml
 

To use the kustomize overlay to install node-feature-discovery with TLS enabled, you may use the following:

kubectl apply -k deployment/overlays/samples/cert-manager
 

To make use of the helm chart, override values.yaml to enable both the tls.enabled and tls.certManager options. Note that if you do not enable tls.certManager, helm will successfully install the application, but deployment will wait until certificates are manually created, as demonstrated below.

See the sample installation commands in the Helm Deployment and Configuration sections above for how to either override individual values, or provide a yaml file with which to override default values.

Manual TLS certificate management

If you do not with to make use of cert-manager, the certificates can be manually created and stored as secrets within the NFD namespace.

Create a CA certificate

openssl req -x509 -newkey rsa:4096 -keyout ca.key -nodes \
         -subj "/CN=nfd-ca" -days 10000 -out ca.crt
@@ -127,7 +127,7 @@ data:
 
 done
 

Worker configuration

NFD-Worker supports dynamic configuration through a configuration file. The default location is /etc/kubernetes/node-feature-discovery/nfd-worker.conf, but, this can be changed by specifying the-config command line flag. Configuration file is re-read whenever it is modified which makes run-time re-configuration of nfd-worker straightforward.

Worker configuration file is read inside the container, and thus, Volumes and VolumeMounts are needed to make your configuration available for NFD. The preferred method is to use a ConfigMap which provides easy deployment and re-configurability.

The provided nfd-worker deployment templates create an empty configmap and mount it inside the nfd-worker containers. In kustomize deployments, configuration can be edited with:

kubectl -n ${NFD_NS} edit configmap nfd-worker-conf
-

In Helm deployments, Worker pod parameter worker.config can be used to edit the respective configuration.

See nfd-worker configuration file reference for more details. The (empty-by-default) example config contains all available configuration options and can be used as a reference for creating creating a configuration.

Configuration options can also be specified via the -options command line flag, in which case no mounts need to be used. The same format as in the config file must be used, i.e. JSON (or YAML). For example:

-options='{"sources": { "pci": { "deviceClassWhitelist": ["12"] } } }'
+

In Helm deployments, Worker pod parameter worker.config can be used to edit the respective configuration.

See nfd-worker configuration file reference for more details. The (empty-by-default) example config contains all available configuration options and can be used as a reference for creating creating a configuration.

Configuration options can also be specified via the -options command line flag, in which case no mounts need to be used. The same format as in the config file must be used, i.e. JSON (or YAML). For example:

-options='{"sources": { "pci": { "deviceClassWhitelist": ["12"] } } }'
 

Configuration options specified from the command line will override those read from the config file.

Using node labels

Nodes with specific features can be targeted using the nodeSelector field. The following example shows how to target nodes with Intel TurboBoost enabled.

apiVersion: v1
 kind: Pod
 metadata:
@@ -143,7 +143,7 @@ data:
 

For more details on targeting nodes, see node selection.

Uninstallation

Operator was used for deployment

If you followed the deployment instructions above you can simply do:

kubectl -n nfd delete NodeFeatureDiscovery my-nfd-deployment
 

Optionally, you can also remove the namespace:

kubectl delete ns nfd
 

See the node-feature-discovery-operator and OLM project documentation for instructions for uninstalling the operator and operator lifecycle manager, respectively.

Manual

Simplest way is to invoke kubectl delete on the deployment files you used. Beware that this will also delete the namespace that NFD is running in. For example, in case the default deployment from the repo was used:


-kubectl delete -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.11.1
+kubectl delete -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.11.2
 

Alternatively you can delete create objects one-by-one, depending on the type of deployment, for example:

NFD_NS=node-feature-discovery
 kubectl -n $NFD_NS delete ds nfd-worker
 kubectl -n $NFD_NS delete deploy nfd-master
@@ -151,7 +151,7 @@ kubectl -n $NFD_NS delete svc nf
 kubectl -n $NFD_NS delete sa nfd-master
 kubectl delete clusterrole nfd-master
 kubectl delete clusterrolebinding nfd-master
-

Removing feature labels

NFD-Master has a special -prune command line flag for removing all nfd-related node labels, annotations and extended resources from the cluster.

kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/prune?ref=v0.11.1
+

Removing feature labels

NFD-Master has a special -prune command line flag for removing all nfd-related node labels, annotations and extended resources from the cluster.

kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/prune?ref=v0.11.2
 kubectl -n node-feature-discovery wait job.batch/nfd-prune --for=condition=complete && \
-    kubectl delete -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/prune?ref=v0.11.1
-

NOTE: You must run prune before removing the RBAC rules (serviceaccount, clusterrole and clusterrolebinding).


Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file + kubectl delete -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/prune?ref=v0.11.2 +

NOTE: You must run prune before removing the RBAC rules (serviceaccount, clusterrole and clusterrolebinding).


Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file diff --git a/v0.11/get-started/examples-and-demos.html b/v0.11/get-started/examples-and-demos.html index e25fa6838..72771ce0a 100644 --- a/v0.11/get-started/examples-and-demos.html +++ b/v0.11/get-started/examples-and-demos.html @@ -1 +1 @@ - Examples and demos · Node Feature Discovery

Examples and demos

Table of contents

  1. Demos
    1. Usage demo
    2. Demo use case

This page contains usage examples and demos.

Demos

Usage demo

asciicast

Demo use case

A demo on the benefits of using node feature discovery can be found in the source code repository under demo/.


Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file + Examples and demos · Node Feature Discovery

Examples and demos

Table of contents

  1. Demos
    1. Usage demo
    2. Demo use case

This page contains usage examples and demos.

Demos

Usage demo

asciicast

Demo use case

A demo on the benefits of using node feature discovery can be found in the source code repository under demo/.


Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file diff --git a/v0.11/get-started/features.html b/v0.11/get-started/features.html index eeef184c1..d0f354f58 100644 --- a/v0.11/get-started/features.html +++ b/v0.11/get-started/features.html @@ -1,4 +1,4 @@ - Feature labels · Node Feature Discovery

Feature labels

Table of contents

  1. Built-in labels
    1. CPU
    2. IOMMU (deprecated)
    3. Kernel
    4. Memory
    5. Network
    6. PCI
    7. USB
    8. Storage
    9. System
    10. Custom
  2. User defined labels
  3. Extended resources

Features are advertised as labels in the Kubernetes Node object.

Built-in labels

Label creation in nfd-worker is performed by a set of separate modules called label sources. The core.labelSources configuration option (or -label-sources flag) of nfd-worker controls which sources to enable for label generation.

All built-in labels use the feature.node.kubernetes.io label namespace and have the following format.

feature.node.kubernetes.io/<feature> = <value>
+        Feature labels · Node Feature Discovery                      

Feature labels

Table of contents

  1. Built-in labels
    1. CPU
    2. IOMMU (deprecated)
    3. Kernel
    4. Memory
    5. Network
    6. PCI
    7. USB
    8. Storage
    9. System
    10. Custom
  2. User defined labels
  3. Extended resources

Features are advertised as labels in the Kubernetes Node object.

Built-in labels

Label creation in nfd-worker is performed by a set of separate modules called label sources. The core.labelSources configuration option (or -label-sources flag) of nfd-worker controls which sources to enable for label generation.

All built-in labels use the feature.node.kubernetes.io label namespace and have the following format.

feature.node.kubernetes.io/<feature> = <value>
 

Note: Consecutive runs of nfd-worker will update the labels on a given node. If features are not discovered on a consecutive run, the corresponding label will be removed. This includes any restrictions placed on the consecutive run, such as restricting discovered features with the -label-whitelist option.

CPU

Feature name Value Description
cpu-cpuid.<cpuid-flag> true CPU capability is supported. NOTE: the capability might be supported but not enabled.
cpu-hardware_multithreading true Hardware multithreading, such as Intel HTT, enabled (number of logical CPUs is greater than physical CPUs)
cpu-power.sst_bf.enabled true Intel SST-BF (Intel Speed Select Technology - Base frequency) enabled
cpu-pstate.status string The status of the Intel pstate driver when in use and enabled, either ‘active' or ‘passive'.
cpu-pstate.turbo bool Set to ‘true' if turbo frequencies are enabled in Intel pstate driver, set to ‘false' if they have been disabled.
cpu-pstate.scaling_governor string The value of the Intel pstate scaling_governor when in use, either ‘powersave' or ‘performance'.
cpu-cstate.enabled bool Set to ‘true' if cstates are set in the intel_idle driver, otherwise set to ‘false'. Unset if intel_idle cpuidle driver is not active.
cpu-rdt.<rdt-flag> true Intel RDT capability is supported. See RDT flags for details.
cpu-sgx.enabled true Set to ‘true' if Intel SGX is enabled in BIOS (based a non-zero sum value of SGX EPC section sizes).
cpu-se.enabled true Set to ‘true' if IBM Secure Execution for Linux (IBM Z & LinuxONE) is available and enabled (requires /sys/firmware/uv/prot_virt_host facility)
cpu-model.vendor_id string Comparable CPU vendor ID.
cpu-model.family int CPU family.
cpu-model.id int CPU model number.

The CPU label source is configurable, see worker configuration and sources.cpu configuration options for details.

X86 CPUID flags (partial list)

Flag Description
ADX Multi-Precision Add-Carry Instruction Extensions (ADX)
AESNI Advanced Encryption Standard (AES) New Instructions (AES-NI)
AVX Advanced Vector Extensions (AVX)
AVX2 Advanced Vector Extensions 2 (AVX2)
AMXBF16 Advanced Matrix Extension, tile multiplication operations on BFLOAT16 numbers
AMXINT8 Advanced Matrix Extension, tile multiplication operations on 8-bit integers
AMXTILE Advanced Matrix Extension, base tile architecture support
AVX512BF16 AVX-512 BFLOAT16 instructions
AVX512BITALG AVX-512 bit Algorithms
AVX512BW AVX-512 byte and word Instructions
AVX512CD AVX-512 conflict detection instructions
AVX512DQ AVX-512 doubleword and quadword instructions
AVX512ER AVX-512 exponential and reciprocal instructions
AVX512F AVX-512 foundation
AVX512FP16 AVX-512 FP16 instructions
AVX512IFMA AVX-512 integer fused multiply-add instructions
AVX512PF AVX-512 prefetch instructions
AVX512VBMI AVX-512 vector bit manipulation instructions
AVX512VBMI2 AVX-512 vector bit manipulation instructions, version 2
AVX512VL AVX-512 vector length extensions
AVX512VNNI AVX-512 vector neural network instructions
AVX512VP2INTERSECT AVX-512 intersect for D/Q
AVX512VPOPCNTDQ AVX-512 vector population count doubleword and quadword
ENQCMD Enqueue Command
GFNI Galois Field New Instructions
HYPERVISOR Running under hypervisor
VAES AVX-512 vector AES instructions
VPCLMULQDQ Carry-less multiplication quadword

By default, the following CPUID flags have been blacklisted: BMI1, BMI2, CLMUL, CMOV, CX16, ERMS, F16C, HTT, LZCNT, MMX, MMXEXT, NX, POPCNT, RDRAND, RDSEED, RDTSCP, SGX, SSE, SSE2, SSE3, SSE4, SSE42 and SSSE3. See sources.cpu configuration options to change the behavior.

See the full list in github.com/klauspost/cpuid.

Arm CPUID flags (partial list)

Flag Description
IDIVA Integer divide instructions available in ARM mode
IDIVT Integer divide instructions available in Thumb mode
THUMB Thumb instructions
FASTMUL Fast multiplication
VFP Vector floating point instruction extension (VFP)
VFPv3 Vector floating point extension v3
VFPv4 Vector floating point extension v4
VFPD32 VFP with 32 D-registers
HALF Half-word loads and stores
EDSP DSP extensions
NEON NEON SIMD instructions
LPAE Large Physical Address Extensions

Arm64 CPUID flags (partial list)

Flag Description
AES Announcing the Advanced Encryption Standard
EVSTRM Event Stream Frequency Features
FPHP Half Precision(16bit) Floating Point Data Processing Instructions
ASIMDHP Half Precision(16bit) Asimd Data Processing Instructions
ATOMICS Atomic Instructions to the A64
ASIMRDM Support for Rounding Double Multiply Add/Subtract
PMULL Optional Cryptographic and CRC32 Instructions
JSCVT Perform Conversion to Match Javascript
DCPOP Persistent Memory Support

Intel RDT flags

Flag Description
RDTMON Intel RDT Monitoring Technology
RDTCMT Intel Cache Monitoring (CMT)
RDTMBM Intel Memory Bandwidth Monitoring (MBM)
RDTL3CA Intel L3 Cache Allocation Technology
RDTl2CA Intel L2 Cache Allocation Technology
RDTMBA Intel Memory Bandwidth Allocation (MBA) Technology

IOMMU (deprecated)

Feature Value Description
iommu.enabled true IOMMU is present and enabled in the kernel

DEPRECATED: The iommu source is deprecated and not enabled by default.

Kernel

Feature Value Description
kernel-config.<option> true Kernel config option is enabled (set ‘y' or ‘m'). Default options are NO_HZ, NO_HZ_IDLE, NO_HZ_FULL and PREEMPT
kernel-selinux.enabled true Selinux is enabled on the node
kernel-version.full string Full kernel version as reported by /proc/sys/kernel/osrelease (e.g. ‘4.5.6-7-g123abcde')
kernel-version.major string First component of the kernel version (e.g. ‘4')
kernel-version.minor string Second component of the kernel version (e.g. ‘5')
kernel-version.revision string Third component of the kernel version (e.g. ‘6')

The kernel label source is configurable, see worker configuration and sources.kernel configuration options for details.

Memory

Feature Value Description
memory-numa true Multiple memory nodes i.e. NUMA architecture detected
memory-nv.present true NVDIMM device(s) are present
memory-nv.dax true NVDIMM region(s) configured in DAX mode are present

Network

Feature Value Description
network-sriov.capable true Single Root Input/Output Virtualization (SR-IOV) enabled Network Interface Card(s) present
network-sriov.configured true SR-IOV virtual functions have been configured

PCI

Feature Value Description
pci-<device label>.present true PCI device is detected
pci-<device label>.sriov.capable true Single Root Input/Output Virtualization (SR-IOV) enabled PCI device present

<device label> is format is configurable and set to <class>_<vendor> by default. For more more details about configuration of the pci labels, see sources.pci options and worker configuration instructions.

USB

Feature Value Description
usb-<device label>.present true USB device is detected

<device label> is format is configurable and set to <class>_<vendor>_<device> by default. For more more details about configuration of the usb labels, see sources.usb options and worker configuration instructions.

Storage

Feature Value Description
storage-nonrotationaldisk true Non-rotational disk, like SSD, is present in the node

System

Feature Value Description
system-os_release.ID string Operating system identifier
system-os_release.VERSION_ID string Operating system version identifier (e.g. ‘6.7')
system-os_release.VERSION_ID.major string First component of the OS version id (e.g. ‘6')
system-os_release.VERSION_ID.minor string Second component of the OS version id (e.g. ‘7')

Custom

The custom label source is designed for creating user defined labels. However, it has a few statically defined built-in labels:

Feature Value Description
custom-rdma.capable true The node has an RDMA capable Network adapter
custom-rdma.enabled true The node has the needed RDMA modules loaded to run RDMA traffic

User defined labels

NFD has many extension points for creating vendor and application specific labels. See the customization guide for detailed documentation.

Extended resources

This feature is experimental and by no means a replacement for the usage of device plugins.

Labels which have integer values, can be promoted to Kubernetes extended resources by listing them to the master -resource-labels command line flag. These labels won't then show in the node label section, they will appear only as extended resources.

An example use-case for the extended resources could be based on a hook which creates a label for the node SGX EPC memory section size. By giving the name of that label in the -resource-labels flag, that value will then turn into an extended resource of the node, allowing PODs to request that resource and the Kubernetes scheduler to schedule such PODs to only those nodes which have a sufficient capacity of said resource left.

Similar to labels, the default namespace feature.node.kubernetes.io is automatically prefixed to the extended resource, if the promoted label doesn't have a namespace.

Example usage of the command line arguments, using a new namespace: nfd-master -resource-labels=my_source-my.feature,sgx.some.ns/epc -extra-label-ns=sgx.some.ns

The above would result in following extended resources provided that related labels exist:

  sgx.some.ns/epc: <label value>
   feature.node.kubernetes.io/my_source-my.feature: <label value>
-

Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file +

Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file diff --git a/v0.11/get-started/index.html b/v0.11/get-started/index.html index 27305fcfb..12f7c0d9d 100644 --- a/v0.11/get-started/index.html +++ b/v0.11/get-started/index.html @@ -1,4 +1,4 @@ - Get started · Node Feature Discovery

Node Feature Discovery

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

Continue to:

  • Introduction for more details on the project.

  • Quick start for quick step-by-step instructions on how to get NFD running on your cluster.

Quick-start – the short-short version

$ kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.11.1
+        Get started · Node Feature Discovery                      

Node Feature Discovery

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

Continue to:

  • Introduction for more details on the project.

  • Quick start for quick step-by-step instructions on how to get NFD running on your cluster.

Quick-start – the short-short version

$ kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.11.2
   namespace/node-feature-discovery created
   serviceaccount/nfd-master created
   clusterrole.rbac.authorization.k8s.io/nfd-master created
@@ -22,4 +22,4 @@
     "feature.node.kubernetes.io/cpu-cpuid.AESNI": "true",
 ...
 
-

Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file +

Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file diff --git a/v0.11/get-started/introduction.html b/v0.11/get-started/introduction.html index 617ec550a..791461543 100644 --- a/v0.11/get-started/introduction.html +++ b/v0.11/get-started/introduction.html @@ -1,4 +1,4 @@ - Introduction · Node Feature Discovery

Introduction

Table of contents

  1. NFD-Master
  2. NFD-Worker
  3. NFD-Topology-Updater
  4. Feature Discovery
  5. Node annotations
  6. NodeResourceTopology CR

This software enables node feature discovery for Kubernetes. It detects hardware features available on each node in a Kubernetes cluster, and advertises those features using node labels.

NFD consists of three software components:

  1. nfd-master
  2. nfd-worker
  3. nfd-topology-updater

NFD-Master

NFD-Master is the daemon responsible for communication towards the Kubernetes API. That is, it receives labeling requests from the worker and modifies node objects accordingly.

NFD-Worker

NFD-Worker is a daemon responsible for feature detection. It then communicates the information to nfd-master which does the actual node labeling. One instance of nfd-worker is supposed to be running on each node of the cluster,

NFD-Topology-Updater

NFD-Topology-Updater is a daemon responsible for examining allocated resources on a worker node to account for resources available to be allocated to new pod on a per-zone basis (where a zone can be a NUMA node). It then communicates the information to nfd-master which does the NodeResourceTopology CR creation corresponding to all the nodes in the cluster. One instance of nfd-topology-updater is supposed to be running on each node of the cluster.

Feature Discovery

Feature discovery is divided into domain-specific feature sources:

  • CPU
  • Kernel
  • Memory
  • Network
  • PCI
  • Storage
  • System
  • USB
  • Custom (rule-based custom features)
  • Local (hooks for user-specific features)
  • IOMMU (deprecated)

Each feature source is responsible for detecting a set of features which. in turn, are turned into node feature labels. Feature labels are prefixed with feature.node.kubernetes.io/ and also contain the name of the feature source. Non-standard user-specific feature labels can be created with the local and custom feature sources.

An overview of the default feature labels:

{
+        Introduction · Node Feature Discovery                      

Introduction

Table of contents

  1. NFD-Master
  2. NFD-Worker
  3. NFD-Topology-Updater
  4. Feature Discovery
  5. Node annotations
  6. NodeResourceTopology CR

This software enables node feature discovery for Kubernetes. It detects hardware features available on each node in a Kubernetes cluster, and advertises those features using node labels.

NFD consists of three software components:

  1. nfd-master
  2. nfd-worker
  3. nfd-topology-updater

NFD-Master

NFD-Master is the daemon responsible for communication towards the Kubernetes API. That is, it receives labeling requests from the worker and modifies node objects accordingly.

NFD-Worker

NFD-Worker is a daemon responsible for feature detection. It then communicates the information to nfd-master which does the actual node labeling. One instance of nfd-worker is supposed to be running on each node of the cluster,

NFD-Topology-Updater

NFD-Topology-Updater is a daemon responsible for examining allocated resources on a worker node to account for resources available to be allocated to new pod on a per-zone basis (where a zone can be a NUMA node). It then communicates the information to nfd-master which does the NodeResourceTopology CR creation corresponding to all the nodes in the cluster. One instance of nfd-topology-updater is supposed to be running on each node of the cluster.

Feature Discovery

Feature discovery is divided into domain-specific feature sources:

  • CPU
  • Kernel
  • Memory
  • Network
  • PCI
  • Storage
  • System
  • USB
  • Custom (rule-based custom features)
  • Local (hooks for user-specific features)
  • IOMMU (deprecated)

Each feature source is responsible for detecting a set of features which. in turn, are turned into node feature labels. Feature labels are prefixed with feature.node.kubernetes.io/ and also contain the name of the feature source. Non-standard user-specific feature labels can be created with the local and custom feature sources.

An overview of the default feature labels:

{
   "feature.node.kubernetes.io/cpu-<feature-name>": "true",
   "feature.node.kubernetes.io/custom-<feature-name>": "true",
   "feature.node.kubernetes.io/kernel-<feature name>": "<feature value>",
@@ -49,4 +49,4 @@
         capacity: 3
         allocatable: 3
         available: 3
-

Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file +

Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file diff --git a/v0.11/get-started/quick-start.html b/v0.11/get-started/quick-start.html index 2215ecb09..bfcdf94de 100644 --- a/v0.11/get-started/quick-start.html +++ b/v0.11/get-started/quick-start.html @@ -1,4 +1,4 @@ - Quick start · Node Feature Discovery

Quick start

Minimal steps to deploy latest released version of NFD in your cluster.

Installation

Deploy with kustomize – creates a new namespace, service and required RBAC rules and deploys nfd-master and nfd-worker daemons.

kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.11.1
+        Quick start · Node Feature Discovery                      

Quick start

Minimal steps to deploy latest released version of NFD in your cluster.

Installation

Deploy with kustomize – creates a new namespace, service and required RBAC rules and deploys nfd-master and nfd-worker daemons.

kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.11.2
 

Verify

Wait until NFD master and NFD worker are running.

$ kubectl -n node-feature-discovery get ds,deploy
 NAME                         DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
 daemonset.apps/nfd-worker    2         2         2       2            2           <none>          10s
@@ -31,7 +31,7 @@ spec:
 

See that the pod is running on a desired node

$ kubectl get po feature-dependent-pod -o wide
 NAME                    READY   STATUS    RESTARTS   AGE   IP          NODE     NOMINATED NODE   READINESS GATES
 feature-dependent-pod   1/1     Running   0          23s   10.36.0.4   node-2   <none>           <none>
-

Additional Optional Installation Steps

In order to deploy nfd-master and nfd-topology-updater daemons use topologyupdater overlay.

Deploy with kustomize – creates a new namespace, service and required RBAC rules and nfd-master and nfd-topology-updater daemons.

kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/topologyupdater?ref=v0.11.1
+

Additional Optional Installation Steps

In order to deploy nfd-master and nfd-topology-updater daemons use topologyupdater overlay.

Deploy with kustomize – creates a new namespace, service and required RBAC rules and nfd-master and nfd-topology-updater daemons.

kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/topologyupdater?ref=v0.11.2
 

NOTE:

PodResource API is a prerequisite for nfd-topology-updater.

Preceding Kubernetes v1.23, the kubelet must be started with the following flag:

--feature-gates=KubeletPodResourcesGetAllocatable=true

Starting Kubernetes v1.23, the GetAllocatableResources is enabled by default through KubeletPodResourcesGetAllocatable feature gate.

Verify

Wait until NFD master and NFD topologyupdater are running.

$ kubectl -n node-feature-discovery get ds,deploy
 NAME                                  DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
 daemonset.apps/nfd-topology-updater   2         2         2       2            2           <none>          5s
@@ -91,4 +91,4 @@ Zones:
         Available:    2
     Type:             Node
 Events:               <none>
-

The CR instances created can be used to gain insight into the allocatable resources along with the granularity of those resources at a per-zone level (represented by node-0 and node-1 in the above example) or can be used by an external entity (e.g. topology-aware scheduler plugin) to take an action based on the gathered information.


Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file +

The CR instances created can be used to gain insight into the allocatable resources along with the granularity of those resources at a per-zone level (represented by node-0 and node-1 in the above example) or can be used by an external entity (e.g. topology-aware scheduler plugin) to take an action based on the gathered information.


Node Feature Discovery
v0.11
Versions
GitHub
Homepage
Issues
Download

This Software is under the terms of Apache License 2.0.
\ No newline at end of file diff --git a/v0.11/search.html b/v0.11/search.html index 87483886b..ec5a6634d 100644 --- a/v0.11/search.html +++ b/v0.11/search.html @@ -1 +1 @@ - Search · Node Feature Discovery

Searching


    Node Feature Discovery
    v0.11
    Versions
    GitHub
    Homepage
    Issues
    Download

    This Software is under the terms of Apache License 2.0.
    \ No newline at end of file + Search · Node Feature Discovery

    Searching


      Node Feature Discovery
      v0.11
      Versions
      GitHub
      Homepage
      Issues
      Download

      This Software is under the terms of Apache License 2.0.
      \ No newline at end of file diff --git a/v0.11/sitemap.xml b/v0.11/sitemap.xml index 719a0d250..b5f0995be 100644 --- a/v0.11/sitemap.xml +++ b/v0.11/sitemap.xml @@ -1 +1 @@ - https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/advanced/developer-guide.html 1.0 2022-08-23T12:15:02-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/get-started/ 1.0 2022-08-23T12:15:02-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/get-started/introduction.html 1.0 2022-08-23T12:15:02-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/advanced/master-commandline-reference.html 1.0 2022-08-23T12:15:02-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/advanced/ 0.1 2022-08-23T12:15:02-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/get-started/quick-start.html 1.0 2022-08-23T12:15:02-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/contributing/ 0.5 2022-08-23T12:15:02-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/advanced/worker-commandline-reference.html 1.0 2022-08-23T12:15:02-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/get-started/deployment-and-usage.html 1.0 2022-08-23T12:15:02-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/advanced/worker-configuration-reference.html 1.0 2022-08-23T12:15:02-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/get-started/features.html 1.0 2022-08-23T12:15:02-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/get-started/examples-and-demos.html 0.5 2022-08-23T12:15:02-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/advanced/topology-updater-commandline-reference.html 1.0 2022-08-23T12:15:02-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/advanced/customization-guide.html 1.0 2022-08-23T12:15:02-05:00 \ No newline at end of file + https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/advanced/developer-guide.html 1.0 2022-08-23T23:43:21-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/get-started/ 1.0 2022-08-23T23:43:21-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/get-started/introduction.html 1.0 2022-08-23T23:43:21-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/advanced/master-commandline-reference.html 1.0 2022-08-23T23:43:21-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/advanced/ 0.1 2022-08-23T23:43:21-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/get-started/quick-start.html 1.0 2022-08-23T23:43:21-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/contributing/ 0.5 2022-08-23T23:43:21-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/advanced/worker-commandline-reference.html 1.0 2022-08-23T23:43:21-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/get-started/deployment-and-usage.html 1.0 2022-08-23T23:43:21-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/advanced/worker-configuration-reference.html 1.0 2022-08-23T23:43:21-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/get-started/features.html 1.0 2022-08-23T23:43:21-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/get-started/examples-and-demos.html 0.5 2022-08-23T23:43:21-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/advanced/topology-updater-commandline-reference.html 1.0 2022-08-23T23:43:21-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/advanced/customization-guide.html 1.0 2022-08-23T23:43:21-05:00 \ No newline at end of file