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-topology-updater.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

4.3 KiB

title layout sort
NFD-Topology-Updater default 5

NFD-Topology-Updater

{: .no_toc}


NFD-Topology-Updater is preferably run as a Kubernetes DaemonSet. This assures re-examination on regular intervals and/or per pod life-cycle events, capturing changes in the allocated resources and hence the allocatable resources on a per-zone basis by updating NodeResourceTopology custom resources. It makes sure that new NodeResourceTopology instances are created for each new nodes that get added to the cluster.

Because of the design and implementation of Kubernetes, only resources exclusively allocated to Guaranteed Quality of Service pods will be accounted. This includes CPU cores, memory and devices.

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

Another option is to configure the updater to update the allocated resources per pod life-cycle events. The updater will monitor the checkpoint file stated in -kubelet-state-dir and triggers an update for every change occurs in the files.

In addition, it can avoid examining specific allocated resources given a configuration of resources to exclude via -excludeList

Deployment Notes

Kubelet PodResource API with the GetAllocatableResources functionality enabled is a prerequisite for nfd-topology-updater to be able to run (i.e. Kubernetes v1.21 or later is required).

Preceding Kubernetes v1.23, the kubelet must be started with --feature-gates=KubeletPodResourcesGetAllocatable=true.

Starting from Kubernetes v1.23, the KubeletPodResourcesGetAllocatable feature gate. is enabled by default

Topology-Updater Configuration

NFD-Topology-Updater supports configuration through a configuration file. The default location is /etc/kubernetes/node-feature-discovery/topology-updater.conf, but, this can be changed by specifying the-config command line flag.

Topology-Updater 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 templates create an empty configmap and mount it inside the nfd-topology-updater containers.

In Helm deployments, Topology Updater parameters toplogyUpdater.config can be used to edit the respective configuration.

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

See nfd-topology-updater 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.