diff --git a/master/404.html b/master/404.html index c8bab95a2..19ce5df17 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 92770ecea..8dda0d107 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. NFD-Topology-Updater
  3. Documentation

Building from source

Download the source code

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

Developer guide

Table of contents

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

Building from source

Download the source code

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

Docker build

Build the container image

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

make
 

Push the container image

Optional, this example with Docker.

docker push <IMAGE_TAG>
@@ -77,4 +77,4 @@ Usage of nfd-topology-updater:
        Namespace to watch pods (for testing/debugging purpose). Use * for all namespaces. (default "*")
 

NOTE:

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

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

Documentation

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

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

make site-serve
 

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

In order to just build the html documentation run:

make site-build
-

This will generate html documentation under docs/_site/.


Node Feature Discovery
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 5aba2d16c..90cf29982 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 95a06b506..1527f5cb6 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. -featurerules-controller
  12. -label-whitelist
  13. -extra-label-ns
  14. -resource-labels
  15. Logging

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

docker run 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. -featurerules-controller
  12. -label-whitelist
  13. -extra-label-ns
  14. -resource-labels
  15. Logging

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

docker run 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
@@ -11,4 +11,4 @@
 

-label-whitelist

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

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

Default: empty

Example:

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

-extra-label-ns

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

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

Default: empty

Example:

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

-resource-labels

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

Default: empty

Example:

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

Logging

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

-add_dir_header

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

Default: false

-alsologtostderr

Log to standard error as well as files.

Default: false

-log_backtrace_at

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

Default: empty

-log_dir

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

Default: empty

-log_file

If non-empty, use this log file.

Default: empty

-log_file_max_size

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

Default: 1800

-logtostderr

Log to standard error instead of files

Default: true

-skip_headers

If true, avoid header prefixes in the log messages.

Default: false

-skip_log_headers

If true, avoid headers when opening log files.

Default: false

-stderrthreshold

Logs at or above this threshold go to stderr.

Default: 2

-v

Number for the log level verbosity.

Default: 0

-vmodule

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

Default: empty


Node Feature Discovery
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/topology-updater-commandline-reference.html b/master/advanced/topology-updater-commandline-reference.html index e71dfaa24..8284307e0 100644 --- a/master/advanced/topology-updater-commandline-reference.html +++ b/master/advanced/topology-updater-commandline-reference.html @@ -1,4 +1,4 @@ - Topology Updater Cmdline Reference · Node Feature Discovery

NFD-Topology-Updater Commandline Flags

Table of Contents

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

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

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

NFD-Topology-Updater Commandline Flags

Table of Contents

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

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

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

-h, -help

Print usage and exit.

-version

Print version and exit.

-server

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

Default: localhost:8080

Example:

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

-ca-file

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

Default: empty

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

Example:

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

-cert-file

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

Default: empty

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

Example:

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

-watch-namespace

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

Default: "*"

Example:

nfd-topology-updater -watch-namespace=rte
 

-kubelet-config-file

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

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

Example:

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

-podresources-socket

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

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

Example:

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

Node Feature Discovery
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/advanced/worker-commandline-reference.html b/master/advanced/worker-commandline-reference.html index cdeedcfaf..52dd1f4e9 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. -label-sources
  11. -sources
  12. -no-publish
  13. -label-whitelist
  14. -oneshot
  15. -sleep-interval
  16. 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
@@ -6,9 +6,9 @@
 

-cert-file

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

Default: empty

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

Example:

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

-key-file

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

Default: empty

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

Example:

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

-server-name-override

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

Default: empty

Example:

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

-sources

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

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

Default: all

Example:

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

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

-no-publish

The -no-publish flag disables all communication with the nfd-master, making it a "dry-run" flag for nfd-worker. NFD-Worker runs feature detection normally, but no labeling requests are sent to nfd-master.

Default: false

Example:

nfd-worker -no-publish
+

-label-sources

The -label-sources flag specifies a comma-separated list of enabled label sources. A special value all enables all sources. Consider using the core.labelSources config file option, instead, allowing dynamic configurability.

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

Default: all

Example:

nfd-worker -label-sources=kernel,system,local
+

-sources

DEPRECATED: use -label-sources instead.

-no-publish

The -no-publish flag disables all communication with the nfd-master, making it a "dry-run" flag for nfd-worker. NFD-Worker runs feature detection normally, but no labeling requests are sent to nfd-master.

