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 advertises the discovered features by creating or updating a NodeFeature object for its node, which nfd-master processes into node labels.

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.

Worker configuration

NFD-Worker supports configuration through a configuration file. The default location is /etc/kubernetes/node-feature-discovery/nfd-worker.conf, but, this can be changed by specifying the-config command line flag. The configuration file is read only when nfd-worker starts; configuration changes take effect after the nfd-worker pods are restarted (see the note below).

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

The provided deployment methods (Helm and Kustomize) create an empty configmap and mount it inside the nfd-worker containers.

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

In Kustomize deployments, modify the nfd-worker-conf ConfigMap with a custom overlay.

NOTE: dynamic run-time reconfiguration was dropped in NFD v0.17. Re-configuration is handled by pod restarts.

See nfd-worker configuration file reference for more details. The (empty-by-default) example config contains all available configuration options and can be used as a reference for creating a configuration.

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

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

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