2022-11-02 12:34:37 +00:00
|
|
|
---
|
|
|
|
title: "NFD-Master"
|
|
|
|
layout: default
|
|
|
|
sort: 3
|
|
|
|
---
|
|
|
|
|
|
|
|
# NFD-Master
|
|
|
|
{: .no_toc}
|
|
|
|
|
|
|
|
---
|
|
|
|
|
2022-12-01 17:28:25 +00:00
|
|
|
NFD-Master is responsible for connecting to the Kubernetes API server and
|
|
|
|
updating node objects. More specifically, it modifies node labels, taints and
|
|
|
|
extended resources based on requests from nfd-workers and 3rd party extensions.
|
|
|
|
|
|
|
|
## NodeFeature controller
|
|
|
|
|
|
|
|
**EXPERIMENTAL**
|
2023-01-12 01:23:36 +00:00
|
|
|
Controller for [NodeFeature](custom-resources.md#nodefeature-custom-resource)
|
2022-12-01 17:28:25 +00:00
|
|
|
objects can be enabled with the
|
2023-01-12 01:23:36 +00:00
|
|
|
[`-enable-nodefeature-api`](../reference/master-commandline-reference.md#-enable-nodefeature-api)
|
2022-12-01 17:28:25 +00:00
|
|
|
command line flag. When enabled, features from NodeFeature objects are used as
|
2023-01-12 01:23:36 +00:00
|
|
|
the input for the [NodeFeatureRule](custom-resources.md#nodefeaturerule)
|
2022-12-01 17:28:25 +00:00
|
|
|
processing pipeline. In addition, any labels listed in the NodeFeature object
|
|
|
|
are created on the node (note the allowed
|
2023-01-12 01:23:36 +00:00
|
|
|
[label namespaces](customization-guide.md#node-labels) are controlled).
|
2022-12-01 17:28:25 +00:00
|
|
|
|
|
|
|
> NOTE: NodeFeature API must also be enabled in nfd-worker with
|
2023-01-12 01:23:36 +00:00
|
|
|
> its [`-enable-nodefeature-api`](../reference/worker-commandline-reference.md#-enable-nodefeature-api)
|
2022-12-01 17:28:25 +00:00
|
|
|
> flag.
|
|
|
|
|
|
|
|
## NodeFeatureRule controller
|
|
|
|
|
|
|
|
NFD-Master acts as the controller for
|
2023-01-12 01:23:36 +00:00
|
|
|
[NodeFeatureRule](custom-resources.md#nodefeaturerule) objects.
|
2022-12-01 17:28:25 +00:00
|
|
|
It applies the rules specified in NodeFeatureRule objects on raw feature data
|
|
|
|
and creates node labels accordingly. The feature data used as the input can be
|
|
|
|
received from nfd-worker instances through the gRPC interface or from
|
2023-01-12 01:23:36 +00:00
|
|
|
[NodeFeature](custom-resources.md#nodefeature-custom-resource) objects. The latter
|
2022-12-01 17:28:25 +00:00
|
|
|
requires that the [NodeFeaure controller](#nodefeature-controller) has been
|
|
|
|
enabled.
|
|
|
|
|
|
|
|
> NOTE: when gRPC is used for communicating the features (the default
|
|
|
|
> mechanism), (re-)labelling only happens when a request is received from
|
|
|
|
> nfd-worker. That is, in practice rules are evaluated and labels for each node
|
|
|
|
> are created on intervals specified by the
|
2023-01-12 01:23:36 +00:00
|
|
|
> [`core.sleepInterval`](../reference/worker-configuration-reference.md#coresleepinterval)
|
2022-12-01 17:28:25 +00:00
|
|
|
> configuration option of nfd-worker instances. This means that modification or
|
|
|
|
> creation of NodeFeatureRule objects does not instantly cause the node
|
|
|
|
> labels to be updated. Instead, the changes only come visible in node labels
|
|
|
|
> as nfd-worker instances send their labelling requests. This limitation is not
|
|
|
|
> present when gRPC interface is disabled
|
2023-01-12 01:23:36 +00:00
|
|
|
> and [NodeFeature](custom-resources.md#nodefeature-custom-resource) API is used.
|
2022-12-01 17:28:25 +00:00
|
|
|
|
|
|
|
## Deployment notes
|
|
|
|
|
|
|
|
NFD-Master runs as a deployment, by default
|
2022-11-02 12:34:37 +00:00
|
|
|
it prefers running on the cluster's master nodes but will run on worker
|
|
|
|
nodes if no master nodes are found.
|
|
|
|
|
|
|
|
For High Availability, you should simply increase the replica count of
|
|
|
|
the deployment object. You should also look into adding
|
|
|
|
[inter-pod](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity)
|
|
|
|
affinity to prevent masters from running on the same node.
|
|
|
|
However note that inter-pod affinity is costly and is not recommended
|
|
|
|
in bigger clusters.
|
|
|
|
|
2022-12-01 17:28:25 +00:00
|
|
|
> NOTE: If the [NodeFeature controller](#nodefeature-controller) is enabled the
|
|
|
|
> replica count should be 1.
|
2022-11-02 12:34:37 +00:00
|
|
|
|
|
|
|
If you have RBAC authorization enabled (as is the default e.g. with clusters
|
|
|
|
initialized with kubeadm) you need to configure the appropriate ClusterRoles,
|
|
|
|
ClusterRoleBindings and a ServiceAccount in order for NFD to create node
|
|
|
|
labels. The provided template will configure these for you.
|