From ced2c2cf27980483e7fb0a299aa80c21fde299c3 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Tue, 26 Oct 2021 06:41:04 +0000 Subject: [PATCH] Update documentation for master Auto-generated from v0.6.0-498-g661d326 by 'update-gh-pages.sh' --- master/404.html | 2 +- master/advanced/developer-guide.html | 4 ++-- master/advanced/index.html | 2 +- master/advanced/master-commandline-reference.html | 4 ++-- master/advanced/worker-commandline-reference.html | 4 ++-- master/advanced/worker-configuration-reference.html | 4 ++-- master/contributing/index.html | 2 +- master/data.json | 2 +- master/get-started/deployment-and-usage.html | 6 +++--- master/get-started/examples-and-demos.html | 2 +- master/get-started/features.html | 4 ++-- master/get-started/index.html | 4 ++-- master/get-started/introduction.html | 4 ++-- master/get-started/quick-start.html | 4 ++-- master/search.html | 2 +- master/sitemap.xml | 2 +- 16 files changed, 26 insertions(+), 26 deletions(-) diff --git a/master/404.html b/master/404.html index 8f73b012b..6e3ea9762 100644 --- a/master/404.html +++ b/master/404.html @@ -1 +1 @@ - 404 · Node Feature Discovery

404

Not Found


Node Feature Discovery
master
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
master
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/master/advanced/developer-guide.html b/master/advanced/developer-guide.html index b3dfdd37d..5f5bb0b4e 100644 --- a/master/advanced/developer-guide.html +++ b/master/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. Deployment
    4. Building locally
    5. Customizing the build
    6. Testing
  2. Running locally
    1. NFD-Master
    2. NFD-Worker
  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. Deployment
    4. Building locally
    5. Customizing the build
    6. Testing
  2. Running locally
    1. NFD-Master
    2. NFD-Worker
  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>
@@ -75,4 +75,4 @@ Usage of nfd-worker:
         Print version and exit.
 

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.

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
master
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
master
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/master/advanced/index.html b/master/advanced/index.html index e9e485823..dde8e8c9d 100644 --- a/master/advanced/index.html +++ b/master/advanced/index.html @@ -1 +1 @@ - Advanced · Node Feature Discovery

Advanced

Advanced topics and reference.


Node Feature Discovery
master
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
master
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/master/advanced/master-commandline-reference.html b/master/advanced/master-commandline-reference.html index 554fd14f8..f126ca3f5 100644 --- a/master/advanced/master-commandline-reference.html +++ b/master/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. -label-whitelist
  12. -extra-label-ns
  13. -resource-labels
  14. Logging

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

docker run gcr.io/k8s-staging-nfd/node-feature-discovery:master 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. -label-whitelist
  12. -extra-label-ns
  13. -resource-labels
  14. Logging

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

docker run gcr.io/k8s-staging-nfd/node-feature-discovery:master 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
@@ -10,4 +10,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
master
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
master
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/master/advanced/worker-commandline-reference.html b/master/advanced/worker-commandline-reference.html index 8ded9bc16..1cd754f80 100644 --- a/master/advanced/worker-commandline-reference.html +++ b/master/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. -sources
  11. -no-publish
  12. -label-whitelist
  13. -oneshot
  14. -sleep-interval
  15. Logging

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

docker run gcr.io/k8s-staging-nfd/node-feature-discovery:master 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. -sources
  11. -no-publish
  12. -label-whitelist
  13. -oneshot
  14. -sleep-interval
  15. Logging

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

docker run gcr.io/k8s-staging-nfd/node-feature-discovery:master 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
@@ -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.

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
master
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
master
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/master/advanced/worker-configuration-reference.html b/master/advanced/worker-configuration-reference.html index 3f9a55099..21d15c7b1 100644 --- a/master/advanced/worker-configuration-reference.html +++ b/master/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.sources
    3. core.labelWhiteList
    4. core.noPublish
    5. 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.sources
    3. core.labelWhiteList
    4. core.noPublish
    5. 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.sources

core.sources specifies the list of enabled feature sources. A special value all enables all feature sources.

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

Default: [all]

Example:

core:
   sources:
@@ -42,4 +42,4 @@
     - pciId:
         class: ["0200"]
         vendor: ["8086"]
-

Node Feature Discovery
master
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
master
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/master/contributing/index.html b/master/contributing/index.html index 552fccc24..1df405c30 100644 --- a/master/contributing/index.html +++ b/master/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
master
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
master
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/master/data.json b/master/data.json index 5cc3bb149..dec58a830 100644 --- a/master/data.json +++ b/master/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. Deployment
    6. \n
    7. Building locally
    8. \n
    9. Customizing the build
    10. \n
    11. Testing
    12. \n
    \n
  2. \n
  3. Running locally
      \n
    1. NFD-Master
    2. \n
    3. NFD-Worker
    4. \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

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
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_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 namespacekube-system
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=gcr.io/k8s-staging-nfd/node-feature-discovery:master\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

Command line flags of nfd-master:

\n\n
$ docker run --rm ${NFD_CONTAINER_IMAGE} nfd-master -help\nUsage of nfd-master:\n  -ca-file string\n        Root certificate for verifying connections\n  -cert-file string\n        Certificate used for authenticating connections\n  -extra-label-ns value\n        Comma separated list of allowed extra label namespaces\n  -instance string\n        Instance name. Used to separate annotation namespaces for multiple parallel deployments.\n  -key-file string\n        Private key matching -cert-file\n  -kubeconfig string\n        Kubeconfig to use\n  -label-whitelist value\n        Regular expression to filter label names to publish to the Kubernetes API server. NB: the label namespace is omitted i.e. the filter is only applied to the name part after '/'.\n  -no-publish\n        Do not publish feature labels\n  -port int\n        Port on which to listen for connections. (default 8080)\n  -prune\n        Prune all NFD related attributes from all nodes of the cluaster and exit.\n  -resource-labels value\n        Comma separated list of labels to be exposed as extended resources.\n  -verify-node-name\n        Verify worker node name against the worker's TLS certificate. Only takes effect when TLS authentication has been enabled.\n  -version\n        Print version and exit.\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

Command line flags of nfd-worker:

\n\n
$ docker run --rm ${NFD_CONTAINER_IMAGE} nfd-worker -help\nUsage of nfd-worker:\n  -ca-file string\n        Root certificate for verifying connections\n  -cert-file string\n        Certificate used for authenticating connections\n  -config string\n        Config file to use. (default \"/etc/kubernetes/node-feature-discovery/nfd-worker.conf\")\n  -key-file string\n        Private key matching -cert-file\n  -label-whitelist value\n        Regular expression to filter label names to publish to the Kubernetes API server. NB: the label namespace is omitted i.e. the filter is only applied to the name part after '/'. DEPRECATED: This parameter should be set via the config file.\n  -no-publish\n        Do not publish discovered features, disable connection to nfd-master.\n  -oneshot\n        Do not publish feature labels\n  -options string\n        Specify config options from command line. Config options are specified in the same format as in the config file (i.e. json or yaml). These options\n  -server string\n        NFD server address to connecto to. (default \"localhost:8080\")\n  -server-name-override string\n        Hostname expected from server certificate, useful in testing\n  -sleep-interval duration\n        Time to sleep between re-labeling. Non-positive value implies no re-labeling (i.e. infinite sleep). DEPRECATED: This parameter should be set via the config file\n  -sources value\n        Comma separated list of feature sources. Special value 'all' enables all feature sources. DEPRECATED: This parameter should be set via the config file\n  -version\n        Print version and exit.\n
\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

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":"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. Feature discovery
  6. \n
  7. Node annotations
  8. \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 two software components:

\n\n
    \n
  1. nfd-master
  2. \n
  3. nfd-worker
  4. \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

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/iommu-<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","dir":"/get-started/","name":"introduction.md","path":"get-started/introduction.md","url":"/get-started/introduction.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=master\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 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...\n\n
\n","dir":"/get-started/","name":"index.md","path":"get-started/index.md","url":"/get-started/"},{"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":"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. -label-whitelist
  22. \n
  23. -extra-label-ns
  24. \n
  25. -resource-labels
  26. \n
  27. Logging
  28. \n
\n\n
\n\n

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

\n\n
docker run gcr.io/k8s-staging-nfd/node-feature-discovery:master 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 all communication with the Kubernetes API\nserver, making a “dry-run” flag for nfd-master. No Labels, Annotations or\nExtendedResources (or any other properties of any Kubernetes API objects) are\nmodified.

\n\n

Default: false

\n\n

Example:

\n\n
nfd-master -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

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":"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=master\n
\n\n

Verify

\n\n

Wait until NFD master and 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   3         3         3       3            3           <none>          5s\nNAME                         READY   UP-TO-DATE   AVAILABLE   AGE\ndeployment.apps/nfd-master   1/1     1            1           17s\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","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. -sources
  20. \n
  21. -no-publish
  22. \n
  23. -label-whitelist
  24. \n
  25. -oneshot
  26. \n
  27. -sleep-interval
  28. \n
  29. Logging
  30. \n
\n\n
\n\n

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

\n\n
docker run gcr.io/k8s-staging-nfd/node-feature-discovery:master 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

-sources

\n\n

The -sources flag specifies a comma-separated list of enabled feature\nsources. A special value all enables all feature sources.

\n\n

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

\n\n

Default: all

\n\n

Example:

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

DEPRECATED: you should use the core.sources option in the\nconfiguration file, 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. Requirements
  2. \n
  3. Image variants
      \n
    1. Full
    2. \n
    3. Minimal
    4. \n
    \n
  4. \n
  5. 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
  6. \n
  7. Usage
      \n
    1. NFD-Master
    2. \n
    3. NFD-Worker
    4. \n
    5. Communication security with TLS
    6. \n
    \n
  8. \n
  9. Worker configuration
  10. \n
  11. Using node labels
  12. \n
  13. Uninstallation
      \n
    1. Operator was used for deployment
    2. \n
    3. Manual
    4. \n
    5. Removing feature labels
    6. \n
    \n
  14. \n
\n\n
\n\n

Requirements

\n\n
    \n
  1. Linux (x86_64/Arm64/Arm)
  2. \n
  3. kubectl\n(properly set up and configured to work with your Kubernetes cluster)
  4. \n
\n\n

Image variants

\n\n

NFD currently offers two variants of the container image. The “full” variant is\ncurrently deployed by default.

\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. gcr.io/k8s-staging-nfd/node-feature-discovery:master-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 resource (in nfd namespace here):

    \n\n
     cat << EOF | kubectl apply -f -\n apiVersion: v1\n kind: Namespace\n metadata:\n   name: nfd\n ---\n apiVersion: nfd.kubernetes.io/v1alpha1\n kind: NodeFeatureDiscovery\n metadata:\n   name: my-nfd-deployment\n   namespace: nfd\n EOF\n
    \n
  6. \n
\n\n

In order to deploy the minimal image you need to add

\n\n
  image: gcr.io/k8s-staging-nfd/node-feature-discovery:master-minimal\n
\n\n

to the metadata of NodeFeatureDiscovery object above.

\n\n

Deployment with kustomize

\n\n

The kustomize overlays provided in the repo can be used directly:

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

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

\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=master\n\n
\n\n

This creates a DaemonSet runs both 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

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=master | \\\n    sed s\"/NUM_NODES/$NUM_NODES/\" | \\\n    kubectl apply -f -\n
\n\n

The example above launces 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

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=master-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 \n \n \n \n \n \n
NameTypeDefaultdescription
image.repositorystringgcr.io/k8s-staging-nfd/node-feature-discoveryNFD image repository
image.tagstringmasterNFD 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
serviceAccount.createbooltrueSpecifies whether a service account should be created
serviceAccount.annotationsdict{}Annotations to add to the service account
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
rbacdict RBAC parameteres
nameOverridestring Override the name of the chart
fullnameOverridestring Override a default fully qualified app name
\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
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.replicaCountinteger1Number of desired pods. This is a pointer to distinguish between explicit zero and not specified
master.podSecurityContextdict{}SecurityContext holds pod-level security attributes and common container settings
master.service.typestringClusterIPNFD master service type
master.service.portintegerportNFD 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 metadata
master.affinitydict NFD master pod required node affinity
\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
NameTypeDefaultdescription
worker.*dict NFD worker daemonset configuration
worker.configmapNamestringnfd-worker-confNFD worker pod ConfigMap name
worker.configdict NFD worker configuration
worker.podSecurityContextdict{}SecurityContext holds pod-level security attributes and common container settings
worker.securityContextdict{}Container security settings
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 metadata
\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

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.\nThe template specs provided with NFD contain (commented out) example\nconfiguration for 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).\nAdditional 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.

\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

NFD source code repository contains an example kustomize overlay that can be\nused to deploy NFD with cert-manager supplied certificates enabled. The\ninstructions below describe steps how to generate a self-signed CA certificate\nand set up cert-manager’s\nCA Issuer to sign\nCertificate requests for NFD components in node-feature-discovery\nnamespace.

\n\n
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.5.1/cert-manager.yaml\nopenssl genrsa -out deployment/overlays/samples/cert-manager/tls.key 2048\nopenssl req -x509 -new -nodes -key deployment/overlays/samples/cert-manager/tls.key -subj \"/CN=nfd-ca\" \\\n        -days 10000 -out deployment/overlays/samples/cert-manager/tls.crt\nkubectl apply -k deployment/overlays/samples/cert-manager\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. Configuration can be edited with:

\n\n
kubectl -n ${NFD_NS} edit configmap nfd-worker-conf\n
\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=master\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=master\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=master\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":"Feature discovery","layout":"default","sort":4,"content":"

Feature discovery

\n\n

Table of contents

\n\n
    \n
  1. Feature labels
  2. \n
  3. Feature sources
      \n
    1. CPU
    2. \n
    3. Custom
    4. \n
    5. IOMMU
    6. \n
    7. Kernel
    8. \n
    9. Memory
    10. \n
    11. Network
    12. \n
    13. PCI
    14. \n
    15. USB
    16. \n
    17. Storage
    18. \n
    19. System
    20. \n
    21. Local – user-specific features
    22. \n
    \n
  4. \n
  5. Extended resources
  6. \n
\n\n
\n\n

Feature discovery in nfd-worker is performed by a set of separate modules\ncalled feature sources. Most of them are specifically responsible for certain\ndomain of features (e.g. cpu). In addition there are two highly customizable\nfeature sources that work accross the system.

\n\n

Feature labels

\n\n

Each discovered feature is advertised a label in the Kubernetes Node object.\nThe published node labels encode a few pieces of information:

\n\n\n\n

Feature label names adhere to the following pattern:

\n\n
<namespace>/<source name>-<feature name>[.<attribute name>]\n
\n\n

The last component (i.e. attribute-name) is optional, and only used if a\nfeature logically has sub-hierarchy, e.g. sriov.capable and\nsriov.configure from the network source.

\n\n

The -sources flag controls which sources to use for discovery.

\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

Feature sources

\n\n

CPU

\n\n

The cpu feature source supports the following labels:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \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 nameAttributeDescription
cpuid<cpuid flag>CPU capability is supported
hardware_multithreading Hardware multithreading, such as Intel HTT, enabled (number of logical CPUs is greater than physical CPUs)
powersst_bf.enabledIntel SST-BF (Intel Speed Select Technology - Base frequency) enabled
pstatestatusThe status of the Intel pstate driver when in use and enabled, either ‘active’ or ‘passive’.
 turboSet to ‘true’ if turbo frequencies are enabled in Intel pstate driver, set to ‘false’ if they have been disabled.
 scaling_governorThe value of the Intel pstate scaling_governor when in use, either ‘powersave’ or ‘performance’.
cstateenabledSet to ‘true’ if cstates are set in the intel_idle driver, otherwise set to ‘false’. Unset if intel_idle cpuidle driver is not active.
rdtRDTMONIntel 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

The (sub-)set of CPUID attributes to publish is configurable via the\nattributeBlacklist and attributeWhitelist cpuid options of the cpu source.\nIf whitelist is specified, only whitelisted attributes will be published. With\nblacklist, only blacklisted attributes are filtered out. attributeWhitelist\nhas priority over attributeBlacklist. For examples and more information\nabout configurability, see\nconfiguration.\nBy default, the following CPUID flags have been blacklisted:\nBMI1, BMI2, CLMUL, CMOV, CX16, ERMS, F16C, HTT, LZCNT, MMX, MMXEXT, NX, POPCNT,\nRDRAND, RDSEED, RDTSCP, SGX, SSE, SSE2, SSE3, SSE4, SSE42 and SSSE3.

