1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00
node-feature-discovery/docs/usage/nfd-worker.md
Markus Lehtonen 02b6b7395c Drop dynamic run-time reconfiguration
Simplify the code and reduce possible error scenarios by dropping
fsnotify-based reconfiguration from nfd-master and nfd-worker. Also
eliminates repeated re-configuration in scenarios where kubelet
continuosly touches the (every minute) mounted file (configmap) on the
filesystem.

Also modifies the Helm and kustomize deployments so that nfd-master,
nfd-worker and nfd-topology-updater pods are restarted on configmap
updates. In kustomize, the slght downside of this is the name of the
config map(s) depends on the content, so every time a user customizes
the config data, the old unused configmap will be left and must be
garbage-collected manually.
2024-08-21 12:46:36 +03:00

2.4 KiB

title layout sort
NFD-Worker default 4

NFD-Worker

{: .no_toc}


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.

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. Configuration file is re-read whenever it is modified which makes run-time re-configuration of nfd-worker straightforward.

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

The provided deployment methods (Helm and Kustomize) create an empty configmap and mount it inside the nfd-master 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.