2020-09-08 20:16:17 +03:00
---
title: "Introduction"
layout: default
sort: 1
---
# Introduction
2021-09-27 15:31:49 +03:00
{: .no_toc}
2020-09-08 20:16:17 +03:00
2021-03-09 13:38:09 +02:00
## Table of contents
2021-09-27 15:31:49 +03:00
{: .no_toc .text-delta}
2020-09-08 20:16:17 +03:00
1. TOC
{:toc}
---
This software enables node feature discovery for Kubernetes. It detects
hardware features available on each node in a Kubernetes cluster, and
2023-04-11 20:38:21 +03:00
advertises those features using node labels and optionally node extended
2023-07-21 14:36:56 +03:00
resources and node taints. Node Feature Discovery is compatible with any recent
version of Kubernetes (v1.21+).
2020-09-08 20:16:17 +03:00
2023-02-17 16:35:47 +08:00
NFD consists of four software components:
2020-09-08 20:16:17 +03:00
2020-10-20 20:50:46 +03:00
1. nfd-master
1. nfd-worker
2021-01-20 21:49:41 +00:00
1. nfd-topology-updater
2023-02-17 16:35:47 +08:00
1. nfd-topology-gc
2020-09-08 20:16:17 +03:00
## NFD-Master
2020-10-20 20:50:46 +03:00
NFD-Master is the daemon responsible for communication towards the Kubernetes
2020-09-08 20:16:17 +03:00
API. That is, it receives labeling requests from the worker and modifies node
objects accordingly.
## NFD-Worker
2020-10-20 20:50:46 +03:00
NFD-Worker is a daemon responsible for feature detection. It then communicates
2020-09-08 20:16:17 +03:00
the information to nfd-master which does the actual node labeling. One
instance of nfd-worker is supposed to be running on each node of the cluster,
2021-01-20 21:49:41 +00:00
## NFD-Topology-Updater
NFD-Topology-Updater is a daemon responsible for examining allocated
2021-11-12 12:07:23 +02:00
resources on a worker node to account for resources available to be allocated
2021-01-20 21:49:41 +00:00
to new pod on a per-zone basis (where a zone can be a NUMA node). It then
2022-12-02 11:47:56 +02:00
creates or updates a
2023-01-11 17:23:36 -08:00
[NodeResourceTopology ](../usage/custom-resources.md#noderesourcetopology ) custom
2022-12-02 11:47:56 +02:00
resource object specific to this node. One instance of nfd-topology-updater is
2021-01-20 21:49:41 +00:00
supposed to be running on each node of the cluster.
2023-02-17 16:35:47 +08:00
## NFD-Topology-GC
2023-01-10 17:50:31 +01:00
2023-02-17 16:35:47 +08:00
NFD-Topology-GC is a daemon responsible for cleaning obsolete
2023-01-11 17:23:36 -08:00
[NodeResourceTopology ](../usage/custom-resources.md#noderesourcetopology ) objects,
2023-01-10 17:50:31 +01:00
obsolete means that there is no corresponding worker node.
One instance of nfd-topology-gc is supposed to be running in the cluster.
2021-01-20 21:49:41 +00:00
## Feature Discovery
2020-09-08 20:16:17 +03:00
Feature discovery is divided into domain-specific feature sources:
2020-10-20 20:50:46 +03:00
2020-09-08 20:16:17 +03:00
- CPU
- Kernel
- Memory
- Network
- PCI
- Storage
- System
- USB
- Custom (rule-based custom features)
- Local (hooks for user-specific features)
Each feature source is responsible for detecting a set of features which. in
turn, are turned into node feature labels. Feature labels are prefixed with
`feature.node.kubernetes.io/` and also contain the name of the feature source.
Non-standard user-specific feature labels can be created with the local and
custom feature sources.
An overview of the default feature labels:
2020-10-20 20:50:46 +03:00
2020-09-08 20:16:17 +03:00
```json
{
"feature.node.kubernetes.io/cpu-< feature-name > ": "true",
"feature.node.kubernetes.io/custom-< feature-name > ": "true",
"feature.node.kubernetes.io/kernel-< feature name > ": "< feature value > ",
"feature.node.kubernetes.io/memory-< feature-name > ": "true",
"feature.node.kubernetes.io/network-< feature-name > ": "true",
"feature.node.kubernetes.io/pci-< device label > .present": "true",
"feature.node.kubernetes.io/storage-< feature-name > ": "true",
"feature.node.kubernetes.io/system-< feature name > ": "< feature value > ",
"feature.node.kubernetes.io/usb-< device label > .present": "< feature value > ",
"feature.node.kubernetes.io/< file name > -< feature name > ": "< feature value > "
}
```
2021-03-09 13:38:09 +02:00
## Node annotations
2020-09-08 20:16:17 +03:00
NFD also annotates nodes it is running on:
2021-02-03 19:49:02 +02:00
| Annotation | Description
| ------------------------------------------------------------ | -----------
| [< instance> .]nfd.node.kubernetes.io/master.version | Version of the nfd-master instance running on the node. Informative use only.
| [< instance> .]nfd.node.kubernetes.io/worker.version | Version of the nfd-worker instance running on the node. Informative use only.
| [< instance> .]nfd.node.kubernetes.io/feature-labels | Comma-separated list of node labels managed by NFD. NFD uses this internally so must not be edited by users.
| [< instance> .]nfd.node.kubernetes.io/extended-resources | Comma-separated list of node extended resources managed by NFD. NFD uses this internally so must not be edited by users.
2023-08-03 13:38:07 +03:00
> **NOTE:** the [`-instance`](../reference/master-commandline-reference.md#instance)
> command line flag affects the annotation names
2020-09-08 20:16:17 +03:00
2021-02-25 13:49:02 +02:00
Unapplicable annotations are not created, i.e. for example master.version is
only created on nodes running nfd-master.
2020-09-08 20:16:17 +03:00
2022-12-01 11:08:20 +02:00
## Custom resources
NFD takes use of some Kubernetes Custom Resources.
2023-01-11 17:23:36 -08:00
[NodeFeature ](../usage/custom-resources.md#nodefeature )s (EXPERIMENTAL)
2022-12-01 19:28:25 +02:00
can be used for representing node features and requesting node labels to be
generated.
2023-01-11 17:23:36 -08:00
NFD-Master uses [NodeFeatureRule ](../usage/custom-resources.md#nodefeaturerule )s
2022-12-01 11:08:20 +02:00
for custom labeling of nodes.
NFD-Topology-Updater creates
2023-01-11 17:23:36 -08:00
[NodeResourceTopology ](../usage/custom-resources.md#noderesourcetopology ) objects
2022-12-01 11:08:20 +02:00
that describe the hardware topology of node resources.