\n\n

NOTE The cpuid features advertise supported CPU capabilities, that is, a\ncapability might be supported but not enabled.

\n\n

X86 CPUID attributes (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
AttributeDescription
ADXMulti-Precision Add-Carry Instruction Extensions (ADX)
AESNIAdvanced Encryption Standard (AES) New Instructions (AES-NI)
AVXAdvanced Vector Extensions (AVX)
AVX2Advanced Vector Extensions 2 (AVX2)
\n\n

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

\n\n

Arm CPUID attribute (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
AttributeDescription
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 attribute (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
AttributeDescription
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

Custom

\n\n

The Custom feature source allows the user to define features based on a mix of\npredefined rules. A rule is provided input witch affects its process of\nmatching for a defined feature. The rules are specified in the\nnfd-worker configuration file. See\nconfiguration for instructions\nand examples how to set-up and manage the worker configuration.

\n\n

To aid in making Custom Features clearer, we define a general and a per rule\nnomenclature, keeping things as consistent as possible.

\n\n

Additional configuration directory

\n\n

Additionally to the rules defined in the nfd-worker configuration file, the\nCustom feature 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. This directory must be available\ninside the NFD worker container, so Volumes and VolumeMounts must be used for\nmounting e.g. ConfigMap(s). The example deployment manifests provide an example\n(commented out) for providing Custom configuration with an additional\nConfigMap, mounted into the custom.d directory.

\n\n

General nomenclature & 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

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

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

Statically defined features

\n\n

Some feature labels which are common and generic are defined statically in the\ncustom feature source. A user may add additional Matchers to these feature\nlabels by defining them in the nfd-worker configuration file.

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureAttributeDescription
rdmacapableThe node has an RDMA capable Network adapter
rdmaenabledThe node has the needed RDMA modules loaded to run RDMA traffic
\n\n

IOMMU

\n\n

The iommu feature source supports the following labels:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n
Feature nameDescription
enabledIOMMU is present and enabled in the kernel
\n\n

Kernel

\n\n

The kernel feature source supports the following labels:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureAttributeDescription
config<option name>Kernel config option is enabled (set ‘y’ or ‘m’). Default options are NO_HZ, NO_HZ_IDLE, NO_HZ_FULL and PREEMPT
selinuxenabledSelinux is enabled on the node
versionfullFull kernel version as reported by /proc/sys/kernel/osrelease (e.g. ‘4.5.6-7-g123abcde’)
 majorFirst component of the kernel version (e.g. ‘4’)
 minorSecond component of the kernel version (e.g. ‘5’)
 revisionThird component of the kernel version (e.g. ‘6’)
\n\n

Kernel config file to use, and, the set of config options to be detected are\nconfigurable. See configuration\nfor more information.

\n\n

Memory

\n\n

The memory feature source supports the following labels:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureAttributeDescription
numa Multiple memory nodes i.e. NUMA architecture detected
nvpresentNVDIMM device(s) are present
nvdaxNVDIMM region(s) configured in DAX mode are present
\n\n

Network

\n\n

The network feature source supports the following labels:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureAttributeDescription
sriovcapableSingle Root Input/Output Virtualization (SR-IOV) enabled Network Interface Card(s) present
 configuredSR-IOV virtual functions have been configured
\n\n

PCI

\n\n

The pci feature source supports the following labels:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureAttributeDescription
<device label>presentPCI device is detected
<device label>sriov.capableSingle Root Input/Output Virtualization (SR-IOV) enabled PCI device present
\n\n

<device label> is composed of raw PCI IDs, separated by underscores. The set\nof fields used in <device label> is configurable, valid fields being class,\nvendor, device, subsystem_vendor and subsystem_device. Defaults are\nclass and vendor. An example label using the default label fields:

\n\n
feature.node.kubernetes.io/pci-1200_8086.present=true\n
\n\n

Also the set of PCI device classes that the feature source detects is\nconfigurable. By default, device classes (0x)03, (0x)0b40 and (0x)12, i.e.\nGPUs, co-processors and accelerator cards are detected.

\n\n

USB

\n\n

The usb feature source supports the following labels:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureAttributeDescription
<device label>presentUSB device is detected
\n\n

<device label> is composed of raw USB IDs, separated by underscores. The set\nof fields used in <device label> is configurable, valid fields being class,\nvendor, device and serial. Defaults are class, vendor and device.\nAn example label using the default label fields:

\n\n
feature.node.kubernetes.io/usb-fe_1a6e_089a.present=true\n
\n\n

See configuration for more\ninformation on NFD config.

\n\n

Storage

\n\n

The storage feature source supports the following labels:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n
Feature nameDescription
nonrotationaldiskNon-rotational disk, like SSD, is present in the node
\n\n

System

\n\n

The system feature source supports the following labels:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureAttributeDescription
os_releaseIDOperating system identifier
 VERSION_IDOperating system version identifier (e.g. ‘6.7’)
 VERSION_ID.majorFirst component of the OS version id (e.g. ‘6’)
 VERSION_ID.minorSecond component of the OS version id (e.g. ‘7’)
\n\n

Local – user-specific features

\n\n

NFD has a special feature source named local which is designed for getting\nthe labels from user-specific feature detector. It provides a mechanism for\nusers to implement custom feature sources in a pluggable way, without modifying\nnfd source code or Docker images. The local feature source can be used to\nadvertise new user-specific features, and, for overriding labels created by the\nother feature sources.

\n\n

The local feature source gets its labels by two different ways:

\n\n\n\n

NOTE: The minimal image variant only\nsupports running statically linked binaries.

\n\n

These directories must be available inside the Docker image so Volumes and\nVolumeMounts must be used if standard NFD images are used. The given template\nfiles mount by default the source.d and the features.d directories\nrespectively from /etc/kubernetes/node-feature-discovery/source.d/ and\n/etc/kubernetes/node-feature-discovery/features.d/ from the host. You should\nupdate them to match your needs.

\n\n

In both cases, the labels can be binary or non binary, using either <name> or\n<name>=<value> format.

\n\n

Unlike the other feature sources, the name of the file, instead of the name of\nthe feature source (that would be local in this case), is used as a prefix in\nthe label name, normally. However, if the <name> of the label starts with a\nslash (/) it is used as the label name as is, without any additional prefix.\nThis makes it possible for the user to fully control the feature label names,\ne.g. for overriding labels created by other feature sources.

\n\n

You can also override the default namespace of your labels using this format:\n<namespace>/<name>[=<value>]. If using something else than\n[<sub-ns>.]feature.node.kubernetes.io or\n[<sub-ns>.]profile.node.kubernetes.io, you must whitelist your namespace\nusing the -extra-label-ns option on the master.\nIn this case, the name of the\nfile will not be added to the label name. For example, if you want to add the\nlabel my.namespace.org/my-label=value, your hook output or file must contains\nmy.namespace.org/my-label=value and you must add\n-extra-label-ns=my.namespace.org on the master command line.

\n\n

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

\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. It is possible to mount\nthe source.d and/or features.d directories common with the NFD Pod and\ndeploy the custom hooks/features there. NFD will periodically scan the\ndirectories and run any hooks and read any feature files it finds. The\ndefault deployments contain hostPath mounts for sources.d and features.d\ndirectories. By using the same mounts in the secondary Pod (e.g. device plugin)\nyou have created a shared area for delivering hooks and feature files to NFD.

\n\n

A hook example

\n\n

User has a shell script\n/etc/kubernetes/node-feature-discovery/source.d/my-source which has the\nfollowing stdout output:

\n\n
MY_FEATURE_1\nMY_FEATURE_2=myvalue\n/override_source-OVERRIDE_BOOL\n/override_source-OVERRIDE_VALUE=123\noverride.namespace/value=456\n
\n\n

which, in turn, will translate into the following node labels:

\n\n
feature.node.kubernetes.io/my-source-MY_FEATURE_1=true\nfeature.node.kubernetes.io/my-source-MY_FEATURE_2=myvalue\nfeature.node.kubernetes.io/override_source-OVERRIDE_BOOL=true\nfeature.node.kubernetes.io/override_source-OVERRIDE_VALUE=123\noverride.namespace/value=456\n
\n\n

A file example

\n\n

User has a file /etc/kubernetes/node-feature-discovery/features.d/my-source\nwhich contains the following lines:

\n\n
MY_FEATURE_1\nMY_FEATURE_2=myvalue\n/override_source-OVERRIDE_BOOL\n/override_source-OVERRIDE_VALUE=123\noverride.namespace/value=456\n
\n\n

which, in turn, will translate into the following node labels:

\n\n
feature.node.kubernetes.io/my-source-MY_FEATURE_1=true\nfeature.node.kubernetes.io/my-source-MY_FEATURE_2=myvalue\nfeature.node.kubernetes.io/override_source-OVERRIDE_BOOL=true\nfeature.node.kubernetes.io/override_source-OVERRIDE_VALUE=123\noverride.namespace/value=456\n
\n\n

NFD tries to run any regular files found from the hooks directory. Any\nadditional data files your hook might need (e.g. a configuration file) should\nbe placed in a separate directory in order to avoid NFD unnecessarily trying to\nexecute these. You can use a subdirectory under the hooks directory, for\nexample /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! 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

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":"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.sources
    4. \n
    5. core.labelWhiteList
    6. \n
    7. core.noPublish
    8. \n
    9. core.klog
    10. \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.sources

\n\n

core.sources specifies the list of enabled feature sources. A special value\nall enables all feature sources.

\n\n

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

\n\n

Default: [all]

\n\n

Example:

\n\n
core:\n  sources:\n    - system\n    - custom\n
\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 details of\nthe available rules and their configuration.

\n\n

Default: empty

\n\n

Example:

\n\n
source:\n  custom:\n  - name: \"my.custom.feature\"\n    matchOn:\n    - loadedKMod: [\"e1000e\"]\n    - pciId:\n        class: [\"0200\"]\n        vendor: [\"8086\"]\n
\n","dir":"/advanced/","name":"worker-configuration-reference.md","path":"advanced/worker-configuration-reference.md","url":"/advanced/worker-configuration-reference.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"}] \ 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. Deployment
    6. \n
    7. Building locally
    8. \n
    9. Customizing the build
    10. \n
    11. Testing
    12. \n
    \n
  2. \n
  3. Running locally
      \n
    1. NFD-Master
    2. \n
    3. NFD-Worker
    4. \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

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
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_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 namespacekube-system
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=gcr.io/k8s-staging-nfd/node-feature-discovery:master\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

Command line flags of nfd-master:

\n\n
$ docker run --rm ${NFD_CONTAINER_IMAGE} nfd-master -help\nUsage of nfd-master:\n  -ca-file string\n        Root certificate for verifying connections\n  -cert-file string\n        Certificate used for authenticating connections\n  -extra-label-ns value\n        Comma separated list of allowed extra label namespaces\n  -instance string\n        Instance name. Used to separate annotation namespaces for multiple parallel deployments.\n  -key-file string\n        Private key matching -cert-file\n  -kubeconfig string\n        Kubeconfig to use\n  -label-whitelist value\n        Regular expression to filter label names to publish to the Kubernetes API server. NB: the label namespace is omitted i.e. the filter is only applied to the name part after '/'.\n  -no-publish\n        Do not publish feature labels\n  -port int\n        Port on which to listen for connections. (default 8080)\n  -prune\n        Prune all NFD related attributes from all nodes of the cluaster and exit.\n  -resource-labels value\n        Comma separated list of labels to be exposed as extended resources.\n  -verify-node-name\n        Verify worker node name against the worker's TLS certificate. Only takes effect when TLS authentication has been enabled.\n  -version\n        Print version and exit.\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

Command line flags of nfd-worker:

\n\n
$ docker run --rm ${NFD_CONTAINER_IMAGE} nfd-worker -help\nUsage of nfd-worker:\n  -ca-file string\n        Root certificate for verifying connections\n  -cert-file string\n        Certificate used for authenticating connections\n  -config string\n        Config file to use. (default \"/etc/kubernetes/node-feature-discovery/nfd-worker.conf\")\n  -key-file string\n        Private key matching -cert-file\n  -label-whitelist value\n        Regular expression to filter label names to publish to the Kubernetes API server. NB: the label namespace is omitted i.e. the filter is only applied to the name part after '/'. DEPRECATED: This parameter should be set via the config file.\n  -no-publish\n        Do not publish discovered features, disable connection to nfd-master.\n  -oneshot\n        Do not publish feature labels\n  -options string\n        Specify config options from command line. Config options are specified in the same format as in the config file (i.e. json or yaml). These options\n  -server string\n        NFD server address to connecto to. (default \"localhost:8080\")\n  -server-name-override string\n        Hostname expected from server certificate, useful in testing\n  -sleep-interval duration\n        Time to sleep between re-labeling. Non-positive value implies no re-labeling (i.e. infinite sleep). DEPRECATED: This parameter should be set via the config file\n  -sources value\n        Comma separated list of feature sources. Special value 'all' enables all feature sources. DEPRECATED: This parameter should be set via the config file\n  -version\n        Print version and exit.\n
\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

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":"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. Feature discovery
  6. \n
  7. Node annotations
  8. \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 two software components:

\n\n
    \n
  1. nfd-master
  2. \n
  3. nfd-worker
  4. \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

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/iommu-<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","dir":"/get-started/","name":"introduction.md","path":"get-started/introduction.md","url":"/get-started/introduction.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=master\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 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...\n\n
\n","dir":"/get-started/","name":"index.md","path":"get-started/index.md","url":"/get-started/"},{"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":"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. -label-whitelist
  22. \n
  23. -extra-label-ns
  24. \n
  25. -resource-labels
  26. \n
  27. Logging
  28. \n
\n\n
\n\n

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

\n\n
docker run gcr.io/k8s-staging-nfd/node-feature-discovery:master 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 all communication with the Kubernetes API\nserver, making a “dry-run” flag for nfd-master. No Labels, Annotations or\nExtendedResources (or any other properties of any Kubernetes API objects) are\nmodified.

\n\n

Default: false

\n\n

Example:

\n\n
nfd-master -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

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":"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=master\n
\n\n

Verify

\n\n

Wait until NFD master and 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   3         3         3       3            3           <none>          5s\nNAME                         READY   UP-TO-DATE   AVAILABLE   AGE\ndeployment.apps/nfd-master   1/1     1            1           17s\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","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. -sources
  20. \n
  21. -no-publish
  22. \n
  23. -label-whitelist
  24. \n
  25. -oneshot
  26. \n
  27. -sleep-interval
  28. \n
  29. Logging
  30. \n
\n\n
\n\n

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

\n\n
docker run gcr.io/k8s-staging-nfd/node-feature-discovery:master 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

-sources

\n\n

The -sources flag specifies a comma-separated list of enabled feature\nsources. A special value all enables all feature sources.

\n\n

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

\n\n

Default: all

\n\n

Example:

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

DEPRECATED: you should use the core.sources option in the\nconfiguration file, 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. Requirements
  2. \n
  3. Image variants
      \n
    1. Full
    2. \n
    3. Minimal
    4. \n
    \n
  4. \n
  5. 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
  6. \n
  7. Usage
      \n
    1. NFD-Master
    2. \n
    3. NFD-Worker
    4. \n
    5. Communication security with TLS
    6. \n
    \n
  8. \n
  9. Worker configuration
  10. \n
  11. Using node labels
  12. \n
  13. Uninstallation
      \n
    1. Operator was used for deployment
    2. \n
    3. Manual
    4. \n
    5. Removing feature labels
    6. \n
    \n
  14. \n
\n\n
\n\n

Requirements

\n\n
    \n
  1. Linux (x86_64/Arm64/Arm)
  2. \n
  3. kubectl\n(properly set up and configured to work with your Kubernetes cluster)
  4. \n
\n\n

Image variants

\n\n

NFD currently offers two variants of the container image. The “full” variant is\ncurrently deployed by default.

\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. gcr.io/k8s-staging-nfd/node-feature-discovery:master-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 resource (in nfd namespace here):

    \n\n
     cat << EOF | kubectl apply -f -\n apiVersion: v1\n kind: Namespace\n metadata:\n   name: nfd\n ---\n apiVersion: nfd.kubernetes.io/v1alpha1\n kind: NodeFeatureDiscovery\n metadata:\n   name: my-nfd-deployment\n   namespace: nfd\n EOF\n
    \n
  6. \n
\n\n

In order to deploy the minimal image you need to add

\n\n
  image: gcr.io/k8s-staging-nfd/node-feature-discovery:master-minimal\n
\n\n

to the metadata of NodeFeatureDiscovery object above.

\n\n

Deployment with kustomize

\n\n

The kustomize overlays provided in the repo can be used directly:

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

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

\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=master\n\n
\n\n

This creates a DaemonSet runs both 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

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=master | \\\n    sed s\"/NUM_NODES/$NUM_NODES/\" | \\\n    kubectl apply -f -\n
\n\n

The example above launces 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

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=master-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 \n \n \n \n \n \n
NameTypeDefaultdescription
image.repositorystringgcr.io/k8s-staging-nfd/node-feature-discoveryNFD image repository
image.tagstringmasterNFD 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
serviceAccount.createbooltrueSpecifies whether a service account should be created
serviceAccount.annotationsdict{}Annotations to add to the service account
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
rbacdict RBAC parameteres
nameOverridestring Override the name of the chart
fullnameOverridestring Override a default fully qualified app name
\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
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.topologyUpdaterNsstring””Namespace in which Node Resource Topology CR are created, the namespace specified must be already existed.
master.replicaCountinteger1Number of desired pods. This is a pointer to distinguish between explicit zero and not specified
master.podSecurityContextdict{}SecurityContext holds pod-level security attributes and common container settings
master.service.typestringClusterIPNFD master service type
master.service.portintegerportNFD 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 metadata
master.affinitydict NFD master pod required node affinity
\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
NameTypeDefaultdescription
worker.*dict NFD worker daemonset configuration
worker.configmapNamestringnfd-worker-confNFD worker pod ConfigMap name
worker.configdict NFD worker configuration
worker.podSecurityContextdict{}SecurityContext holds pod-level security attributes and common container settings
worker.securityContextdict{}Container security settings
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 metadata
\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 parameteres 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{}SecurityContext 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 metadata
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

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.\nThe template specs provided with NFD contain (commented out) example\nconfiguration for 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).\nAdditional 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.

\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

NFD source code repository contains an example kustomize overlay that can be\nused to deploy NFD with cert-manager supplied certificates enabled. The\ninstructions below describe steps how to generate a self-signed CA certificate\nand set up cert-manager’s\nCA Issuer to sign\nCertificate requests for NFD components in node-feature-discovery\nnamespace.

\n\n
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.5.1/cert-manager.yaml\nopenssl genrsa -out deployment/overlays/samples/cert-manager/tls.key 2048\nopenssl req -x509 -new -nodes -key deployment/overlays/samples/cert-manager/tls.key -subj \"/CN=nfd-ca\" \\\n        -days 10000 -out deployment/overlays/samples/cert-manager/tls.crt\nkubectl apply -k deployment/overlays/samples/cert-manager\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. Configuration can be edited with:

\n\n
kubectl -n ${NFD_NS} edit configmap nfd-worker-conf\n
\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=master\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=master\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=master\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":"Feature discovery","layout":"default","sort":4,"content":"

Feature discovery

\n\n

Table of contents

\n\n
    \n
  1. Feature labels
  2. \n
  3. Feature sources
      \n
    1. CPU
    2. \n
    3. Custom
    4. \n
    5. IOMMU
    6. \n
    7. Kernel
    8. \n
    9. Memory
    10. \n
    11. Network
    12. \n
    13. PCI
    14. \n
    15. USB
    16. \n
    17. Storage
    18. \n
    19. System
    20. \n
    21. Local – user-specific features
    22. \n
    \n
  4. \n
  5. Extended resources
  6. \n
\n\n
\n\n

Feature discovery in nfd-worker is performed by a set of separate modules\ncalled feature sources. Most of them are specifically responsible for certain\ndomain of features (e.g. cpu). In addition there are two highly customizable\nfeature sources that work accross the system.

\n\n

Feature labels

\n\n

Each discovered feature is advertised a label in the Kubernetes Node object.\nThe published node labels encode a few pieces of information:

\n\n\n\n

Feature label names adhere to the following pattern:

\n\n
<namespace>/<source name>-<feature name>[.<attribute name>]\n
\n\n

The last component (i.e. attribute-name) is optional, and only used if a\nfeature logically has sub-hierarchy, e.g. sriov.capable and\nsriov.configure from the network source.

\n\n

The -sources flag controls which sources to use for discovery.

\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

Feature sources

\n\n

CPU

\n\n

The cpu feature source supports the following labels:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \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 nameAttributeDescription
cpuid<cpuid flag>CPU capability is supported
hardware_multithreading Hardware multithreading, such as Intel HTT, enabled (number of logical CPUs is greater than physical CPUs)
powersst_bf.enabledIntel SST-BF (Intel Speed Select Technology - Base frequency) enabled
pstatestatusThe status of the Intel pstate driver when in use and enabled, either ‘active’ or ‘passive’.
 turboSet to ‘true’ if turbo frequencies are enabled in Intel pstate driver, set to ‘false’ if they have been disabled.
 scaling_governorThe value of the Intel pstate scaling_governor when in use, either ‘powersave’ or ‘performance’.
cstateenabledSet to ‘true’ if cstates are set in the intel_idle driver, otherwise set to ‘false’. Unset if intel_idle cpuidle driver is not active.
rdtRDTMONIntel 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

The (sub-)set of CPUID attributes to publish is configurable via the\nattributeBlacklist and attributeWhitelist cpuid options of the cpu source.\nIf whitelist is specified, only whitelisted attributes will be published. With\nblacklist, only blacklisted attributes are filtered out. attributeWhitelist\nhas priority over attributeBlacklist. For examples and more information\nabout configurability, see\nconfiguration.\nBy default, the following CPUID flags have been blacklisted:\nBMI1, BMI2, CLMUL, CMOV, CX16, ERMS, F16C, HTT, LZCNT, MMX, MMXEXT, NX, POPCNT,\nRDRAND, RDSEED, RDTSCP, SGX, SSE, SSE2, SSE3, SSE4, SSE42 and SSSE3.

\n\n

NOTE The cpuid features advertise supported CPU capabilities, that is, a\ncapability might be supported but not enabled.

\n\n

X86 CPUID attributes (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
AttributeDescription
ADXMulti-Precision Add-Carry Instruction Extensions (ADX)
AESNIAdvanced Encryption Standard (AES) New Instructions (AES-NI)
AVXAdvanced Vector Extensions (AVX)
AVX2Advanced Vector Extensions 2 (AVX2)
\n\n

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

\n\n

Arm CPUID attribute (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
AttributeDescription
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 attribute (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
AttributeDescription
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

Custom

\n\n

The Custom feature source allows the user to define features based on a mix of\npredefined rules. A rule is provided input witch affects its process of\nmatching for a defined feature. The rules are specified in the\nnfd-worker configuration file. See\nconfiguration for instructions\nand examples how to set-up and manage the worker configuration.

\n\n

To aid in making Custom Features clearer, we define a general and a per rule\nnomenclature, keeping things as consistent as possible.

\n\n

Additional configuration directory

\n\n

Additionally to the rules defined in the nfd-worker configuration file, the\nCustom feature 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. This directory must be available\ninside the NFD worker container, so Volumes and VolumeMounts must be used for\nmounting e.g. ConfigMap(s). The example deployment manifests provide an example\n(commented out) for providing Custom configuration with an additional\nConfigMap, mounted into the custom.d directory.

\n\n

General nomenclature & 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

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

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

Statically defined features

\n\n

Some feature labels which are common and generic are defined statically in the\ncustom feature source. A user may add additional Matchers to these feature\nlabels by defining them in the nfd-worker configuration file.

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureAttributeDescription
rdmacapableThe node has an RDMA capable Network adapter
rdmaenabledThe node has the needed RDMA modules loaded to run RDMA traffic
\n\n

IOMMU

\n\n

The iommu feature source supports the following labels:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n
Feature nameDescription
enabledIOMMU is present and enabled in the kernel
\n\n

Kernel

\n\n

The kernel feature source supports the following labels:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureAttributeDescription
config<option name>Kernel config option is enabled (set ‘y’ or ‘m’). Default options are NO_HZ, NO_HZ_IDLE, NO_HZ_FULL and PREEMPT
selinuxenabledSelinux is enabled on the node
versionfullFull kernel version as reported by /proc/sys/kernel/osrelease (e.g. ‘4.5.6-7-g123abcde’)
 majorFirst component of the kernel version (e.g. ‘4’)
 minorSecond component of the kernel version (e.g. ‘5’)
 revisionThird component of the kernel version (e.g. ‘6’)
\n\n

Kernel config file to use, and, the set of config options to be detected are\nconfigurable. See configuration\nfor more information.

\n\n

Memory

\n\n

The memory feature source supports the following labels:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureAttributeDescription
numa Multiple memory nodes i.e. NUMA architecture detected
nvpresentNVDIMM device(s) are present
nvdaxNVDIMM region(s) configured in DAX mode are present
\n\n

Network

\n\n

The network feature source supports the following labels:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureAttributeDescription
sriovcapableSingle Root Input/Output Virtualization (SR-IOV) enabled Network Interface Card(s) present
 configuredSR-IOV virtual functions have been configured
\n\n

PCI

\n\n

The pci feature source supports the following labels:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureAttributeDescription
<device label>presentPCI device is detected
<device label>sriov.capableSingle Root Input/Output Virtualization (SR-IOV) enabled PCI device present
\n\n

<device label> is composed of raw PCI IDs, separated by underscores. The set\nof fields used in <device label> is configurable, valid fields being class,\nvendor, device, subsystem_vendor and subsystem_device. Defaults are\nclass and vendor. An example label using the default label fields:

\n\n
feature.node.kubernetes.io/pci-1200_8086.present=true\n
\n\n

Also the set of PCI device classes that the feature source detects is\nconfigurable. By default, device classes (0x)03, (0x)0b40 and (0x)12, i.e.\nGPUs, co-processors and accelerator cards are detected.

\n\n

USB

\n\n

The usb feature source supports the following labels:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureAttributeDescription
<device label>presentUSB device is detected
\n\n

<device label> is composed of raw USB IDs, separated by underscores. The set\nof fields used in <device label> is configurable, valid fields being class,\nvendor, device and serial. Defaults are class, vendor and device.\nAn example label using the default label fields:

\n\n
feature.node.kubernetes.io/usb-fe_1a6e_089a.present=true\n
\n\n

See configuration for more\ninformation on NFD config.

\n\n

Storage

\n\n

The storage feature source supports the following labels:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n
Feature nameDescription
nonrotationaldiskNon-rotational disk, like SSD, is present in the node
\n\n

System

\n\n

The system feature source supports the following labels:

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FeatureAttributeDescription
os_releaseIDOperating system identifier
 VERSION_IDOperating system version identifier (e.g. ‘6.7’)
 VERSION_ID.majorFirst component of the OS version id (e.g. ‘6’)
 VERSION_ID.minorSecond component of the OS version id (e.g. ‘7’)
\n\n

Local – user-specific features

\n\n

NFD has a special feature source named local which is designed for getting\nthe labels from user-specific feature detector. It provides a mechanism for\nusers to implement custom feature sources in a pluggable way, without modifying\nnfd source code or Docker images. The local feature source can be used to\nadvertise new user-specific features, and, for overriding labels created by the\nother feature sources.

\n\n

The local feature source gets its labels by two different ways:

\n\n\n\n

NOTE: The minimal image variant only\nsupports running statically linked binaries.

\n\n

These directories must be available inside the Docker image so Volumes and\nVolumeMounts must be used if standard NFD images are used. The given template\nfiles mount by default the source.d and the features.d directories\nrespectively from /etc/kubernetes/node-feature-discovery/source.d/ and\n/etc/kubernetes/node-feature-discovery/features.d/ from the host. You should\nupdate them to match your needs.

\n\n

In both cases, the labels can be binary or non binary, using either <name> or\n<name>=<value> format.

\n\n

Unlike the other feature sources, the name of the file, instead of the name of\nthe feature source (that would be local in this case), is used as a prefix in\nthe label name, normally. However, if the <name> of the label starts with a\nslash (/) it is used as the label name as is, without any additional prefix.\nThis makes it possible for the user to fully control the feature label names,\ne.g. for overriding labels created by other feature sources.

\n\n

You can also override the default namespace of your labels using this format:\n<namespace>/<name>[=<value>]. If using something else than\n[<sub-ns>.]feature.node.kubernetes.io or\n[<sub-ns>.]profile.node.kubernetes.io, you must whitelist your namespace\nusing the -extra-label-ns option on the master.\nIn this case, the name of the\nfile will not be added to the label name. For example, if you want to add the\nlabel my.namespace.org/my-label=value, your hook output or file must contains\nmy.namespace.org/my-label=value and you must add\n-extra-label-ns=my.namespace.org on the master command line.

\n\n

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

\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. It is possible to mount\nthe source.d and/or features.d directories common with the NFD Pod and\ndeploy the custom hooks/features there. NFD will periodically scan the\ndirectories and run any hooks and read any feature files it finds. The\ndefault deployments contain hostPath mounts for sources.d and features.d\ndirectories. By using the same mounts in the secondary Pod (e.g. device plugin)\nyou have created a shared area for delivering hooks and feature files to NFD.

\n\n

A hook example

\n\n

User has a shell script\n/etc/kubernetes/node-feature-discovery/source.d/my-source which has the\nfollowing stdout output:

\n\n
MY_FEATURE_1\nMY_FEATURE_2=myvalue\n/override_source-OVERRIDE_BOOL\n/override_source-OVERRIDE_VALUE=123\noverride.namespace/value=456\n
\n\n

which, in turn, will translate into the following node labels:

\n\n
feature.node.kubernetes.io/my-source-MY_FEATURE_1=true\nfeature.node.kubernetes.io/my-source-MY_FEATURE_2=myvalue\nfeature.node.kubernetes.io/override_source-OVERRIDE_BOOL=true\nfeature.node.kubernetes.io/override_source-OVERRIDE_VALUE=123\noverride.namespace/value=456\n
\n\n

A file example

\n\n

User has a file /etc/kubernetes/node-feature-discovery/features.d/my-source\nwhich contains the following lines:

\n\n
MY_FEATURE_1\nMY_FEATURE_2=myvalue\n/override_source-OVERRIDE_BOOL\n/override_source-OVERRIDE_VALUE=123\noverride.namespace/value=456\n
\n\n

which, in turn, will translate into the following node labels:

\n\n
feature.node.kubernetes.io/my-source-MY_FEATURE_1=true\nfeature.node.kubernetes.io/my-source-MY_FEATURE_2=myvalue\nfeature.node.kubernetes.io/override_source-OVERRIDE_BOOL=true\nfeature.node.kubernetes.io/override_source-OVERRIDE_VALUE=123\noverride.namespace/value=456\n
\n\n

NFD tries to run any regular files found from the hooks directory. Any\nadditional data files your hook might need (e.g. a configuration file) should\nbe placed in a separate directory in order to avoid NFD unnecessarily trying to\nexecute these. You can use a subdirectory under the hooks directory, for\nexample /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! 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

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":"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.sources
    4. \n
    5. core.labelWhiteList
    6. \n
    7. core.noPublish
    8. \n
    9. core.klog
    10. \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.sources

\n\n

core.sources specifies the list of enabled feature sources. A special value\nall enables all feature sources.

\n\n

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

\n\n

Default: [all]

\n\n

Example:

\n\n
core:\n  sources:\n    - system\n    - custom\n
\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 details of\nthe available rules and their configuration.

\n\n

Default: empty

\n\n

Example:

\n\n
source:\n  custom:\n  - name: \"my.custom.feature\"\n    matchOn:\n    - loadedKMod: [\"e1000e\"]\n    - pciId:\n        class: [\"0200\"]\n        vendor: [\"8086\"]\n
\n","dir":"/advanced/","name":"worker-configuration-reference.md","path":"advanced/worker-configuration-reference.md","url":"/advanced/worker-configuration-reference.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"}] \ No newline at end of file diff --git a/master/get-started/deployment-and-usage.html b/master/get-started/deployment-and-usage.html index 44eeb80c4..eb1a334c1 100644 --- a/master/get-started/deployment-and-usage.html +++ b/master/get-started/deployment-and-usage.html @@ -1,4 +1,4 @@ - Deployment and usage · Node Feature Discovery

Deployment and usage

Table of contents

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

Requirements

  1. Linux (x86_64/Arm64/Arm)
  2. kubectl (properly set up and configured to work with your Kubernetes cluster)

Image variants

NFD currently offers two variants of the container image. The "full" variant is currently deployed by default.

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. gcr.io/k8s-staging-nfd/node-feature-discovery:master-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. Requirements
    2. Image variants
      1. Full
      2. Minimal
    3. Deployment options
      1. Operator
      2. Deployment with kustomize
      3. Deployment with Helm
      4. Build your own
    4. Usage
      1. NFD-Master
      2. NFD-Worker
      3. Communication security with TLS
    5. Worker configuration
    6. Using node labels
    7. Uninstallation
      1. Operator was used for deployment
      2. Manual
      3. Removing feature labels

    Requirements

    1. Linux (x86_64/Arm64/Arm)
    2. kubectl (properly set up and configured to work with your Kubernetes cluster)

    Image variants

    NFD currently offers two variants of the container image. The "full" variant is currently deployed by default.

    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. gcr.io/k8s-staging-nfd/node-feature-discovery:master-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 resource (in nfd namespace here):

       cat << EOF | kubectl apply -f -
        apiVersion: v1
        kind: Namespace
      @@ -34,7 +34,7 @@ helm install nfd/node-feature-discovery 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 gcr.io/k8s-staging-nfd/node-feature-discovery NFD image repository
      image.tag string master 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
      serviceAccount.create bool true Specifies whether a service account should be created
      serviceAccount.annotations dict {} Annotations to add to the service account
      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
      rbac dict   RBAC parameteres
      nameOverride string   Override the name of the chart
      fullnameOverride string   Override a default fully qualified app name
      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.replicaCount integer 1 Number of desired pods. This is a pointer to distinguish between explicit zero and not specified
      master.podSecurityContext dict {} SecurityContext holds pod-level security attributes and common container settings
      master.service.type string ClusterIP NFD master service type
      master.service.port integer port 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 metadata
      master.affinity dict   NFD master pod required node affinity
      Worker pod parameters
      Name Type Default description
      worker.* dict   NFD worker daemonset configuration
      worker.configmapName string nfd-worker-conf NFD worker pod ConfigMap name
      worker.config dict   NFD worker configuration
      worker.podSecurityContext dict {} SecurityContext holds pod-level security attributes and common container settings
      worker.securityContext dict {} Container security settings
      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 metadata

      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.

      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.

      Automated TLS certificate management using cert-manager

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

      NFD source code repository contains an example kustomize overlay that can be used to deploy NFD with cert-manager supplied certificates enabled. The instructions below describe steps how to generate a self-signed CA certificate and set up cert-manager's CA Issuer to sign Certificate requests for NFD components in node-feature-discovery namespace.

      kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.5.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 gcr.io/k8s-staging-nfd/node-feature-discovery NFD image repository
      image.tag string master 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
      serviceAccount.create bool true Specifies whether a service account should be created
      serviceAccount.annotations dict {} Annotations to add to the service account
      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
      rbac dict   RBAC parameteres
      nameOverride string   Override the name of the chart
      fullnameOverride string   Override a default fully qualified app name
      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.topologyUpdaterNs string "" Namespace in which Node Resource Topology CR are created, the namespace specified must be already existed.
      master.replicaCount integer 1 Number of desired pods. This is a pointer to distinguish between explicit zero and not specified
      master.podSecurityContext dict {} SecurityContext holds pod-level security attributes and common container settings
      master.service.type string ClusterIP NFD master service type
      master.service.port integer port 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 metadata
      master.affinity dict   NFD master pod required node affinity
      Worker pod parameters
      Name Type Default description
      worker.* dict   NFD worker daemonset configuration
      worker.configmapName string nfd-worker-conf NFD worker pod ConfigMap name
      worker.config dict   NFD worker configuration
      worker.podSecurityContext dict {} SecurityContext holds pod-level security attributes and common container settings
      worker.securityContext dict {} Container security settings
      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 metadata
      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 parameteres 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 {} SecurityContext 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 metadata
      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.

      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.

      Automated TLS certificate management using cert-manager

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

      NFD source code repository contains an example kustomize overlay that can be used to deploy NFD with cert-manager supplied certificates enabled. The instructions below describe steps how to generate a self-signed CA certificate and set up cert-manager's CA Issuer to sign Certificate requests for NFD components in node-feature-discovery namespace.

      kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.5.1/cert-manager.yaml
       openssl genrsa -out deployment/overlays/samples/cert-manager/tls.key 2048
       openssl req -x509 -new -nodes -key deployment/overlays/samples/cert-manager/tls.key -subj "/CN=nfd-ca" \
               -days 10000 -out deployment/overlays/samples/cert-manager/tls.crt
      @@ -67,4 +67,4 @@ 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=master
       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=master
      -

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


    Node Feature Discovery
    master
    Versions
    GitHub
    Homepage
    Issues
    Download

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

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


Node Feature Discovery
master
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/master/get-started/examples-and-demos.html b/master/get-started/examples-and-demos.html index 48b10a081..9c61b1690 100644 --- a/master/get-started/examples-and-demos.html +++ b/master/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
master
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
master
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/master/get-started/features.html b/master/get-started/features.html index 123fff258..39dd0ac67 100644 --- a/master/get-started/features.html +++ b/master/get-started/features.html @@ -1,4 +1,4 @@ - Feature discovery · Node Feature Discovery

Feature discovery

Table of contents

  1. Feature labels
  2. Feature sources
    1. CPU
    2. Custom
    3. IOMMU
    4. Kernel
    5. Memory
    6. Network
    7. PCI
    8. USB
    9. Storage
    10. System
    11. Local – user-specific features
  3. Extended resources

Feature discovery in nfd-worker is performed by a set of separate modules called feature sources. Most of them are specifically responsible for certain domain of features (e.g. cpu). In addition there are two highly customizable feature sources that work accross the system.

Feature labels

Each discovered feature is advertised a label in the Kubernetes Node object. The published node labels encode a few pieces of information:

  • Namespace
    • all built-in labels use feature.node.kubernetes.io
    • user-specified custom labels (custom and local feature sources)
      • 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) are allowed by default
      • additional namespaces may be enabled with the --extra-label-ns command line flag of nfd-master
  • The source for each label (e.g. cpu).
  • The name of the discovered feature as it appears in the underlying source, (e.g. cpuid.AESNI from cpu).
  • The value of the discovered feature.

Feature label names adhere to the following pattern:

<namespace>/<source name>-<feature name>[.<attribute name>]
+        Feature discovery · Node Feature Discovery                      

Feature discovery

Table of contents

  1. Feature labels
  2. Feature sources
    1. CPU
    2. Custom
    3. IOMMU
    4. Kernel
    5. Memory
    6. Network
    7. PCI
    8. USB
    9. Storage
    10. System
    11. Local – user-specific features
  3. Extended resources

Feature discovery in nfd-worker is performed by a set of separate modules called feature sources. Most of them are specifically responsible for certain domain of features (e.g. cpu). In addition there are two highly customizable feature sources that work accross the system.

Feature labels

Each discovered feature is advertised a label in the Kubernetes Node object. The published node labels encode a few pieces of information:

  • Namespace
    • all built-in labels use feature.node.kubernetes.io
    • user-specified custom labels (custom and local feature sources)
      • 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) are allowed by default
      • additional namespaces may be enabled with the --extra-label-ns command line flag of nfd-master
  • The source for each label (e.g. cpu).
  • The name of the discovered feature as it appears in the underlying source, (e.g. cpuid.AESNI from cpu).
  • The value of the discovered feature.

Feature label names adhere to the following pattern:

<namespace>/<source name>-<feature name>[.<attribute name>]
 

The last component (i.e. attribute-name) is optional, and only used if a feature logically has sub-hierarchy, e.g. sriov.capable and sriov.configure from the network source.

The -sources flag controls which sources to use for discovery.

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.

Feature sources

CPU

The cpu feature source supports the following labels:

Feature name Attribute Description
cpuid <cpuid flag> CPU capability is supported
hardware_multithreading   Hardware multithreading, such as Intel HTT, enabled (number of logical CPUs is greater than physical CPUs)
power sst_bf.enabled Intel SST-BF (Intel Speed Select Technology - Base frequency) enabled
pstate status The status of the Intel pstate driver when in use and enabled, either ‘active' or ‘passive'.
  turbo Set to ‘true' if turbo frequencies are enabled in Intel pstate driver, set to ‘false' if they have been disabled.
  scaling_governor The value of the Intel pstate scaling_governor when in use, either ‘powersave' or ‘performance'.
cstate enabled 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.
rdt 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

The (sub-)set of CPUID attributes to publish is configurable via the attributeBlacklist and attributeWhitelist cpuid options of the cpu source. If whitelist is specified, only whitelisted attributes will be published. With blacklist, only blacklisted attributes are filtered out. attributeWhitelist has priority over attributeBlacklist. For examples and more information about configurability, see configuration. 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.

NOTE The cpuid features advertise supported CPU capabilities, that is, a capability might be supported but not enabled.

X86 CPUID attributes (partial list)

Attribute 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)

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

Arm CPUID attribute (partial list)

Attribute 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 attribute (partial list)

Attribute 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

Custom

The Custom feature source allows the user to define features based on a mix of predefined rules. A rule is provided input witch affects its process of matching for a defined feature. The rules are specified in the nfd-worker configuration file. See configuration for instructions and examples how to set-up and manage the worker configuration.

To aid in making Custom Features clearer, we define a general and a per rule nomenclature, keeping things as consistent as possible.

Additional configuration directory

Additionally to the rules defined in the nfd-worker configuration file, the Custom feature can read more configuration files located in the /etc/kubernetes/node-feature-discovery/custom.d/ directory. This makes more dynamic and flexible configuration easier. This directory must be available inside the NFD worker container, so Volumes and VolumeMounts must be used for mounting e.g. ConfigMap(s). The example deployment manifests provide an example (commented out) for providing Custom configuration with an additional ConfigMap, mounted into the custom.d directory.

General nomenclature & definitions

Rule        :Represents a matching logic that is used to match on a feature.
 Rule Input  :The input a Rule is provided. This determines how a Rule performs the match operation.
 Matcher     :A composition of Rules, each Matcher may be composed of at most one instance of each Rule.
@@ -101,4 +101,4 @@ feature.node.kubernetes.io/override_source-OVERRIDE_VALUE=123
 override.namespace/value=456
 

NFD tries to run any regular files found from the hooks directory. Any additional data files your hook might need (e.g. a configuration file) should be placed in a separate directory in order to avoid NFD unnecessarily trying to execute these. You can use a subdirectory under the hooks directory, for example /etc/kubernetes/node-feature-discovery/source.d/conf/.

NOTE! NFD will blindly run any executables placed/mounted in the hooks directory. It is the user's responsibility to review the hooks for e.g. possible security implications.

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.

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
master
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
master
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/master/get-started/index.html b/master/get-started/index.html index 2482118ce..22fe8bf54 100644 --- a/master/get-started/index.html +++ b/master/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=master
+        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=master
   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
master
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
master
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/master/get-started/introduction.html b/master/get-started/introduction.html index 1200492e3..e7f97dade 100644 --- a/master/get-started/introduction.html +++ b/master/get-started/introduction.html @@ -1,4 +1,4 @@ - Introduction · Node Feature Discovery

Introduction

Table of contents

  1. NFD-Master
  2. NFD-Worker
  3. Feature discovery
  4. Node annotations

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 two software components:

  1. nfd-master
  2. nfd-worker

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,

Feature discovery

Feature discovery is divided into domain-specific feature sources:

  • CPU
  • IOMMU
  • Kernel
  • Memory
  • Network
  • PCI
  • Storage
  • System
  • USB
  • Custom (rule-based custom features)
  • Local (hooks for user-specific features)

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. Feature discovery
  4. Node annotations

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 two software components:

  1. nfd-master
  2. nfd-worker

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,

Feature discovery

Feature discovery is divided into domain-specific feature sources:

  • CPU
  • IOMMU
  • Kernel
  • Memory
  • Network
  • PCI
  • Storage
  • System
  • USB
  • Custom (rule-based custom features)
  • Local (hooks for user-specific features)

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/iommu-<feature-name>": "true",
@@ -11,4 +11,4 @@
   "feature.node.kubernetes.io/usb-<device label>.present": "<feature value>",
   "feature.node.kubernetes.io/<file name>-<feature name>": "<feature value>"
 }
-

Node annotations

NFD also annotates nodes it is running on:

Annotation Description
[<instance>.]nfd.node.kubernetes.io/master.version Version of the nfd-master instance running on the node. Informative use only.
[<instance>.]nfd.node.kubernetes.io/worker.version Version of the nfd-worker instance running on the node. Informative use only.
[<instance>.]nfd.node.kubernetes.io/feature-labels Comma-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-resources Comma-separated list of node extended resources managed by NFD. NFD uses this internally so must not be edited by users.

NOTE: the --instance command line flag affects the annotation names

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


Node Feature Discovery
master
Versions
GitHub
Homepage
Issues
Download

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

Node annotations

NFD also annotates nodes it is running on:

Annotation Description
[<instance>.]nfd.node.kubernetes.io/master.version Version of the nfd-master instance running on the node. Informative use only.
[<instance>.]nfd.node.kubernetes.io/worker.version Version of the nfd-worker instance running on the node. Informative use only.
[<instance>.]nfd.node.kubernetes.io/feature-labels Comma-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-resources Comma-separated list of node extended resources managed by NFD. NFD uses this internally so must not be edited by users.

NOTE: the --instance command line flag affects the annotation names

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


Node Feature Discovery
master
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/master/get-started/quick-start.html b/master/get-started/quick-start.html index 429f713f9..ebdfaf82a 100644 --- a/master/get-started/quick-start.html +++ b/master/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=master
+        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=master
 

Verify

Wait until NFD master and 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   3         3         3       3            3           <none>          5s
@@ -29,4 +29,4 @@ 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>
-

Node Feature Discovery
master
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
master
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/master/search.html b/master/search.html index 665ce16c8..611363ead 100644 --- a/master/search.html +++ b/master/search.html @@ -1 +1 @@ - Search · Node Feature Discovery

Searching


    Node Feature Discovery
    master
    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
      master
      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/master/sitemap.xml b/master/sitemap.xml index eb8023a71..642801560 100644 --- a/master/sitemap.xml +++ b/master/sitemap.xml @@ -1 +1 @@ - https://kubernetes-sigs.github.com/node-feature-discovery/master/advanced/developer-guide.html 1.0 2021-10-25T11:36:00-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/get-started/introduction.html 1.0 2021-10-25T11:36:00-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/get-started/ 1.0 2021-10-25T11:36:00-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/advanced/ 0.1 2021-10-25T11:36:00-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/advanced/master-commandline-reference.html 1.0 2021-10-25T11:36:00-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/get-started/quick-start.html 1.0 2021-10-25T11:36:00-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/contributing/ 0.5 2021-10-25T11:36:00-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/advanced/worker-commandline-reference.html 1.0 2021-10-25T11:36:00-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/get-started/deployment-and-usage.html 1.0 2021-10-25T11:36:00-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/get-started/features.html 1.0 2021-10-25T11:36:00-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/advanced/worker-configuration-reference.html 1.0 2021-10-25T11:36:00-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/get-started/examples-and-demos.html 0.5 2021-10-25T11:36:00-05:00 \ No newline at end of file + https://kubernetes-sigs.github.com/node-feature-discovery/master/advanced/developer-guide.html 1.0 2021-10-26T01:40:51-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/get-started/introduction.html 1.0 2021-10-26T01:40:51-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/get-started/ 1.0 2021-10-26T01:40:51-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/advanced/ 0.1 2021-10-26T01:40:51-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/advanced/master-commandline-reference.html 1.0 2021-10-26T01:40:51-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/get-started/quick-start.html 1.0 2021-10-26T01:40:51-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/contributing/ 0.5 2021-10-26T01:40:51-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/advanced/worker-commandline-reference.html 1.0 2021-10-26T01:40:51-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/get-started/deployment-and-usage.html 1.0 2021-10-26T01:40:51-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/get-started/features.html 1.0 2021-10-26T01:40:51-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/advanced/worker-configuration-reference.html 1.0 2021-10-26T01:40:51-05:00 https://kubernetes-sigs.github.com/node-feature-discovery/master/get-started/examples-and-demos.html 0.5 2021-10-26T01:40:51-05:00 \ No newline at end of file