Default: false

Example:

nfd-worker -no-publish
 

-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 c8aa5311a..07127cd23 100644 --- a/master/advanced/worker-configuration-reference.html +++ b/master/advanced/worker-configuration-reference.html @@ -1,10 +1,10 @@ - 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.labelSources
    3. core.sources
    4. core.labelWhiteList
    5. core.noPublish
    6. 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:
+

core.labelSources

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

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

Default: [all]

Example:

core:
   sources:
     - system
     - custom
-

core.labelWhiteList

core.labelWhiteList specifies a regular expression for filtering feature labels based on the label name. Non-matching labels are not 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 prefix (or namespace) is omitted.

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

Default: null

Example:

core:
+

core.sources

DEPRECATED: use core.labelSources instead.

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

core.labelWhiteList

core.labelWhiteList specifies a regular expression for filtering feature labels based on the label name. Non-matching labels are not 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 prefix (or namespace) is omitted.

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

Default: null

Example:

core:
   labelWhiteList: '^cpu-cpuid'
 

core.noPublish

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

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

Default: false

Example:

core:
   noPublish: true
@@ -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 ab64c47aa..663c1903d 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 a5c9c9da3..4228b9a63 100644 --- a/master/data.json +++ b/master/data.json @@ -1 +1 @@ -[{"layout":"default","title":null,"content":"--\ntitle: \"Feature discovery\"\nlayout: default\nsort: 4\n---\n\n# Feature discovery\n{: .no_toc}\n\n## Table of contents\n{: .no_toc .text-delta}\n\n1. TOC\n{:toc}\n\n---\n\nFeature 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\nEach discovered feature is advertised a label in the Kubernetes Node object.\nThe published node labels encode a few pieces of information:\n\n- Namespace\n - all built-in labels use `feature.node.kubernetes.io`\n - user-specified custom labels ([custom](#custom) and\n [local](#local--user-specific-features) feature sources)\n - `feature.node.kubernetes.io` and `profile.node.kubernetes.io` plus their\n sub-namespaces (e.g. `vendor.profile.node.kubernetes.io` and\n `sub.ns.profile.node.kubernetes.io`) are allowed by default\n - additional namespaces may be enabled with the\n [`-extra-label-ns`](../advanced/master-commandline-reference#-extra-label-ns)\n command line flag of nfd-master\n- The source for each label (e.g. `cpu`).\n- The name of the discovered feature as it appears in the underlying\n source, (e.g. `cpuid.AESNI` from cpu).\n- The value of the discovered feature.\n\nFeature label names adhere to the following pattern:\n\n```plaintext\n/-[.]\n```\n\nThe last component (i.e. `attribute-name`) is optional, and only used if a\nfeature logically has sub-hierarchy, e.g. `sriov.capable` and\n`sriov.configure` from the `network` source.\n\nThe `-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\nThe **cpu** feature source supports the following labels:\n\n| Feature name | Attribute | Description |\n| ----------------------- | ------------------ | ----------------------------- |\n| cpuid | <cpuid flag> | CPU capability is supported\n| hardware_multithreading | | Hardware multithreading, such as Intel HTT, enabled (number of logical CPUs is greater than physical CPUs)\n| power | sst_bf.enabled | Intel SST-BF ([Intel Speed Select Technology][intel-sst] - Base frequency) enabled\n| [pstate][intel-pstate] | status | The status of the Intel pstate driver when in use and enabled, either 'active' or 'passive'.\n| | turbo | Set to 'true' if turbo frequencies are enabled in Intel pstate driver, set to 'false' if they have been disabled.\n| | scaling_governor | The value of the Intel pstate scaling_governor when in use, either 'powersave' or 'performance'.\n| 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.\n| [rdt][intel-rdt] | RDTMON | Intel RDT Monitoring Technology\n| | RDTCMT | Intel Cache Monitoring (CMT)\n| | RDTMBM | Intel Memory Bandwidth Monitoring (MBM)\n| | RDTL3CA | Intel L3 Cache Allocation Technology\n| | RDTL2CA | Intel L2 Cache Allocation Technology\n| | RDTMBA | Intel Memory Bandwidth Allocation (MBA) Technology\n| sgx | enabled | Set to 'true' if Intel SGX is enabled in BIOS (based a non-zero sum value of SGX EPC section sizes).\n\nThe (sub-)set of CPUID attributes to publish is configurable via the\n`attributeBlacklist` 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\n[configuration](deployment-and-usage#worker-configuration).\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| Attribute | Description |\n| --------- | ---------------------------------------------------------------- |\n| ADX | Multi-Precision Add-Carry Instruction Extensions (ADX)\n| AESNI | Advanced Encryption Standard (AES) New Instructions (AES-NI)\n| AVX | Advanced Vector Extensions (AVX)\n| AVX2 | Advanced Vector Extensions 2 (AVX2)\n\nSee the full list in [github.com/klauspost/cpuid][klauspost-cpuid].\n\n#### Arm CPUID attribute (partial list)\n\n| Attribute | Description |\n| --------- | ---------------------------------------------------------------- |\n| IDIVA | Integer divide instructions available in ARM mode\n| IDIVT | Integer divide instructions available in Thumb mode\n| THUMB | Thumb instructions\n| FASTMUL | Fast multiplication\n| VFP | Vector floating point instruction extension (VFP)\n| VFPv3 | Vector floating point extension v3\n| VFPv4 | Vector floating point extension v4\n| VFPD32 | VFP with 32 D-registers\n| HALF | Half-word loads and stores\n| EDSP | DSP extensions\n| NEON | NEON SIMD instructions\n| LPAE | Large Physical Address Extensions\n\n#### Arm64 CPUID attribute (partial list)\n\n| Attribute | Description |\n| --------- | ---------------------------------------------------------------- |\n| AES | Announcing the Advanced Encryption Standard\n| EVSTRM | Event Stream Frequency Features\n| FPHP | Half Precision(16bit) Floating Point Data Processing Instructions\n| ASIMDHP | Half Precision(16bit) Asimd Data Processing Instructions\n| ATOMICS | Atomic Instructions to the A64\n| ASIMRDM | Support for Rounding Double Multiply Add/Subtract\n| PMULL | Optional Cryptographic and CRC32 Instructions\n| JSCVT | Perform Conversion to Match Javascript\n| DCPOP | Persistent Memory Support\n\n### Custom\n\nThe 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\n[configuration](/node-feature-discovery/master/get-started/deployment-and-usage.html#worker-configuration) for instructions\nand examples how to set-up and manage the worker configuration.\n\nTo 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\nAdditionally 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```plaintext\nRule :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\nRules are specified under `sources.custom` in the nfd-worker configuration\nfile.\n\n```yaml\nsources:\n custom:\n - name: \n value: \n matchOn:\n - : \n [: ]\n - \n - ...\n - ...\n - \n - \n - ...\n - ...\n - \n```\n\n#### Matching process\n\nSpecifying Rules to match on a feature is done by providing a list of Matchers.\nEach Matcher contains one or more Rules.\n\nLogical _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```plaintext\nAttribute :A PCI attribute.\nElement :An identifier of the PCI attribute.\n```\n\nThe 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```yaml\npciId :\n class: [, ...]\n vendor: [, ...]\n device: [, ...]\n```\n\nMatching 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```plaintext\nAttribute :A USB attribute.\nElement :An identifier of the USB attribute.\n```\n\nThe 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```yaml\nusbId :\n class: [, ...]\n vendor: [, ...]\n device: [, ...]\n serial: [, ...]\n```\n\nMatching 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```plaintext\nElement :A kernel module\n```\n\nThe LoadedKMod Rule allows matching the loaded kernel modules in the system\nagainst a provided list of Elements.\n\n###### Format\n\n```yaml\nloadedKMod : [, ...]\n```\n\nMatching 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```plaintext\nElement :A CPUID flag\n```\n\nThe Rule allows matching the available CPUID flags in the system against a\nprovided list of Elements.\n\n###### Format\n\n```yaml\ncpuId : [, ...]\n```\n\nMatching 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```plaintext\nElement :A Kconfig option\n```\n\nThe Rule allows matching the kconfig options in the system against a provided\nlist of Elements.\n\n###### Format\n\n```yaml\nkConfig: ['>, ...]\n```\n\nMatching 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 `=` in the kernel.\n\n##### Nodename rule\n\n###### Nomenclature\n\n```plaintext\nElement :A nodename regexp pattern\n```\n\nThe Rule allows matching the node's name against a provided list of Elements.\n\n###### Format\n\n```yaml\nnodename: [ , ... ]\n```\n\nMatching 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```yaml\ncustom:\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- A node would contain the label:\n `feature.node.kubernetes.io/custom-my.kernel.feature=true` if the node has\n `kmod1` _AND_ `kmod2` kernel modules loaded.\n- A node would contain the label:\n `feature.node.kubernetes.io/custom-my.pci.feature=true` if the node contains\n a PCI device with a PCI vendor ID of `15b3` _AND_ PCI device ID of `1014` _OR_\n `1017`.\n- A node would contain the label:\n `feature.node.kubernetes.io/custom-my.usb.feature=true` if the node contains\n a USB device with a USB vendor ID of `1d6b` _AND_ USB device ID of `0003`.\n- A node would contain the label:\n `feature.node.kubernetes.io/custom-my.combined.feature=true` if\n `vendor_kmod1` _AND_ `vendor_kmod2` kernel modules are loaded __AND__ the node\n contains a PCI device\n with a PCI vendor ID of `15b3` _AND_ PCI device ID of `1014` _or_ `1017`.\n- A node would contain the label:\n `vendor.feature.node.kubernetes.io/accumulated.feature=true` if\n `some_kmod1` _AND_ `some_kmod2` kernel modules are loaded __OR__ the node\n contains a PCI device\n with a PCI vendor ID of `15b3` _AND_ PCI device ID of `1014` _OR_ `1017`.\n- A node would contain the label:\n `feature.node.kubernetes.io/custom-my.kernel.featureneedscpu=true` if\n `KVM_INTEL` kernel config is enabled __AND__ the node CPU supports `VMX`\n virtual machine extensions\n- A node would contain the label:\n `feature.node.kubernetes.io/custom-my.kernel.modulecompiler=true` if the\n in-tree `kmod1` kernel module is loaded __AND__ it's built with\n `GCC_VERSION=100101`.\n- A node would contain the label:\n `profile.node.kubernetes.io/my-datacenter=datacenter-1` if the node's name\n matches the `node-datacenter1-rack.*-server.*` pattern, e.g.\n `node-datacenter1-rack2-server42`\n\n#### Statically defined features\n\nSome feature labels which are common and generic are defined statically in the\n`custom` feature source. A user may add additional Matchers to these feature\nlabels by defining them in the `nfd-worker` configuration file.\n\n| Feature | Attribute | Description |\n| ------- | --------- | -----------|\n| rdma | capable | The node has an RDMA capable Network adapter |\n| rdma | enabled | The node has the needed RDMA modules loaded to run RDMA traffic |\n\n### IOMMU\n\nThe **iommu** feature source supports the following labels:\n\n| Feature name | Description |\n| :------------: | :---------------------------------------------------------: |\n| enabled | IOMMU is present and enabled in the kernel\n\n### Kernel\n\nThe **kernel** feature source supports the following labels:\n\n| Feature | Attribute | Description |\n| ------- | ------------------- | -------------------------------------------- |\n| 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`\n| selinux | enabled | Selinux is enabled on the node\n| version | full | Full kernel version as reported by `/proc/sys/kernel/osrelease` (e.g. '4.5.6-7-g123abcde')\n| | major | First component of the kernel version (e.g. '4')\n| | minor | Second component of the kernel version (e.g. '5')\n| | revision | Third component of the kernel version (e.g. '6')\n\nKernel config file to use, and, the set of config options to be detected are\nconfigurable. See [configuration](deployment-and-usage#worker-configuration)\nfor more information.\n\n### Memory\n\nThe **memory** feature source supports the following labels:\n\n| Feature | Attribute | Description |\n| ------- | --------- | ------------------------------------------------------ |\n| numa | | Multiple memory nodes i.e. NUMA architecture detected\n| nv | present | NVDIMM device(s) are present\n| nv | dax | NVDIMM region(s) configured in DAX mode are present\n\n### Network\n\nThe **network** feature source supports the following labels:\n\n| Feature | Attribute | Description |\n| ------- | ---------- | ----------------------------------------------------- |\n| sriov | capable | [Single Root Input/Output Virtualization][sriov] (SR-IOV) enabled Network Interface Card(s) present\n| | configured | SR-IOV virtual functions have been configured\n\n### PCI\n\nThe **pci** feature source supports the following labels:\n\n| Feature | Attribute | Description |\n| -------------------- | ------------- | ------------------------------------- |\n| <device label> | present | PCI device is detected\n| <device label> | sriov.capable | [Single Root Input/Output Virtualization][sriov] (SR-IOV) enabled PCI device present\n\n`` is composed of raw PCI IDs, separated by underscores. The set\nof fields used in `` is configurable, valid fields being `class`,\n`vendor`, `device`, `subsystem_vendor` and `subsystem_device`. Defaults are\n`class` and `vendor`. An example label using the default label fields:\n\n```plaintext\nfeature.node.kubernetes.io/pci-1200_8086.present=true\n```\n\nAlso 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\nThe **usb** feature source supports the following labels:\n\n| Feature | Attribute | Description |\n| -------------------- | ------------- | ------------------------------------- |\n| <device label> | present | USB device is detected\n\n`` is composed of raw USB IDs, separated by underscores. The set\nof fields used in `` is configurable, valid fields being `class`,\n`vendor`, `device` and `serial`. Defaults are `class`, `vendor` and `device`.\nAn example label using the default label fields:\n\n```plaintext\nfeature.node.kubernetes.io/usb-fe_1a6e_089a.present=true\n```\n\nSee [configuration](deployment-and-usage#worker-configuration) for more\ninformation on NFD config.\n\n### Storage\n\nThe **storage** feature source supports the following labels:\n\n| Feature name | Description |\n| ------------------ | ------------------------------------------------------- |\n| nonrotationaldisk | Non-rotational disk, like SSD, is present in the node\n\n### System\n\nThe **system** feature source supports the following labels:\n\n| Feature | Attribute | Description |\n| ----------- | ---------------- | --------------------------------------------|\n| os_release | ID | Operating system identifier\n| | VERSION_ID | Operating system version identifier (e.g. '6.7')\n| | VERSION_ID.major | First component of the OS version id (e.g. '6')\n| | VERSION_ID.minor | Second component of the OS version id (e.g. '7')\n\n### Local -- user-specific features\n\nNFD 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\nThe *local* feature source gets its labels by two different ways:\n\n- It tries to execute files found under\n `/etc/kubernetes/node-feature-discovery/source.d/` directory. The hook files\n must be executable and they are supposed to print all discovered features in\n `stdout`, one per line. With ELF binaries static linking is recommended as\n the selection of system libraries available in the NFD release image is very\n limited. Other runtimes currently supported by the NFD stock image are bash\n and perl.\n- It reads files found under\n `/etc/kubernetes/node-feature-discovery/features.d/` directory. The file\n content is expected to be similar to the hook output (described above).\n\n**NOTE:** The [minimal](deployment-and-usage#minimal) image variant only\nsupports running statically linked binaries.\n\nThese 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\nIn both cases, the labels can be binary or non binary, using either `` or\n`=` format.\n\nUnlike 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 `` 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\nYou can also override the default namespace of your labels using this format:\n`/[=]`. If using something else than\n`[.]feature.node.kubernetes.io` or\n`[.]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\n`my.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\nOne 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\nUser has a shell script\n`/etc/kubernetes/node-feature-discovery/source.d/my-source` which has the\nfollowing `stdout` output:\n\n```plaintext\nMY_FEATURE_1\nMY_FEATURE_2=myvalue\n/override_source-OVERRIDE_BOOL\n/override_source-OVERRIDE_VALUE=123\noverride.namespace/value=456\n```\n\nwhich, in turn, will translate into the following node labels:\n\n```plaintext\nfeature.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\nUser has a file `/etc/kubernetes/node-feature-discovery/features.d/my-source`\nwhich contains the following lines:\n\n```plaintext\nMY_FEATURE_1\nMY_FEATURE_2=myvalue\n/override_source-OVERRIDE_BOOL\n/override_source-OVERRIDE_VALUE=123\noverride.namespace/value=456\n```\n\nwhich, in turn, will translate into the following node labels:\n\n```plaintext\nfeature.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\nNFD 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\nThis feature is experimental and by no means a replacement for the usage of\ndevice plugins.\n\nLabels 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\nAn 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\nSimilar 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\nExample usage of the command line arguments, using a new namespace:\n`nfd-master -resource-labels=my_source-my.feature,sgx.some.ns/epc -extra-label-ns=sgx.some.ns`\n\nThe above would result in following extended resources provided that related\nlabels exist:\n\n```plaintext\n sgx.some.ns/epc: