2022-11-02 12:34:37 +00:00
|
|
|
---
|
|
|
|
title: "NFD-Topology-Updater"
|
|
|
|
layout: default
|
|
|
|
sort: 5
|
|
|
|
---
|
|
|
|
|
|
|
|
# NFD-Topology-Updater
|
|
|
|
{: .no_toc}
|
|
|
|
|
|
|
|
---
|
|
|
|
|
2023-02-21 15:09:04 +00:00
|
|
|
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
|
2023-01-12 01:23:36 +00:00
|
|
|
[NodeResourceTopology](custom-resources.md#noderesourcetopology) custom resources.
|
2022-12-02 09:47:56 +00:00
|
|
|
It makes sure that new NodeResourceTopology instances are created for each new
|
|
|
|
nodes that get added to the cluster.
|
2022-11-02 12:34:37 +00:00
|
|
|
|
2023-08-31 06:41:44 +00:00
|
|
|
Because of the design and implementation of Kubernetes, only resources exclusively
|
|
|
|
allocated to [Guaranteed Quality of Service](https://kubernetes.io/docs/concepts/workloads/pods/pod-qos/#guaranteed)
|
|
|
|
pods will be accounted.
|
|
|
|
This includes
|
|
|
|
[CPU cores](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#static-policy),
|
|
|
|
[memory](https://kubernetes.io/docs/tasks/administer-cluster/memory-manager/#policy-static)
|
|
|
|
and
|
|
|
|
[devices](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/).
|
|
|
|
|
2022-11-02 12:34:37 +00:00
|
|
|
When run as a daemonset, nodes are re-examined for the allocated resources
|
2023-02-21 15:09:04 +00:00
|
|
|
(to determine the information of the allocatable resources on a per-zone basis
|
2022-11-02 12:34:37 +00:00
|
|
|
where a zone can be a NUMA node) at an interval specified using the
|
2023-01-12 01:23:36 +00:00
|
|
|
[`-sleep-interval`](../reference/topology-updater-commandline-reference.html.md#-sleep-interval)
|
2023-02-21 15:09:04 +00:00
|
|
|
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`](../reference/topology-updater-commandline-reference.md#-kubelet-state-dir)
|
|
|
|
and triggers an update for every change occurs in the files.
|
|
|
|
|
2022-11-09 17:25:58 +00:00
|
|
|
In addition, it can avoid examining specific allocated resources
|
|
|
|
given a configuration of resources to exclude via [`-excludeList`](../reference/topology-updater-configuration-reference.md#excludelist)
|
|
|
|
|
2022-12-01 08:24:16 +00:00
|
|
|
## Deployment Notes
|
|
|
|
|
2023-07-21 11:36:56 +00:00
|
|
|
Kubelet [PodResource API][podresource-api] with the
|
|
|
|
[GetAllocatableResources][getallocatableresources] functionality enabled is a
|
|
|
|
prerequisite for nfd-topology-updater to be able to run (i.e. Kubernetes v1.21
|
|
|
|
or later is required).
|
2022-12-01 08:24:16 +00:00
|
|
|
|
|
|
|
Preceding Kubernetes v1.23, the `kubelet` must be started with
|
|
|
|
`--feature-gates=KubeletPodResourcesGetAllocatable=true`.
|
|
|
|
|
|
|
|
Starting from Kubernetes v1.23, the `KubeletPodResourcesGetAllocatable`
|
|
|
|
[feature gate][feature-gate]. is enabled by default
|
|
|
|
|
2022-11-09 17:25:58 +00:00
|
|
|
## 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.
|
2023-08-03 10:38:07 +00:00
|
|
|
|
2022-11-09 17:25:58 +00:00
|
|
|
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.
|
|
|
|
|
2024-08-19 13:11:09 +00:00
|
|
|
The provided deployment templates create an empty configmap
|
2022-11-09 17:25:58 +00:00
|
|
|
and mount it inside the nfd-topology-updater containers.
|
|
|
|
|
|
|
|
In Helm deployments,
|
|
|
|
[Topology Updater parameters](../deployment/helm.md#topology-updater-parameters)
|
|
|
|
`toplogyUpdater.config` can be used to edit the respective configuration.
|
|
|
|
|
2024-08-19 13:11:09 +00:00
|
|
|
In Kustomize deployments, modify the `nfd-worker-conf` ConfigMap with a custom
|
|
|
|
overlay.
|
|
|
|
|
2022-11-09 17:25:58 +00:00
|
|
|
See
|
|
|
|
[nfd-topology-updater configuration file reference](../reference/topology-updater-configuration-reference.md)
|
|
|
|
for more details.
|
|
|
|
The (empty-by-default)
|
|
|
|
[example config](https://github.com/kubernetes-sigs/node-feature-discovery/blob/{{site.release}}/deployment/components/topology-updater-config/nfd-topology-updater.conf.example)
|
|
|
|
contains all available configuration options and can be used as a reference
|
2022-12-01 08:24:16 +00:00
|
|
|
for creating a configuration.
|
|
|
|
|
|
|
|
<!-- Links -->
|
|
|
|
[podresource-api]: https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/#monitoring-device-plugin-resources
|
|
|
|
[feature-gate]: https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates
|
2023-07-21 11:36:56 +00:00
|
|
|
[getallocatableresources]: https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/#grpc-endpoint-getallocatableresources
|