404
Not Found
diff --git a/v0.14/404.html b/v0.14/404.html index 6f671a0d1..993a965da 100644 --- a/v0.14/404.html +++ b/v0.14/404.html @@ -1 +1 @@ -
Not Found
Not Found
You can reach us via the following channels:
This is a SIG-node subproject, hosted under the Kubernetes SIGs organization in Github. The project was established in 2016 and was migrated to Kubernetes SIGs in 2018.
This is open source software released under the Apache 2.0 License.
You can reach us via the following channels:
This is a SIG-node subproject, hosted under the Kubernetes SIGs organization in Github. The project was established in 2016 and was migrated to Kubernetes SIGs in 2018.
This is open source software released under the Apache 2.0 License.
Node Feature Discovery Helm chart allow to easily deploy and manage NFD.
NOTE: NFD is not ideal for other Helm charts to depend on as that may result in multiple parallel NFD deployments in the same cluster which is not fully supported by the NFD Helm chart.
Helm package manager should be installed.
To install the latest stable version:
export NFD_NS=node-feature-discovery
+ Helm · Node Feature Discovery This documentation is for a Node Feature Discovery version that is no longer supported. Please upgrade and visit the documentation of the latest stable release.
Deployment with Helm
Table of contents
Node Feature Discovery Helm chart allow to easily deploy and manage NFD.
NOTE: NFD is not ideal for other Helm charts to depend on as that may result in multiple parallel NFD deployments in the same cluster which is not fully supported by the NFD Helm chart.
Prerequisites
Helm package manager should be installed.
Deployment
To install the latest stable version:
export NFD_NS=node-feature-discovery
helm repo add nfd https://kubernetes-sigs.github.io/node-feature-discovery/charts
helm repo update
helm install nfd/node-feature-discovery --namespace $NFD_NS --create-namespace --generate-name
@@ -13,4 +13,4 @@ helm install nfd/node-feature-discovery install nfd/node-feature-discovery --set nameOverride=NFDinstance --set master.replicaCount=2 --namespace $NFD_NS --create-namespace
Uninstalling the chart
To uninstall the node-feature-discovery
deployment:
export NFD_NS=node-feature-discovery
helm uninstall node-feature-discovery --namespace $NFD_NS
-
The command removes all the Kubernetes components associated with the chart and deletes the release.
Chart parameters
In order to tailor the deployment of the Node Feature Discovery to your cluster needs We have introduced the following Chart parameters.
General parameters
Name Type Default description image.repository
string registry.k8s.io/nfd/node-feature-discovery
NFD image repository image.tag
string v0.14.6
NFD image tag image.pullPolicy
string Always
Image pull policy imagePullSecrets
list [] ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info nameOverride
string Override the name of the chart fullnameOverride
string Override a default fully qualified app name tls.enable
bool false Specifies whether to use TLS for communications between components. NOTE: this parameter is related to the deprecated gRPC API and will be removed with it in a future release tls.certManager
bool false If enabled, requires cert-manager to be installed and will automatically create the required TLS certificates. NOTE: this parameter is related to the deprecated gRPC API and will be removed with it in a future release enableNodeFeatureApi
bool true Enable the NodeFeature CRD API for communicating node features. This will automatically disable the gRPC communication. NOTE: this parameter is related to the deprecated gRPC API and will be removed with it in a future release prometheus.enable
bool false Specifies whether to expose metrics using prometheus operator prometheus.labels
dict {} Specifies labels for use with the prometheus operator to control how it is selected
Metrics are configured to be exposed using prometheus operator API's by default. If you want to expose metrics using the prometheus operator API's you need to install the prometheus operator in your cluster.
Master pod parameters
Name Type Default description master.*
dict NFD master deployment configuration master.port
integer Specifies the TCP port that nfd-master listens for incoming requests. NOTE: this parameter is related to the deprecated gRPC API and will be removed with it in a future release master.metricsPort
integer 8081 Port on which to expose metrics from components to prometheus operator master.instance
string Instance name. Used to separate annotation namespaces for multiple parallel deployments master.resyncPeriod
string NFD API controller resync period. master.extraLabelNs
array [] List of allowed extra label namespaces master.resourceLabels
array [] List of labels to be registered as extended resources master.enableTaints
bool false Specifies whether to enable or disable node tainting master.crdController
bool null Specifies whether the NFD CRD API controller is enabled. If not set, controller will be enabled if master.instance
is empty. master.featureRulesController
bool null DEPRECATED: use master.crdController
instead master.replicaCount
integer 1 Number of desired pods. This is a pointer to distinguish between explicit zero and not specified master.podSecurityContext
dict {} PodSecurityContext holds pod-level security attributes and common container settings master.securityContext
dict {} Container security settings master.serviceAccount.create
bool true Specifies whether a service account should be created master.serviceAccount.annotations
dict {} Annotations to add to the service account master.serviceAccount.name
string The name of the service account to use. If not set and create is true, a name is generated using the fullname template master.rbac.create
bool true Specifies whether to create RBAC configuration for nfd-master master.service.type
string ClusterIP NFD master service type. NOTE: this parameter is related to the deprecated gRPC API and will be removed with it in a future release master.service.port
integer 8080 NFD master service port. NOTE: this parameter is related to the deprecated gRPC API and will be removed with it in a future release master.resources
dict {} NFD master pod resources management master.nodeSelector
dict {} NFD master pod node selector master.tolerations
dict Scheduling to master node is disabled NFD master pod tolerations master.annotations
dict {} NFD master pod annotations master.affinity
dict NFD master pod required node affinity master.deploymentAnnotations
dict {} NFD master deployment annotations master.nfdApiParallelism
integer 10 Specifies the maximum number of concurrent node updates. master.config
dict NFD master configuration
Worker pod parameters
Name Type Default description worker.*
dict NFD worker daemonset configuration worker.metricsPort*
integer 8081 Port on which to expose metrics from components to prometheus operator worker.config
dict NFD worker configuration worker.podSecurityContext
dict {} PodSecurityContext holds pod-level security attributes and common container settings worker.securityContext
dict {} Container security settings worker.serviceAccount.create
bool true Specifies whether a service account for nfd-worker should be created worker.serviceAccount.annotations
dict {} Annotations to add to the service account for nfd-worker worker.serviceAccount.name
string The name of the service account to use for nfd-worker. If not set and create is true, a name is generated using the fullname template (suffixed with -worker
) worker.rbac.create
bool true Specifies whether to create RBAC configuration for nfd-worker worker.mountUsrSrc
bool false Specifies whether to allow users to mount the hostpath /user/src. Does not work on systems without /usr/src AND a read-only /usr worker.resources
dict {} NFD worker pod resources management worker.nodeSelector
dict {} NFD worker pod node selector worker.tolerations
dict {} NFD worker pod node tolerations worker.priorityClassName
string NFD worker pod priority class worker.annotations
dict {} NFD worker pod annotations worker.daemonsetAnnotations
dict {} NFD worker daemonset annotations
Topology updater parameters
Name Type Default description topologyUpdater.*
dict NFD Topology Updater configuration topologyUpdater.enable
bool false Specifies whether the NFD Topology Updater should be created topologyUpdater.createCRDs
bool false Specifies whether the NFD Topology Updater CRDs should be created topologyUpdater.serviceAccount.create
bool true Specifies whether the service account for topology updater should be created topologyUpdater.serviceAccount.annotations
dict {} Annotations to add to the service account for topology updater topologyUpdater.serviceAccount.name
string The name of the service account for topology updater to use. If not set and create is true, a name is generated using the fullname template and -topology-updater
suffix topologyUpdater.rbac.create
bool true Specifies whether to create RBAC configuration for topology updater topologyUpdater.metricsPort
integer 8081 Port on which to expose prometheus metrics topologyUpdater.kubeletConfigPath
string "" Specifies the kubelet config host path topologyUpdater.kubeletPodResourcesSockPath
string "" Specifies the kubelet sock path to read pod resources topologyUpdater.updateInterval
string 60s Time to sleep between CR updates. Non-positive value implies no CR update. topologyUpdater.watchNamespace
string *
Namespace to watch pods, *
for all namespaces topologyUpdater.podSecurityContext
dict {} PodSecurityContext holds pod-level security attributes and common container settings topologyUpdater.securityContext
dict {} Container security settings topologyUpdater.resources
dict {} Topology updater pod resources management topologyUpdater.nodeSelector
dict {} Topology updater pod node selector topologyUpdater.tolerations
dict {} Topology updater pod node tolerations topologyUpdater.annotations
dict {} Topology updater pod annotations topologyUpdater.daemonsetAnnotations
dict {} Topology updater daemonset annotations topologyUpdater.affinity
dict {} Topology updater pod affinity topologyUpdater.config
dict configuration topologyUpdater.podSetFingerprint
bool false Enables compute and report of pod fingerprint in NRT objects. topologyUpdater.kubeletStateDir
string /var/lib/kubelet Specifies kubelet state directory path for watching state and checkpoint files. Empty value disables kubelet state tracking.
Garbage collector parameters
Name Type Default description gc.*
dict NFD Garbage Collector configuration gc.enable
bool true Specifies whether the NFD Garbage Collector should be created gc.serviceAccount.create
bool true Specifies whether the service account for garbage collector should be created gc.serviceAccount.annotations
dict {} Annotations to add to the service account for garbage collector gc.serviceAccount.name
string The name of the service account for garbage collector to use. If not set and create is true, a name is generated using the fullname template and -gc
suffix gc.rbac.create
bool true Specifies whether to create RBAC configuration for garbage collector gc.interval
string 1h Time between periodic garbage collector runs gc.podSecurityContext
dict {} PodSecurityContext holds pod-level security attributes and common container settings gc.resources
dict {} Garbage collector pod resources management gc.nodeSelector
dict {} Garbage collector pod node selector gc.tolerations
dict {} Garbage collector pod node tolerations gc.annotations
dict {} Garbage collector pod annotations gc.deploymentAnnotations
dict {} Garbage collector deployment annotations gc.affinity
dict {} Garbage collector pod affinity
Node Feature Discovery v0.14
\ No newline at end of file
+
The command removes all the Kubernetes components associated with the chart and deletes the release.
In order to tailor the deployment of the Node Feature Discovery to your cluster needs We have introduced the following Chart parameters.
Name | Type | Default | description |
---|---|---|---|
image.repository | string | registry.k8s.io/nfd/node-feature-discovery | NFD image repository |
image.tag | string | v0.14.6 | NFD image tag |
image.pullPolicy | string | Always | Image pull policy |
imagePullSecrets | list | [] | ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info |
nameOverride | string | Override the name of the chart | |
fullnameOverride | string | Override a default fully qualified app name | |
tls.enable | bool | false | Specifies whether to use TLS for communications between components. NOTE: this parameter is related to the deprecated gRPC API and will be removed with it in a future release |
tls.certManager | bool | false | If enabled, requires cert-manager to be installed and will automatically create the required TLS certificates. NOTE: this parameter is related to the deprecated gRPC API and will be removed with it in a future release |
enableNodeFeatureApi | bool | true | Enable the NodeFeature CRD API for communicating node features. This will automatically disable the gRPC communication. NOTE: this parameter is related to the deprecated gRPC API and will be removed with it in a future release |
prometheus.enable | bool | false | Specifies whether to expose metrics using prometheus operator |
prometheus.labels | dict | {} | Specifies labels for use with the prometheus operator to control how it is selected |
Metrics are configured to be exposed using prometheus operator API's by default. If you want to expose metrics using the prometheus operator API's you need to install the prometheus operator in your cluster.
Name | Type | Default | description |
---|---|---|---|
master.* | dict | NFD master deployment configuration | |
master.port | integer | Specifies the TCP port that nfd-master listens for incoming requests. NOTE: this parameter is related to the deprecated gRPC API and will be removed with it in a future release | |
master.metricsPort | integer | 8081 | Port on which to expose metrics from components to prometheus operator |
master.instance | string | Instance name. Used to separate annotation namespaces for multiple parallel deployments | |
master.resyncPeriod | string | NFD API controller resync period. | |
master.extraLabelNs | array | [] | List of allowed extra label namespaces |
master.resourceLabels | array | [] | List of labels to be registered as extended resources |
master.enableTaints | bool | false | Specifies whether to enable or disable node tainting |
master.crdController | bool | null | Specifies whether the NFD CRD API controller is enabled. If not set, controller will be enabled if master.instance is empty. |
master.featureRulesController | bool | null | DEPRECATED: use master.crdController instead |
master.replicaCount | integer | 1 | Number of desired pods. This is a pointer to distinguish between explicit zero and not specified |
master.podSecurityContext | dict | {} | PodSecurityContext holds pod-level security attributes and common container settings |
master.securityContext | dict | {} | Container security settings |
master.serviceAccount.create | bool | true | Specifies whether a service account should be created |
master.serviceAccount.annotations | dict | {} | Annotations to add to the service account |
master.serviceAccount.name | string | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | |
master.rbac.create | bool | true | Specifies whether to create RBAC configuration for nfd-master |
master.service.type | string | ClusterIP | NFD master service type. NOTE: this parameter is related to the deprecated gRPC API and will be removed with it in a future release |
master.service.port | integer | 8080 | NFD master service port. NOTE: this parameter is related to the deprecated gRPC API and will be removed with it in a future release |
master.resources | dict | {} | NFD master pod resources management |
master.nodeSelector | dict | {} | NFD master pod node selector |
master.tolerations | dict | Scheduling to master node is disabled | NFD master pod tolerations |
master.annotations | dict | {} | NFD master pod annotations |
master.affinity | dict | NFD master pod required node affinity | |
master.deploymentAnnotations | dict | {} | NFD master deployment annotations |
master.nfdApiParallelism | integer | 10 | Specifies the maximum number of concurrent node updates. |
master.config | dict | NFD master configuration |
Name | Type | Default | description |
---|---|---|---|
worker.* | dict | NFD worker daemonset configuration | |
worker.metricsPort* | integer | 8081 | Port on which to expose metrics from components to prometheus operator |
worker.config | dict | NFD worker configuration | |
worker.podSecurityContext | dict | {} | PodSecurityContext holds pod-level security attributes and common container settings |
worker.securityContext | dict | {} | Container security settings |
worker.serviceAccount.create | bool | true | Specifies whether a service account for nfd-worker should be created |
worker.serviceAccount.annotations | dict | {} | Annotations to add to the service account for nfd-worker |
worker.serviceAccount.name | string | The name of the service account to use for nfd-worker. If not set and create is true, a name is generated using the fullname template (suffixed with -worker ) | |
worker.rbac.create | bool | true | Specifies whether to create RBAC configuration for nfd-worker |
worker.mountUsrSrc | bool | false | Specifies whether to allow users to mount the hostpath /user/src. Does not work on systems without /usr/src AND a read-only /usr |
worker.resources | dict | {} | NFD worker pod resources management |
worker.nodeSelector | dict | {} | NFD worker pod node selector |
worker.tolerations | dict | {} | NFD worker pod node tolerations |
worker.priorityClassName | string | NFD worker pod priority class | |
worker.annotations | dict | {} | NFD worker pod annotations |
worker.daemonsetAnnotations | dict | {} | NFD worker daemonset annotations |
Name | Type | Default | description |
---|---|---|---|
topologyUpdater.* | dict | NFD Topology Updater configuration | |
topologyUpdater.enable | bool | false | Specifies whether the NFD Topology Updater should be created |
topologyUpdater.createCRDs | bool | false | Specifies whether the NFD Topology Updater CRDs should be created |
topologyUpdater.serviceAccount.create | bool | true | Specifies whether the service account for topology updater should be created |
topologyUpdater.serviceAccount.annotations | dict | {} | Annotations to add to the service account for topology updater |
topologyUpdater.serviceAccount.name | string | The name of the service account for topology updater to use. If not set and create is true, a name is generated using the fullname template and -topology-updater suffix | |
topologyUpdater.rbac.create | bool | true | Specifies whether to create RBAC configuration for topology updater |
topologyUpdater.metricsPort | integer | 8081 | Port on which to expose prometheus metrics |
topologyUpdater.kubeletConfigPath | string | "" | Specifies the kubelet config host path |
topologyUpdater.kubeletPodResourcesSockPath | string | "" | Specifies the kubelet sock path to read pod resources |
topologyUpdater.updateInterval | string | 60s | Time to sleep between CR updates. Non-positive value implies no CR update. |
topologyUpdater.watchNamespace | string | * | Namespace to watch pods, * for all namespaces |
topologyUpdater.podSecurityContext | dict | {} | PodSecurityContext holds pod-level security attributes and common container settings |
topologyUpdater.securityContext | dict | {} | Container security settings |
topologyUpdater.resources | dict | {} | Topology updater pod resources management |
topologyUpdater.nodeSelector | dict | {} | Topology updater pod node selector |
topologyUpdater.tolerations | dict | {} | Topology updater pod node tolerations |
topologyUpdater.annotations | dict | {} | Topology updater pod annotations |
topologyUpdater.daemonsetAnnotations | dict | {} | Topology updater daemonset annotations |
topologyUpdater.affinity | dict | {} | Topology updater pod affinity |
topologyUpdater.config | dict | configuration | |
topologyUpdater.podSetFingerprint | bool | false | Enables compute and report of pod fingerprint in NRT objects. |
topologyUpdater.kubeletStateDir | string | /var/lib/kubelet | Specifies kubelet state directory path for watching state and checkpoint files. Empty value disables kubelet state tracking. |
Name | Type | Default | description |
---|---|---|---|
gc.* | dict | NFD Garbage Collector configuration | |
gc.enable | bool | true | Specifies whether the NFD Garbage Collector should be created |
gc.serviceAccount.create | bool | true | Specifies whether the service account for garbage collector should be created |
gc.serviceAccount.annotations | dict | {} | Annotations to add to the service account for garbage collector |
gc.serviceAccount.name | string | The name of the service account for garbage collector to use. If not set and create is true, a name is generated using the fullname template and -gc suffix | |
gc.rbac.create | bool | true | Specifies whether to create RBAC configuration for garbage collector |
gc.interval | string | 1h | Time between periodic garbage collector runs |
gc.podSecurityContext | dict | {} | PodSecurityContext holds pod-level security attributes and common container settings |
gc.resources | dict | {} | Garbage collector pod resources management |
gc.nodeSelector | dict | {} | Garbage collector pod node selector |
gc.tolerations | dict | {} | Garbage collector pod node tolerations |
gc.annotations | dict | {} | Garbage collector pod annotations |
gc.deploymentAnnotations | dict | {} | Garbage collector deployment annotations |
gc.affinity | dict | {} | Garbage collector pod affinity |
NFD currently offers two variants of the container image. The "minimal" variant is currently deployed by default. Released container images are available for x86_64 and Arm64 architectures.
This is a minimal image based on gcr.io/distroless/base and only supports running statically linked binaries.
For backwards compatibility a container image tag with suffix -minimal
(e.g. registry.k8s.io/nfd/node-feature-discovery:v0.14.6-minimal
) is provided.
This image is based on debian:bullseye-slim and contains a full Linux system for running shell-based nfd-worker hooks and doing live debugging and diagnosis of the NFD images.
The container image tag has suffix -full
(e.g. registry.k8s.io/nfd/node-feature-discovery:v0.14.6-full
).
NFD currently offers two variants of the container image. The "minimal" variant is currently deployed by default. Released container images are available for x86_64 and Arm64 architectures.
This is a minimal image based on gcr.io/distroless/base and only supports running statically linked binaries.
For backwards compatibility a container image tag with suffix -minimal
(e.g. registry.k8s.io/nfd/node-feature-discovery:v0.14.6-minimal
) is provided.
This image is based on debian:bullseye-slim and contains a full Linux system for running shell-based nfd-worker hooks and doing live debugging and diagnosis of the NFD images.
The container image tag has suffix -full
(e.g. registry.k8s.io/nfd/node-feature-discovery:v0.14.6-full
).
Node Feature Discovery can be deployed on any recent version of Kubernetes (v1.21+).
See Image variants for description of the different NFD container images available.
Using Kustomize provides straightforward deployment with kubectl
integration and declarative customization.
Using Helm provides easy management of NFD deployments with nice configuration management and easy upgrades.
Using Operator provides deployment and configuration management via CRDs.
Node Feature Discovery can be deployed on any recent version of Kubernetes (v1.21+).
See Image variants for description of the different NFD container images available.
Using Kustomize provides straightforward deployment with kubectl
integration and declarative customization.
Using Helm provides easy management of NFD deployments with nice configuration management and easy upgrades.
Using Operator provides deployment and configuration management via CRDs.
Kustomize provides easy deployment of NFD. Customization of the deployment is done by maintaining declarative overlays on top of the base overlays in NFD.
To follow the deployment instructions here, kubectl v1.21 or later is required.
The kustomize overlays provided in the repo can be used directly:
kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.14.6
+ Kustomize · Node Feature Discovery This documentation is for a Node Feature Discovery version that is no longer supported. Please upgrade and visit the documentation of the latest stable release.
Deployment with Kustomize
Table of contents
Kustomize provides easy deployment of NFD. Customization of the deployment is done by maintaining declarative overlays on top of the base overlays in NFD.
To follow the deployment instructions here, kubectl v1.21 or later is required.
The kustomize overlays provided in the repo can be used directly:
kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.14.6
This will required RBAC rules and deploy nfd-master (as a deployment) and nfd-worker (as daemonset) in the node-feature-discovery
namespace.
NOTE: nfd-topology-updater is not deployed as part of the default
overlay. Please refer to the Master Worker Topologyupdater and Topologyupdater below.
Alternatively you can clone the repository and customize the deployment by creating your own overlays. For example, to deploy the minimal image. See kustomize for more information about managing deployment configurations.
Overlays
The NFD repository hosts a set of overlays for different usages and deployment scenarios under deployment/overlays
default
: default deployment of nfd-worker as a daemonset, described above default-combined
see Master-worker pod below default-job
: see Worker one-shot below master-worker-topologyupdater
: see Master Worker Topologyupdater below topologyupdater
: see Topology Updater below Metrics
: see Metrics below prune
: clean up the cluster after uninstallation, see Removing feature labels samples/cert-manager
: an example for supplementing the default deployment with cert-manager for TLS authentication, see Automated TLS certificate management using cert-manager for details samples/custom-rules
: an example for spicing up the default deployment with a separately managed configmap of custom labeling rules, see Custom feature source for more information about custom node labels
Master-worker pod
You can also run nfd-master and nfd-worker inside the same pod
kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default-combined?ref=v0.14.6
This creates a DaemonSet that runs nfd-worker and nfd-master in the same Pod. In this case no nfd-master is run on the master node(s), but, the worker nodes are able to label themselves which may be desirable e.g. in single-node setups.
NOTE: nfd-topology-updater is not deployed by the default-combined overlay. To enable nfd-topology-updater in this scenario,the users must customize the deployment themselves.
Worker one-shot
Feature discovery can alternatively be configured as a one-shot job. The default-job
overlay may be used to achieve this:
NUM_NODES=$(kubectl get no -o jsonpath='{.items[*].metadata.name}' | wc -w)
@@ -23,4 +23,4 @@ kubectl -n $NFD_NS delete svc nf
kubectl -n $NFD_NS delete sa nfd-master
kubectl delete clusterrole nfd-master
kubectl delete clusterrolebinding nfd-master
-
Node Feature Discovery v0.14
\ No newline at end of file
+
Metrics are configured to be exposed using prometheus operator API's by default. If you want to expose metrics using the prometheus operator API's you need to install the prometheus operator in your cluster. By default NFD Master and Worker expose metrics on port 8081.
The exposed metrics are
Metric | Type | Description |
---|---|---|
nfd_master_build_info | Gauge | Version from which nfd-master was built |
nfd_worker_build_info | Gauge | Version from which nfd-worker was built |
nfd_topology_updater_build_info | Gauge | Version from which nfd-topology-updater was built |
nfd_node_update_requests_total | Counter | Number of node update requests received by the master over gRPC |
nfd_node_updates_total | Counter | Number of nodes updated |
nfd_node_update_failures_total | Counter | Number of nodes update failures |
nfd_node_labels_rejected_total | Counter | Number of nodes labels rejected by nfd-master |
nfd_node_extendedresources_rejected_total | Counter | Number of nodes extended resources rejected by nfd-master |
nfd_node_taints_rejected_total | Counter | Number of nodes taints rejected by nfd-master |
nfd_nodefeaturerule_processing_duration_seconds | Histogram | Time taken to process NodeFeatureRule objects |
nfd_nodefeaturerule_processing_errors_total | Counter | Number or errors encountered while processing NodeFeatureRule objects |
nfd_feature_discovery_duration_seconds | Histogram | Time taken to discover features on a node |
nfd_topology_updater_scan_errors_total | Counter | Number of errors in scanning resource allocation of pods. |
To deploy NFD with metrics enabled using kustomize, you can use the Metrics Overlay.
By default metrics are enabled when deploying NFD via Helm. To enable Prometheus to scrape metrics from NFD, you need to pass the following values to Helm:
--set prometheus.enable=true
-
For more info on Helm deployment, see Helm.
We recommend setting --set prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues=false
when deploying prometheus-operator via Helm to enable the prometheus-operator to scrape metrics from any PodMonitor.
or setting labels on the PodMonitor via the helm parameter prometheus.labels
to control which Prometheus instances will scrape this PodMonitor.
Metrics are configured to be exposed using prometheus operator API's by default. If you want to expose metrics using the prometheus operator API's you need to install the prometheus operator in your cluster. By default NFD Master and Worker expose metrics on port 8081.
The exposed metrics are
Metric | Type | Description |
---|---|---|
nfd_master_build_info | Gauge | Version from which nfd-master was built |
nfd_worker_build_info | Gauge | Version from which nfd-worker was built |
nfd_topology_updater_build_info | Gauge | Version from which nfd-topology-updater was built |
nfd_node_update_requests_total | Counter | Number of node update requests received by the master over gRPC |
nfd_node_updates_total | Counter | Number of nodes updated |
nfd_node_update_failures_total | Counter | Number of nodes update failures |
nfd_node_labels_rejected_total | Counter | Number of nodes labels rejected by nfd-master |
nfd_node_extendedresources_rejected_total | Counter | Number of nodes extended resources rejected by nfd-master |
nfd_node_taints_rejected_total | Counter | Number of nodes taints rejected by nfd-master |
nfd_nodefeaturerule_processing_duration_seconds | Histogram | Time taken to process NodeFeatureRule objects |
nfd_nodefeaturerule_processing_errors_total | Counter | Number or errors encountered while processing NodeFeatureRule objects |
nfd_feature_discovery_duration_seconds | Histogram | Time taken to discover features on a node |
nfd_topology_updater_scan_errors_total | Counter | Number of errors in scanning resource allocation of pods. |
To deploy NFD with metrics enabled using kustomize, you can use the Metrics Overlay.
By default metrics are enabled when deploying NFD via Helm. To enable Prometheus to scrape metrics from NFD, you need to pass the following values to Helm:
--set prometheus.enable=true
+
For more info on Helm deployment, see Helm.
We recommend setting --set prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues=false
when deploying prometheus-operator via Helm to enable the prometheus-operator to scrape metrics from any PodMonitor.
or setting labels on the PodMonitor via the helm parameter prometheus.labels
to control which Prometheus instances will scrape this PodMonitor.
The Node Feature Discovery Operator automates installation, configuration and updates of NFD using a specific NodeFeatureDiscovery custom resource. This also provides good support for managing NFD as a dependency of other operators.
Deployment using the Node Feature Discovery Operator is recommended to be done via operatorhub.io.
Install the operator:
kubectl create -f https://operatorhub.io/install/nfd-operator.yaml
+ NFD Operator · Node Feature Discovery This documentation is for a Node Feature Discovery version that is no longer supported. Please upgrade and visit the documentation of the latest stable release.
Deployment with NFD Operator
Table of contents
The Node Feature Discovery Operator automates installation, configuration and updates of NFD using a specific NodeFeatureDiscovery custom resource. This also provides good support for managing NFD as a dependency of other operators.
Deployment
Deployment using the Node Feature Discovery Operator is recommended to be done via operatorhub.io.
- You need to have OLM installed. If you don't, take a look at the latest release for detailed instructions.
-
Install the operator:
kubectl create -f https://operatorhub.io/install/nfd-operator.yaml
-
Create NodeFeatureDiscovery
object (in nfd
namespace here):
cat << EOF | kubectl apply -f -
apiVersion: v1
kind: Namespace
@@ -18,4 +18,4 @@ spec:
In order to deploy the minimal image you need to use
image: registry.k8s.io/nfd/node-feature-discovery:v0.14.6-minimal
in the NodeFeatureDiscovery
object above.
Uninstallation
If you followed the deployment instructions above you can simply do:
kubectl -n nfd delete NodeFeatureDiscovery my-nfd-deployment
Optionally, you can also remove the namespace:
kubectl delete ns nfd
-
See the node-feature-discovery-operator and OLM project documentation for instructions for uninstalling the operator and operator lifecycle manager, respectively.
Node Feature Discovery v0.14
\ No newline at end of file
+
See the node-feature-discovery-operator and OLM project documentation for instructions for uninstalling the operator and operator lifecycle manager, respectively.
DEPRECATED: this section only applies when the gRPC API is used, i.e. when the NodeFeature API is disabled via the
-enable-nodefeature-api=false
flag on both nfd-master and nfd-worker. The gRPC API is deprecated and will be removed in a future release.
NFD supports mutual TLS authentication between the nfd-master and nfd-worker instances. That is, nfd-worker and nfd-master both verify that the other end presents a valid certificate.
TLS authentication is enabled by specifying -ca-file
, -key-file
and -cert-file
args, on both the nfd-master and nfd-worker instances. The template specs provided with NFD contain (commented out) example configuration for enabling TLS authentication.
The Common Name (CN) of the nfd-master certificate must match the DNS name of the nfd-master Service of the cluster. By default, nfd-master only check that the nfd-worker has been signed by the specified root certificate (-ca-file).
Additional hardening can be enabled by specifying -verify-node-name
in nfd-master args, in which case nfd-master verifies that the NodeName presented by nfd-worker matches the Common Name (CN) or a Subject Alternative Name (SAN) of its certificate. Note that -verify-node-name
complicates certificate management and is not yet supported in the helm or kustomize deployment methods.
cert-manager can be used to automate certificate management between nfd-master and the nfd-worker pods.
The NFD source code repository contains an example kustomize overlay and helm chart that can be used to deploy NFD with cert-manager supplied certificates enabled.
To install cert-manager
itself can be done as easily as this, below, or you can refer to their documentation for other installation methods such as the helm chart they provide.
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.6.1/cert-manager.yaml
+ TLS authentication · Node Feature Discovery This documentation is for a Node Feature Discovery version that is no longer supported. Please upgrade and visit the documentation of the latest stable release.
Communication security with TLS
Table of contents
DEPRECATED: this section only applies when the gRPC API is used, i.e. when the NodeFeature API is disabled via the -enable-nodefeature-api=false
flag on both nfd-master and nfd-worker. The gRPC API is deprecated and will be removed in a future release.
NFD supports mutual TLS authentication between the nfd-master and nfd-worker instances. That is, nfd-worker and nfd-master both verify that the other end presents a valid certificate.
TLS authentication is enabled by specifying -ca-file
, -key-file
and -cert-file
args, on both the nfd-master and nfd-worker instances. The template specs provided with NFD contain (commented out) example configuration for enabling TLS authentication.
The Common Name (CN) of the nfd-master certificate must match the DNS name of the nfd-master Service of the cluster. By default, nfd-master only check that the nfd-worker has been signed by the specified root certificate (-ca-file).
Additional hardening can be enabled by specifying -verify-node-name
in nfd-master args, in which case nfd-master verifies that the NodeName presented by nfd-worker matches the Common Name (CN) or a Subject Alternative Name (SAN) of its certificate. Note that -verify-node-name
complicates certificate management and is not yet supported in the helm or kustomize deployment methods.
Automated TLS certificate management using cert-manager
cert-manager can be used to automate certificate management between nfd-master and the nfd-worker pods.
The NFD source code repository contains an example kustomize overlay and helm chart that can be used to deploy NFD with cert-manager supplied certificates enabled.
To install cert-manager
itself can be done as easily as this, below, or you can refer to their documentation for other installation methods such as the helm chart they provide.
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.6.1/cert-manager.yaml
To use the kustomize overlay to install node-feature-discovery with TLS enabled, you may use the following:
kubectl apply -k deployment/overlays/samples/cert-manager
To make use of the helm chart, override values.yaml
to enable both the tls.enabled
and tls.certManager
options. Note that if you do not enable tls.certManager
, helm will successfully install the application, but deployment will wait until certificates are manually created, as demonstrated below.
See the sample installation commands in the Helm Deployment and Configuration sections above for how to either override individual values, or provide a yaml file with which to override default values.
Manual TLS certificate management
If you do not with to make use of cert-manager, the certificates can be manually created and stored as secrets within the NFD namespace.
Create a CA certificate
openssl req -x509 -newkey rsa:4096 -keyout ca.key -nodes \
-subj "/CN=nfd-ca" -days 10000 -out ca.crt
@@ -78,4 +78,4 @@ data:
EOF
done
-
Node Feature Discovery v0.14
\ No newline at end of file
+
Follow the uninstallation instructions of the deployment method used (kustomize, helm or operator).
NFD-Master has a special -prune
command line flag for removing all nfd-related node labels, annotations, extended resources and taints from the cluster.
kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/prune?ref=v0.14.6
+ Uninstallation · Node Feature Discovery This documentation is for a Node Feature Discovery version that is no longer supported. Please upgrade and visit the documentation of the latest stable release.
Uninstallation
Follow the uninstallation instructions of the deployment method used (kustomize, helm or operator).
Removing feature labels
NFD-Master has a special -prune
command line flag for removing all nfd-related node labels, annotations, extended resources and taints from the cluster.
kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/prune?ref=v0.14.6
kubectl -n node-feature-discovery wait job.batch/nfd-master --for=condition=complete && \
kubectl delete -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/prune?ref=v0.14.6
-
NOTE: You must run prune before removing the RBAC rules (serviceaccount, clusterrole and clusterrolebinding).
Node Feature Discovery v0.14
\ No newline at end of file
+
NOTE: You must run prune before removing the RBAC rules (serviceaccount, clusterrole and clusterrolebinding).
git clone https://github.com/kubernetes-sigs/node-feature-discovery
+ Developer guide · Node Feature Discovery This documentation is for a Node Feature Discovery version that is no longer supported. Please upgrade and visit the documentation of the latest stable release.
Developer guide
Table of contents
Building from source
Download the source code
git clone https://github.com/kubernetes-sigs/node-feature-discovery
cd node-feature-discovery
Docker build
Build the container image
See customizing the build below for altering the container image registry, for example.
make
Push the container image
Optional, this example with Docker.
docker push <IMAGE_TAG>
@@ -27,4 +27,4 @@ kubectl apply -k .
tilt up
This will override the default value(master
) of IMAGE_TAG_NAME
variable defined in the Tiltfile.
Documentation
All documentation resides under the docs directory in the source tree. It is designed to be served as a html site by GitHub Pages.
Building the documentation is containerized in order to fix the build environment. The recommended way for developing documentation is to run:
make site-serve
This will build the documentation in a container and serve it under localhost:4000/ making it easy to verify the results. Any changes made to the docs/
will automatically re-trigger a rebuild and are reflected in the served content and can be inspected with a simple browser refresh.
In order to just build the html documentation run:
make site-build
-
This will generate html documentation under docs/_site/
.
Node Feature Discovery v0.14
\ No newline at end of file
+
This will generate html documentation under docs/_site/
.
Welcome to Node Feature Discovery – a Kubernetes add-on for detecting hardware features and system configuration!
Continue to:
Introduction for more details on the project.
Quick start for quick step-by-step instructions on how to get NFD running on your cluster.
$ kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.14.6
+ Get started · Node Feature Discovery This documentation is for a Node Feature Discovery version that is no longer supported. Please upgrade and visit the documentation of the latest stable release.
Node Feature Discovery
Welcome to Node Feature Discovery – a Kubernetes add-on for detecting hardware features and system configuration!
Continue to:
-
Introduction for more details on the project.
-
Quick start for quick step-by-step instructions on how to get NFD running on your cluster.
Quick-start – the short-short version
$ kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.14.6
namespace/node-feature-discovery created
serviceaccount/nfd-master created
clusterrole.rbac.authorization.k8s.io/nfd-master created
@@ -22,4 +22,4 @@
"feature.node.kubernetes.io/cpu-cpuid.AESNI": "true",
...
-
Node Feature Discovery v0.14
\ No newline at end of file
+
This software enables node feature discovery for Kubernetes. It detects hardware features available on each node in a Kubernetes cluster, and advertises those features using node labels and optionally node extended resources and node taints. Node Feature Discovery is compatible with any recent version of Kubernetes (v1.21+).
NFD consists of four software components:
NFD-Master is the daemon responsible for communication towards the Kubernetes API. That is, it receives labeling requests from the worker and modifies node objects accordingly.
NFD-Worker is a daemon responsible for feature detection. It then communicates 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,
NFD-Topology-Updater is a daemon responsible for examining allocated resources on a worker node to account for resources available to be allocated to new pod on a per-zone basis (where a zone can be a NUMA node). It then creates or updates a NodeResourceTopology custom resource object specific to this node. One instance of nfd-topology-updater is supposed to be running on each node of the cluster.
NFD-GC is a daemon responsible for cleaning obsolete NodeFeature and NodeResourceTopology objects.
One instance of nfd-gc is supposed to be running in the cluster.
Feature discovery is divided into domain-specific feature sources:
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:
{
+ Introduction · Node Feature Discovery This documentation is for a Node Feature Discovery version that is no longer supported. Please upgrade and visit the documentation of the latest stable release.
Introduction
Table of contents
- NFD-Master
- NFD-Worker
- NFD-Topology-Updater
- NFD-GC
- Feature Discovery
- Node annotations
- Custom resources
This software enables node feature discovery for Kubernetes. It detects hardware features available on each node in a Kubernetes cluster, and advertises those features using node labels and optionally node extended resources and node taints. Node Feature Discovery is compatible with any recent version of Kubernetes (v1.21+).
NFD consists of four software components:
- nfd-master
- nfd-worker
- nfd-topology-updater
- nfd-gc
NFD-Master
NFD-Master is the daemon responsible for communication towards the Kubernetes API. That is, it receives labeling requests from the worker and modifies node objects accordingly.
NFD-Worker
NFD-Worker is a daemon responsible for feature detection. It then communicates 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,
NFD-Topology-Updater
NFD-Topology-Updater is a daemon responsible for examining allocated resources on a worker node to account for resources available to be allocated to new pod on a per-zone basis (where a zone can be a NUMA node). It then creates or updates a NodeResourceTopology custom resource object specific to this node. One instance of nfd-topology-updater is supposed to be running on each node of the cluster.
NFD-GC
NFD-GC is a daemon responsible for cleaning obsolete NodeFeature and NodeResourceTopology objects.
One instance of nfd-gc is supposed to be running in the cluster.
Feature Discovery
Feature discovery is divided into domain-specific feature sources:
- 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:
{
"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>",
@@ -10,4 +10,4 @@
"feature.node.kubernetes.io/usb-<device label>.present": "<feature value>",
"feature.node.kubernetes.io/<file name>-<feature name>": "<feature value>"
}
-
Node annotations
NFD also annotates nodes it is running on:
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.
NOTE: the -instance
command line flag affects the annotation names
Unapplicable annotations are not created, i.e. for example master.version is only created on nodes running nfd-master.
Custom resources
NFD takes use of some Kubernetes Custom Resources.
NodeFeatures is be used for representing node features and requesting node labels to be generated.
NFD-Master uses NodeFeatureRules for custom labeling of nodes.
NFD-Topology-Updater creates NodeResourceTopology objects that describe the hardware topology of node resources.
Node Feature Discovery v0.14
\ No newline at end of file
+
NFD also annotates nodes it is running on:
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. |
NOTE: the
-instance
command line flag affects the annotation names
Unapplicable annotations are not created, i.e. for example master.version is only created on nodes running nfd-master.
NFD takes use of some Kubernetes Custom Resources.
NodeFeatures is be used for representing node features and requesting node labels to be generated.
NFD-Master uses NodeFeatureRules for custom labeling of nodes.
NFD-Topology-Updater creates NodeResourceTopology objects that describe the hardware topology of node resources.
Minimal steps to deploy latest released version of NFD in your cluster.
Deploy with kustomize – creates a new namespace, service and required RBAC rules and deploys nfd-master and nfd-worker daemons.
kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.14.6
+ Quick start · Node Feature Discovery This documentation is for a Node Feature Discovery version that is no longer supported. Please upgrade and visit the documentation of the latest stable release.
Quick start
Minimal steps to deploy latest released version of NFD in your cluster.
Installation
Deploy with kustomize – creates a new namespace, service and required RBAC rules and deploys nfd-master and nfd-worker daemons.
kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.14.6
Verify
Wait until NFD master and NFD worker are running.
$ kubectl -n node-feature-discovery get ds,deploy
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
daemonset.apps/nfd-worker 2 2 2 2 2 <none> 10s
@@ -40,4 +40,4 @@ daemonset.apps/nfd-topology-updater 2 2 2 2 2
NAME AGE
kind-control-plane 23s
kind-worker 23s
-
Node Feature Discovery v0.14
\ No newline at end of file
+
To quickly view available command line flags execute nfd-gc -help
. In a docker container:
docker run registry.k8s.io/nfd/node-feature-discovery:v0.14.6 \
+ Garbage Collector Cmdline Reference · Node Feature Discovery This documentation is for a Node Feature Discovery version that is no longer supported. Please upgrade and visit the documentation of the latest stable release.
NFD-GC Commandline Flags
Table of Contents
To quickly view available command line flags execute nfd-gc -help
. In a docker container:
docker run registry.k8s.io/nfd/node-feature-discovery:v0.14.6 \
nfd-gc -help
-h, -help
Print usage and exit.
-version
Print version and exit.
-gc-interval
The -gc-interval
specifies the interval between periodic garbage collector runs.
Default: 1h
Example:
nfd-gc -gc-interval=1h
-
Node Feature Discovery v0.14
\ No newline at end of file
+
Command line and configuration reference.
Command line and configuration reference.
To quickly view available command line flags execute nfd-master -help
. In a docker container:
docker run registry.k8s.io/nfd/node-feature-discovery:v0.14.6 nfd-master -help
+ Master cmdline reference · Node Feature Discovery This documentation is for a Node Feature Discovery version that is no longer supported. Please upgrade and visit the documentation of the latest stable release.
Commandline flags of nfd-master
Table of contents
- -h, -help
- -version
- -prune
- -port
- -metrics
- -instance
- -ca-file
- -cert-file
- -key-file
- -verify-node-name
- -enable-nodefeature-api
- -enable-leader-election
- -enable-taints
- -no-publish
- -crd-controller
- -featurerules-controller
- -label-whitelist
- -extra-label-ns
- -deny-label-ns
- -resource-labels
- -config
- -options
- -nfd-api-parallelism
- Logging
- -resync-period
To quickly view available command line flags execute nfd-master -help
. In a docker container:
docker run registry.k8s.io/nfd/node-feature-discovery:v0.14.6 nfd-master -help
-h, -help
Print usage and exit.
-version
Print version and exit.
-prune
The -prune
flag is a sub-command like option for cleaning up the cluster. It causes nfd-master to remove all NFD related labels, annotations and extended resources from all Node objects of the cluster and exit.
-port
The -port
flag specifies the TCP port that nfd-master listens for incoming requests.
Default: 8080
Example:
nfd-master -port=443
-metrics
The -metrics
flag specifies the port on which to expose Prometheus metrics. Setting this to 0 disables the metrics server on nfd-master.
Default: 8081
Example:
nfd-master -metrics=12345
-instance
The -instance
flag makes it possible to run multiple NFD deployments in parallel. In practice, it separates the node annotations between deployments so that each of them can store metadata independently. The instance name must start and end with an alphanumeric character and may only contain alphanumeric characters, -
, _
or .
.
Default: empty
Example:
nfd-master -instance=network
@@ -20,4 +20,4 @@
-options
The -options
flag may be used to specify and override configuration file options directly from the command line. The required format is the same as in the config file i.e. JSON or YAML. Configuration options specified via this flag will override those from the configuration file:
Default: empty
Example:
nfd-master -options='{"noPublish": true}'
-nfd-api-parallelism
The -nfd-api-parallelism
flag can be used to specify the maximum number of concurrent node updates.
It takes effect only when -enable-nodefeature-api
has been set.
Default: 10
Example:
nfd-master -nfd-api-parallelism=1
Logging
The following logging-related flags are inherited from the klog package.
-add_dir_header
If true, adds the file directory to the header of the log messages.
Default: false
-alsologtostderr
Log to standard error as well as files.
Default: false
-log_backtrace_at
When logging hits line file:N, emit a stack trace.
Default: empty
-log_dir
If non-empty, write log files in this directory.
Default: empty
-log_file
If non-empty, use this log file.
Default: empty
-log_file_max_size
Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited.
Default: 1800
-logtostderr
Log to standard error instead of files
Default: true
-skip_headers
If true, avoid header prefixes in the log messages.
Default: false
-skip_log_headers
If true, avoid headers when opening log files.
Default: false
-stderrthreshold
Logs at or above this threshold go to stderr.
Default: 2
-v
Number for the log level verbosity.
Default: 0
-vmodule
Comma-separated list of pattern=N
settings for file-filtered logging.
Default: empty
-resync-period
The -resync-period
flag specifies the NFD API controller resync period. The resync means nfd-master replaying all NodeFeature and NodeFeatureRule objects, thus effectively re-syncing all nodes in the cluster (i.e. ensuring labels, annotations, extended resources and taints are in place). Only has effect when the NodeFeature CRD API has been enabled with -enable-nodefeature-api
.
Default: 1 hour.
Example:
nfd-master -resync-period=2h
-
Node Feature Discovery v0.14
\ No newline at end of file
+
See the sample configuration file for a full example configuration.
noPublish
option disables updates to the Node objects in the Kubernetes API server, making a "dry-run" flag for nfd-master. No Labels, Annotations, Taints or ExtendedResources of nodes are updated.
Default: false
Example:
noPublish: true
+ Master config reference · Node Feature Discovery This documentation is for a Node Feature Discovery version that is no longer supported. Please upgrade and visit the documentation of the latest stable release.
Configuration file reference of nfd-master
Table of contents
- noPublish
- extraLabelNs
- denyLabelNs
- resourceLabels
- enableTaints
- labelWhiteList
- resyncPeriod
- leaderElection
- nfdApiParallelism
- klog
See the sample configuration file for a full example configuration.
noPublish
noPublish
option disables updates to the Node objects in the Kubernetes API server, making a "dry-run" flag for nfd-master. No Labels, Annotations, Taints or ExtendedResources of nodes are updated.
Default: false
Example:
noPublish: true
extraLabelNs
extraLabelNs
specifies a list of allowed feature label namespaces. This option can be used to allow other vendor or application specific namespaces for custom labels from the local and custom feature sources, even though these labels were denied using the denyLabelNs
parameter.
The same namespace control and this option applies to Extended Resources (created with resourceLabels
), too.
Default: empty
Example:
extraLabelNs: ["added.ns.io","added.kubernets.io"]
denyLabelNs
denyLabelNs
specifies a list of excluded label namespaces. By default, nfd-master allows creating labels in all namespaces, excluding kubernetes.io
namespace and its sub-namespaces (i.e. *.kubernetes.io
). However, you should note that kubernetes.io
and its sub-namespaces are always denied. This option can be used to exclude some vendors or application specific namespaces. Note that the namespaces feature.node.kubernetes.io
and profile.node.kubernetes.io
and their sub-namespaces are always allowed and cannot be denied.
Default: empty
Example:
denyLabelNs: ["denied.ns.io","denied.kubernetes.io"]
resourceLabels
DEPRECATED: NodeFeatureRule should be used for managing extended resources in NFD.
The resourceLabels
option specifies a list of features to be advertised as extended resources instead of labels. Features that have integer values can be published as Extended Resources by listing them in this option.
Default: empty
Example:
resourceLabels: ["vendor-1.com/feature-1","vendor-2.io/feature-2"]
@@ -12,4 +12,4 @@
leaderElection.retryPeriod
leaderElection.retryPeriod
is the duration the LeaderElector clients should wait between tries of actions.
It has to be greater than 0.
Default: 2 seconds.
Example:
leaderElection:
retryPeriod: 2s
nfdApiParallelism
The nfdApiParallelism
option can be used to specify the maximum number of concurrent node updates.
It takes effect only when -enable-nodefeature-api
has been set.
Default: 10
Example:
nfdApiParallelism: 1
-
klog
The following options specify the logger configuration. Most of which can be dynamically adjusted at run-time.
NOTE: The logger options can also be specified via command line flags which take precedence over any corresponding config file options.
klog.addDirHeader
If true, adds the file directory to the header of the log messages.
Default: false
Run-time configurable: yes
klog.alsologtostderr
Log to standard error as well as files.
Default: false
Run-time configurable: yes
klog.logBacktraceAt
When logging hits line file:N, emit a stack trace.
Default: empty
Run-time configurable: yes
klog.logDir
If non-empty, write log files in this directory.
Default: empty
Run-time configurable: no
klog.logFile
If non-empty, use this log file.
Default: empty
Run-time configurable: no
klog.logFileMaxSize
Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited.
Default: 1800
Run-time configurable: no
klog.logtostderr
Log to standard error instead of files
Default: true
Run-time configurable: yes
klog.skipHeaders
If true, avoid header prefixes in the log messages.
Default: false
Run-time configurable: yes
klog.skipLogHeaders
If true, avoid headers when opening log files.
Default: false
Run-time configurable: no
klog.stderrthreshold
Logs at or above this threshold go to stderr (default 2)
Run-time configurable: yes
klog.v
Number for the log level verbosity.
Default: 0
Run-time configurable: yes
klog.vmodule
Comma-separated list of pattern=N
settings for file-filtered logging.
Default: empty
Run-time configurable: yes
Node Feature Discovery v0.14
\ No newline at end of file
+
The following options specify the logger configuration. Most of which can be dynamically adjusted at run-time.
NOTE: The logger options can also be specified via command line flags which take precedence over any corresponding config file options.
If true, adds the file directory to the header of the log messages.
Default: false
Run-time configurable: yes
Log to standard error as well as files.
Default: false
Run-time configurable: yes
When logging hits line file:N, emit a stack trace.
Default: empty
Run-time configurable: yes
If non-empty, write log files in this directory.
Default: empty
Run-time configurable: no
If non-empty, use this log file.
Default: empty
Run-time configurable: no
Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited.
Default: 1800
Run-time configurable: no
Log to standard error instead of files
Default: true
Run-time configurable: yes
If true, avoid header prefixes in the log messages.
Default: false
Run-time configurable: yes
If true, avoid headers when opening log files.
Default: false
Run-time configurable: no
Logs at or above this threshold go to stderr (default 2)
Run-time configurable: yes
Number for the log level verbosity.
Default: 0
Run-time configurable: yes
Comma-separated list of pattern=N
settings for file-filtered logging.
Default: empty
Run-time configurable: yes
To quickly view available command line flags execute nfd-topology-updater -help
. In a docker container:
docker run registry.k8s.io/nfd/node-feature-discovery:v0.14.6 \
+ Topology Updater Cmdline Reference · Node Feature Discovery This documentation is for a Node Feature Discovery version that is no longer supported. Please upgrade and visit the documentation of the latest stable release.
NFD-Topology-Updater Commandline Flags
Table of Contents
- -h, -help
- -version
- -config
- -no-publish
- -oneshot
- -metrics
- -sleep-interval
- -watch-namespace
- -kubelet-config-uri
- -api-auth-token-file
- -podresources-socket
- -pods-fingerprint
- -kubelet-state-dir
To quickly view available command line flags execute nfd-topology-updater -help
. In a docker container:
docker run registry.k8s.io/nfd/node-feature-discovery:v0.14.6 \
nfd-topology-updater -help
-h, -help
Print usage and exit.
-version
Print version and exit.
-config
The -config
flag specifies the path of the nfd-topology-updater configuration file to use.
Default: /etc/kubernetes/node-feature-discovery/nfd-topology-updater.conf
Example:
nfd-topology-updater -config=/opt/nfd/nfd-topology-updater.conf
-no-publish
The -no-publish
flag disables all communication with the nfd-master, making it a "dry-run" flag for nfd-topology-updater. NFD-Topology-Updater runs resource hardware topology detection normally, but no CR requests are sent to nfd-master.
Default: false
Example:
nfd-topology-updater -no-publish
@@ -11,4 +11,4 @@ nfd-topology-updater -help
-podresources-socket
The -podresources-socket
specifies the path to the Unix socket where kubelet exports a gRPC service to enable discovery of in-use CPUs and devices, and to provide metadata for them.
Default: /host-var/lib/kubelet/pod-resources/kubelet.sock
Example:
nfd-topology-updater -podresources-socket=/var/lib/kubelet/pod-resources/kubelet.sock
-pods-fingerprint
Enables compute and report the pod set fingerprint in the NRT. A pod fingerprint is a compact representation of the "node state" regarding resources.
Default: false
Example:
nfd-topology-updater -pods-fingerprint
-kubelet-state-dir
The -kubelet-state-dir
specifies the path to the Kubelet state directory, where state and checkpoint files are stored. The files are mount as read-only and cannot be change by the updater. Enabled by default. Passing an empty string will disable the watching.
Default: /host-var/lib/kubelet
Example:
nfd-topology-updater -kubelet-state-dir=/var/lib/kubelet
-
Node Feature Discovery v0.14
\ No newline at end of file
+
See the sample configuration file for a full example configuration.
The excludeList
specifies a key-value map of allocated resources that should not be examined by the topology-updater agent per node. Each key is a node name with a value as a list of resources that should not be examined by the agent for that specific node.
Default: empty
Example:
excludeList:
+ Topology-Updater config reference · Node Feature Discovery This documentation is for a Node Feature Discovery version that is no longer supported. Please upgrade and visit the documentation of the latest stable release.
Configuration file reference of nfd-topology-updater
Table of contents
See the sample configuration file for a full example configuration.
excludeList
The excludeList
specifies a key-value map of allocated resources that should not be examined by the topology-updater agent per node. Each key is a node name with a value as a list of resources that should not be examined by the agent for that specific node.
Default: empty
Example:
excludeList:
nodeA: [hugepages-2Mi]
nodeB: [memory]
nodeC: [cpu, hugepages-2Mi]
excludeList.*
excludeList.*
is a special value that use to specify all nodes. A resource that would be listed under this key, would be excluded from all nodes.
Default: empty
Example:
excludeList:
'*': [hugepages-2Mi]
-
Node Feature Discovery v0.14
\ No newline at end of file
+
Node Feature Discovery follows semantic versioning where the version number consists of three components, i.e. MAJOR.MINOR.PATCH.
The most recent two minor releases (or release branches) of Node Feature Discovery are supported. That is, with X being the latest release, X and X-1 are supported and X-1 reaches end-of-life when X+1 is released.
Built-in feature labels and features are supported for 2 releases after being deprecated, at minimum. That is, if a feature label is deprecated in version X, it will be supported in X+1 and X+2 and may be dropped in X+3.
Command-line flags and configuration file options are supported for 1 more release after being deprecated, at minimum. That is, if option/flag is deprecated in version X, it will be supported in X+1 and may be removed in X+2.
The same policy (support for 1 release after deprecation) also applies to Helm chart parameters.
Node Feature Discovery follows semantic versioning where the version number consists of three components, i.e. MAJOR.MINOR.PATCH.
The most recent two minor releases (or release branches) of Node Feature Discovery are supported. That is, with X being the latest release, X and X-1 are supported and X-1 reaches end-of-life when X+1 is released.
Built-in feature labels and features are supported for 2 releases after being deprecated, at minimum. That is, if a feature label is deprecated in version X, it will be supported in X+1 and X+2 and may be dropped in X+3.
Command-line flags and configuration file options are supported for 1 more release after being deprecated, at minimum. That is, if option/flag is deprecated in version X, it will be supported in X+1 and may be removed in X+2.
The same policy (support for 1 release after deprecation) also applies to Helm chart parameters.
To quickly view available command line flags execute nfd-worker -help
. In a docker container:
docker run registry.k8s.io/nfd/node-feature-discovery:v0.14.6 nfd-worker -help
+ Worker cmdline reference · Node Feature Discovery This documentation is for a Node Feature Discovery version that is no longer supported. Please upgrade and visit the documentation of the latest stable release.
Commandline flags of nfd-worker
Table of contents
- -h, -help
- -version
- -config
- -options
- -server
- -ca-file
- -cert-file
- -key-file
- -kubeconfig
- -server-name-override
- -feature-sources
- -label-sources
- -enable-nodefeature-api
- -metrics
- -no-publish
- -oneshot
- Logging
To quickly view available command line flags execute nfd-worker -help
. In a docker container:
docker run registry.k8s.io/nfd/node-feature-discovery:v0.14.6 nfd-worker -help
-h, -help
Print usage and exit.
-version
Print version and exit.
-config
The -config
flag specifies the path of the nfd-worker configuration file to use.
Default: /etc/kubernetes/node-feature-discovery/nfd-worker.conf
Example:
nfd-worker -config=/opt/nfd/worker.conf
-options
The -options
flag may be used to specify and override configuration file options directly from the command line. The required format is the same as in the config file i.e. JSON or YAML. Configuration options specified via this flag will override those from the configuration file:
Default: empty
Example:
nfd-worker -options='{"sources":{"cpu":{"cpuid":{"attributeWhitelist":["AVX","AVX2"]}}}}'
-server
NOTE the gRPC API is deprecated and will be removed in a future release. and this flag will be removed as well.
The -server
flag specifies the address of the nfd-master endpoint where to connect to.
Default: localhost:8080
Example:
nfd-worker -server=nfd-master.nfd.svc.cluster.local:443
@@ -13,4 +13,4 @@
-metrics
The -metrics
flag specifies the port on which to expose Prometheus metrics. Setting this to 0 disables the metrics server on nfd-worker.
Default: 8081
Example:
nfd-worker -metrics=12345
-no-publish
The -no-publish
flag disables all communication with the nfd-master and the Kubernetes API server. It is effectively a "dry-run" flag for nfd-worker. NFD-Worker runs feature detection normally, but no labeling requests are sent to nfd-master and no NodeFeature objects are created or updated in the API server.
NOTE: This flag takes precedence over the core.noPublish
configuration file option.
Default: false
Example:
nfd-worker -no-publish
-oneshot
The -oneshot
flag causes nfd-worker to exit after one pass of feature detection.
Default: false
Example:
nfd-worker -oneshot -no-publish
-
Logging
The following logging-related flags are inherited from the klog package.
NOTE: The logger setup can also be specified via the core.klog
configuration file options. However, the command line flags take precedence over any corresponding config file options specified.
-add_dir_header
If true, adds the file directory to the header of the log messages.
Default: false
-alsologtostderr
Log to standard error as well as files.
Default: false
-log_backtrace_at
When logging hits line file:N, emit a stack trace.
Default: empty
-log_dir
If non-empty, write log files in this directory.
Default: empty
-log_file
If non-empty, use this log file.
Default: empty
-log_file_max_size
Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited.
Default: 1800
-logtostderr
Log to standard error instead of files
Default: true
-skip_headers
If true, avoid header prefixes in the log messages.
Default: false
-skip_log_headers
If true, avoid headers when opening log files.
Default: false
-stderrthreshold
Logs at or above this threshold go to stderr.
Default: 2
-v
Number for the log level verbosity.
Default: 0
-vmodule
Comma-separated list of pattern=N
settings for file-filtered logging.
Default: empty
Node Feature Discovery v0.14
\ No newline at end of file
+
The following logging-related flags are inherited from the klog package.
NOTE: The logger setup can also be specified via the
core.klog
configuration file options. However, the command line flags take precedence over any corresponding config file options specified.
If true, adds the file directory to the header of the log messages.
Default: false
Log to standard error as well as files.
Default: false
When logging hits line file:N, emit a stack trace.
Default: empty
If non-empty, write log files in this directory.
Default: empty
If non-empty, use this log file.
Default: empty
Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited.
Default: 1800
Log to standard error instead of files
Default: true
If true, avoid header prefixes in the log messages.
Default: false
If true, avoid headers when opening log files.
Default: false
Logs at or above this threshold go to stderr.
Default: 2
Number for the log level verbosity.
Default: 0
Comma-separated list of pattern=N
settings for file-filtered logging.
Default: empty
See the sample configuration file for a full example configuration.
The core
section contains common configuration settings that are not specific to any particular feature source.
core.sleepInterval
specifies the interval between consecutive passes of feature (re-)detection, and thus also the interval between node re-labeling. A non-positive value implies infinite sleep interval, i.e. no re-detection or re-labeling is done.
Default: 60s
Example:
core:
+ Worker config reference · Node Feature Discovery This documentation is for a Node Feature Discovery version that is no longer supported. Please upgrade and visit the documentation of the latest stable release.
Configuration file reference of nfd-worker
Table of contents
See the sample configuration file for a full example configuration.
core
The core
section contains common configuration settings that are not specific to any particular feature source.
core.sleepInterval
core.sleepInterval
specifies the interval between consecutive passes of feature (re-)detection, and thus also the interval between node re-labeling. A non-positive value implies infinite sleep interval, i.e. no re-detection or re-labeling is done.
Default: 60s
Example:
core:
sleepInterval: 60s
core.featureSources
core.featureSources
specifies the list of enabled feature sources. A special value all
enables all sources. Prefixing a source name with -
indicates that the source will be disabled instead - this is only meaningful when used in conjunction with all
. This option allows completely disabling the feature detection so that neither standard feature labels are generated nor the raw feature data is available for custom rule processing.
Default: [all]
Example:
core:
# Enable all but cpu and local sources
@@ -68,4 +68,4 @@
matchExpressions:
class: {op: In, value: ["0200"]}
vendor: {op: In, value: ["8086"]}
-
Node Feature Discovery v0.14
\ No newline at end of file
+
NFD uses some Kubernetes custom resources.
NodeFeature is an NFD-specific custom resource for communicating node features and node labeling requests. The nfd-master pod watches for NodeFeature objects, labels nodes as specified and uses the listed features as input when evaluating NodeFeatureRules. NodeFeature objects can be used for implementing 3rd party extensions (see customization guide for more details).
apiVersion: nfd.k8s-sigs.io/v1alpha1
+ CRDs · Node Feature Discovery This documentation is for a Node Feature Discovery version that is no longer supported. Please upgrade and visit the documentation of the latest stable release.
Custom Resources
Table of contents
NFD uses some Kubernetes custom resources.
NodeFeature
NodeFeature is an NFD-specific custom resource for communicating node features and node labeling requests. The nfd-master pod watches for NodeFeature objects, labels nodes as specified and uses the listed features as input when evaluating NodeFeatureRules. NodeFeature objects can be used for implementing 3rd party extensions (see customization guide for more details).
apiVersion: nfd.k8s-sigs.io/v1alpha1
kind: NodeFeature
metadata:
labels:
@@ -77,4 +77,4 @@
capacity: 3
allocatable: 3
available: 3
-
The NodeResourceTopology objects created by NFD can be used to gain insight into the allocatable resources along with the granularity of those resources at a per-zone level (represented by node-0 and node-1 in the above example) or can be used by an external entity (e.g. topology-aware scheduler plugin) to take an action based on the gathered information.
Node Feature Discovery v0.14
\ No newline at end of file
+
The NodeResourceTopology objects created by NFD can be used to gain insight into the allocatable resources along with the granularity of those resources at a per-zone level (represented by node-0 and node-1 in the above example) or can be used by an external entity (e.g. topology-aware scheduler plugin) to take an action based on the gathered information.
NFD provides multiple extension points for vendor and application specific labeling:
NodeFeature
objects can be used to communicate "raw" node features and node labeling requests to nfd-master.NodeFeatureRule
objects provide a way to deploy custom labeling rules via the Kubernetes API.local
feature source of nfd-worker creates labels by reading text files and executing hooks.custom
feature source of nfd-worker creates labels based on user-specified rules.NodeFeature objects provide a way for 3rd party extensions to advertise custom features, both as "raw" features that serve as input to NodeFeatureRule objects and as feature labels directly.
Note that RBAC rules must be created for each extension for them to be able to create and manipulate NodeFeature objects in their namespace.
The NodeFeature CRD API can be disabled with the -enable-nodefeature-api=false
command line flag. This flag must be specified for both nfd-master and nfd-worker as it will enable the gRPC communication between them. Note that the gRPC API is DEPRECATED and will be removed in a future release, at which point the NodeFeature API cannot be disabled.
Consider the following referential example:
apiVersion: nfd.k8s-sigs.io/v1alpha1
+ Customization guide · Node Feature Discovery This documentation is for a Node Feature Discovery version that is no longer supported. Please upgrade and visit the documentation of the latest stable release.
Customization guide
Table of contents
- Overview
- NodeFeature custom resource
- NodeFeatureRule custom resource
- Local feature source
- Custom feature source
- Node labels
- Label rule format
- Legacy custom rule syntax
Overview
NFD provides multiple extension points for vendor and application specific labeling:
NodeFeature
objects can be used to communicate "raw" node features and node labeling requests to nfd-master. NodeFeatureRule
objects provide a way to deploy custom labeling rules via the Kubernetes API. local
feature source of nfd-worker creates labels by reading text files and executing hooks. custom
feature source of nfd-worker creates labels based on user-specified rules.
NodeFeature custom resource
NodeFeature objects provide a way for 3rd party extensions to advertise custom features, both as "raw" features that serve as input to NodeFeatureRule objects and as feature labels directly.
Note that RBAC rules must be created for each extension for them to be able to create and manipulate NodeFeature objects in their namespace.
The NodeFeature CRD API can be disabled with the -enable-nodefeature-api=false
command line flag. This flag must be specified for both nfd-master and nfd-worker as it will enable the gRPC communication between them. Note that the gRPC API is DEPRECATED and will be removed in a future release, at which point the NodeFeature API cannot be disabled.
A NodeFeature example
Consider the following referential example:
apiVersion: nfd.k8s-sigs.io/v1alpha1
kind: NodeFeature
metadata:
labels:
@@ -373,4 +373,4 @@ Element :An identifier of the USB attribute.
value: "datacenter-1"
matchOn:
- nodename: [ "node-datacenter1-rack.*-server.*" ]
-
In the example above:
- A node would contain the label:
feature.node.kubernetes.io/custom-my.kernel.feature=true
if the node has kmod1
AND kmod2
kernel modules loaded. - A node would contain the label:
feature.node.kubernetes.io/custom-my.pci.feature=true
if the node contains a PCI device with a PCI vendor ID of 15b3
AND PCI device ID of 1014
OR 1017
. - A node would contain the label:
feature.node.kubernetes.io/custom-my.usb.feature=true
if the node contains a USB device with a USB vendor ID of 1d6b
AND USB device ID of 0003
. - A node would contain the label:
feature.node.kubernetes.io/custom-my.combined.feature=true
if vendor_kmod1
AND vendor_kmod2
kernel modules are loaded AND the node contains a PCI device with a PCI vendor ID of 15b3
AND PCI device ID of 1014
or 1017
. - A node would contain the label:
vendor.feature.node.kubernetes.io/accumulated.feature=true
if some_kmod1
AND some_kmod2
kernel modules are loaded OR the node contains a PCI device with a PCI vendor ID of 15b3
AND PCI device ID of 1014
OR 1017
. - A node would contain the label:
feature.node.kubernetes.io/custom-my.kernel.featureneedscpu=true
if KVM_INTEL
kernel config is enabled AND the node CPU supports VMX
virtual machine extensions - A node would contain the label:
feature.node.kubernetes.io/custom-my.kernel.modulecompiler=true
if the in-tree kmod1
kernel module is loaded AND it's built with GCC_VERSION=100101
. - A node would contain the label:
profile.node.kubernetes.io/my-datacenter=datacenter-1
if the node's name matches the node-datacenter1-rack.*-server.*
pattern, e.g. node-datacenter1-rack2-server42
Node Feature Discovery v0.14
\ No newline at end of file
+
In the example above:
feature.node.kubernetes.io/custom-my.kernel.feature=true
if the node has kmod1
AND kmod2
kernel modules loaded.feature.node.kubernetes.io/custom-my.pci.feature=true
if the node contains a PCI device with a PCI vendor ID of 15b3
AND PCI device ID of 1014
OR 1017
.feature.node.kubernetes.io/custom-my.usb.feature=true
if the node contains a USB device with a USB vendor ID of 1d6b
AND USB device ID of 0003
.feature.node.kubernetes.io/custom-my.combined.feature=true
if vendor_kmod1
AND vendor_kmod2
kernel modules are loaded AND the node contains a PCI device with a PCI vendor ID of 15b3
AND PCI device ID of 1014
or 1017
.vendor.feature.node.kubernetes.io/accumulated.feature=true
if some_kmod1
AND some_kmod2
kernel modules are loaded OR the node contains a PCI device with a PCI vendor ID of 15b3
AND PCI device ID of 1014
OR 1017
.feature.node.kubernetes.io/custom-my.kernel.featureneedscpu=true
if KVM_INTEL
kernel config is enabled AND the node CPU supports VMX
virtual machine extensionsfeature.node.kubernetes.io/custom-my.kernel.modulecompiler=true
if the in-tree kmod1
kernel module is loaded AND it's built with GCC_VERSION=100101
.profile.node.kubernetes.io/my-datacenter=datacenter-1
if the node's name matches the node-datacenter1-rack.*-server.*
pattern, e.g. node-datacenter1-rack2-server42
This page contains usage examples and demos.
A demo on the benefits of using node feature discovery can be found in the source code repository under demo/.
This page contains usage examples and demos.
A demo on the benefits of using node feature discovery can be found in the source code repository under demo/.
Features are advertised as labels in the Kubernetes Node object.
Label creation in nfd-worker is performed by a set of separate modules called label sources. The core.labelSources
configuration option (or -label-sources
flag) of nfd-worker controls which sources to enable for label generation.
All built-in labels use the feature.node.kubernetes.io
label namespace and have the following format.
feature.node.kubernetes.io/<feature> = <value>
+ Feature labels · Node Feature Discovery This documentation is for a Node Feature Discovery version that is no longer supported. Please upgrade and visit the documentation of the latest stable release.
Feature labels
Table of contents
Features are advertised as labels in the Kubernetes Node object.
Built-in labels
Label creation in nfd-worker is performed by a set of separate modules called label sources. The core.labelSources
configuration option (or -label-sources
flag) of nfd-worker controls which sources to enable for label generation.
All built-in labels use the feature.node.kubernetes.io
label namespace and have the following format.
feature.node.kubernetes.io/<feature> = <value>
NOTE: Consecutive runs of nfd-worker will update the labels on a given node. If features are not discovered on a consecutive run, the corresponding label will be removed. This includes any restrictions placed on the consecutive run, such as restricting discovered features with the -label-whitelist
flag of nfd-master or core.labelWhiteList
option of nfd-worker.
CPU
Feature name Value Description cpu-cpuid.<cpuid-flag>
true CPU capability is supported. NOTE: the capability might be supported but not enabled. cpu-hardware_multithreading
true Hardware multithreading, such as Intel HTT, enabled (number of logical CPUs is greater than physical CPUs) cpu-coprocessor.nx_gzip
true Nest Accelerator for GZIP is supported(Power). cpu-power.sst_bf.enabled
true Intel SST-BF (Intel Speed Select Technology - Base frequency) enabled cpu-pstate.status
string The status of the Intel pstate driver when in use and enabled, either ‘active' or ‘passive'. cpu-pstate.turbo
bool Set to ‘true' if turbo frequencies are enabled in Intel pstate driver, set to ‘false' if they have been disabled. cpu-pstate.scaling_governor
string The value of the Intel pstate scaling_governor when in use, either ‘powersave' or ‘performance'. cpu-cstate.enabled
bool Set to ‘true' if cstates are set in the intel_idle driver, otherwise set to ‘false'. Unset if intel_idle cpuidle driver is not active. cpu-rdt.<rdt-flag>
true DEPRECATED Intel RDT capability is supported. See RDT flags for details. cpu-security.sgx.enabled
true Set to ‘true' if Intel SGX is enabled in BIOS (based on a non-zero sum value of SGX EPC section sizes). cpu-security.se.enabled
true Set to ‘true' if IBM Secure Execution for Linux (IBM Z & LinuxONE) is available and enabled (requires /sys/firmware/uv/prot_virt_host
facility) cpu-security.tdx.enabled
true Set to ‘true' if Intel TDX is available on the host and has been enabled (requires /sys/module/kvm_intel/parameters/tdx
). cpu-security.tdx.protected
true Set to ‘true' if Intel TDX was used to start the guest node, based on the existence of the "TDX_GUEST" information as part of cpuid features. cpu-security.sev.enabled
true Set to ‘true' if ADM SEV is available on the host and has been enabled (requires /sys/module/kvm_amd/parameters/sev
). cpu-security.sev.es.enabled
true Set to ‘true' if ADM SEV-ES is available on the host and has been enabled (requires /sys/module/kvm_amd/parameters/sev_es
). cpu-security.sev.snp.enabled
true Set to ‘true' if ADM SEV-SNP is available on the host and has been enabled (requires /sys/module/kvm_amd/parameters/sev_snp
). cpu-sgx.enabled
true DEPRECATED: use cpu-security.sgx.enabled
instead. cpu-se.enabled
true DEPRECATED: use cpu-security.se.enabled
instead. cpu-model.vendor_id
string Comparable CPU vendor ID. cpu-model.family
int CPU family. cpu-model.id
int CPU model number.
NOTE: the cpu-rdt.<rdt-flag>
labels are deprecated and will be removed in a future release. They will remain to be available as features for NodeFeatureRule to consume. See customization guide for details how to use NodeFeatureRule objects to create labels.
The CPU label source is configurable, see worker configuration and sources.cpu
configuration options for details.
X86 CPUID flags (partial list)
Flag Description ADX Multi-Precision Add-Carry Instruction Extensions (ADX) AESNI Advanced Encryption Standard (AES) New Instructions (AES-NI) AVX Advanced Vector Extensions (AVX) AVX2 Advanced Vector Extensions 2 (AVX2) AVXVNNI AVX (VEX encoded) VNNI neural network instructions AMXBF16 Advanced Matrix Extension, tile multiplication operations on BFLOAT16 numbers AMXINT8 Advanced Matrix Extension, tile multiplication operations on 8-bit integers AMXFP16 Advanced Matrix Extension, tile multiplication operations on FP16 numbers AMXTILE Advanced Matrix Extension, base tile architecture support AVX512BF16 AVX-512 BFLOAT16 instructions AVX512BITALG AVX-512 bit Algorithms AVX512BW AVX-512 byte and word Instructions AVX512CD AVX-512 conflict detection instructions AVX512DQ AVX-512 doubleword and quadword instructions AVX512ER AVX-512 exponential and reciprocal instructions AVX512F AVX-512 foundation AVX512FP16 AVX-512 FP16 instructions AVX512IFMA AVX-512 integer fused multiply-add instructions AVX512PF AVX-512 prefetch instructions AVX512VBMI AVX-512 vector bit manipulation instructions AVX512VBMI2 AVX-512 vector bit manipulation instructions, version 2 AVX512VL AVX-512 vector length extensions AVX512VNNI AVX-512 vector neural network instructions AVX512VP2INTERSECT AVX-512 intersect for D/Q AVX512VPOPCNTDQ AVX-512 vector population count doubleword and quadword AVXIFMA AVX-IFMA instructions AVXNECONVERT AVX-NE-CONVERT instructions AVXVNNIINT8 AVX-VNNI-INT8 instructions CMPCCXADD CMPCCXADD instructions ENQCMD Enqueue Command GFNI Galois Field New Instructions HYPERVISOR Running under hypervisor MSRLIST Read/Write List of Model Specific Registers PREFETCHI PREFETCHIT0/1 instructions VAES AVX-512 vector AES instructions VPCLMULQDQ Carry-less multiplication quadword WRMSRNS Non-Serializing Write to Model Specific Register
By default, the following CPUID flags have been blacklisted: BMI1, BMI2, CLMUL, CMOV, CX16, ERMS, F16C, HTT, LZCNT, MMX, MMXEXT, NX, POPCNT, RDRAND, RDSEED, RDTSCP, SGX, SSE, SSE2, SSE3, SSE4, SSE42, SSSE3 and TDX_GUEST. See sources.cpu
configuration options to change the behavior.
See the full list in github.com/klauspost/cpuid.
Arm CPUID flags (partial list)
Flag Description IDIVA Integer divide instructions available in ARM mode IDIVT Integer divide instructions available in Thumb mode THUMB Thumb instructions FASTMUL Fast multiplication VFP Vector floating point instruction extension (VFP) VFPv3 Vector floating point extension v3 VFPv4 Vector floating point extension v4 VFPD32 VFP with 32 D-registers HALF Half-word loads and stores EDSP DSP extensions NEON NEON SIMD instructions LPAE Large Physical Address Extensions
Arm64 CPUID flags (partial list)
Flag Description AES Announcing the Advanced Encryption Standard EVSTRM Event Stream Frequency Features FPHP Half Precision(16bit) Floating Point Data Processing Instructions ASIMDHP Half Precision(16bit) Asimd Data Processing Instructions ATOMICS Atomic Instructions to the A64 ASIMRDM Support for Rounding Double Multiply Add/Subtract PMULL Optional Cryptographic and CRC32 Instructions JSCVT Perform Conversion to Match Javascript DCPOP Persistent Memory Support
Kernel
Feature Value Description kernel-config.<option>
true Kernel config option is enabled (set ‘y' or ‘m'). Default options are NO_HZ
, NO_HZ_IDLE
, NO_HZ_FULL
and PREEMPT
kernel-selinux.enabled
true Selinux is enabled on the node kernel-version.full
string Full kernel version as reported by /proc/sys/kernel/osrelease
(e.g. ‘4.5.6-7-g123abcde') kernel-version.major
string First component of the kernel version (e.g. ‘4') kernel-version.minor
string Second component of the kernel version (e.g. ‘5') kernel-version.revision
string Third component of the kernel version (e.g. ‘6')
The kernel label source is configurable, see worker configuration and sources.kernel
configuration options for details.
Memory
Feature Value Description memory-numa
true Multiple memory nodes i.e. NUMA architecture detected memory-nv.present
true NVDIMM device(s) are present memory-nv.dax
true NVDIMM region(s) configured in DAX mode are present
Network
Feature Value Description network-sriov.capable
true Single Root Input/Output Virtualization (SR-IOV) enabled Network Interface Card(s) present network-sriov.configured
true SR-IOV virtual functions have been configured
PCI
Feature Value Description pci-<device label>.present
true PCI device is detected pci-<device label>.sriov.capable
true Single Root Input/Output Virtualization (SR-IOV) enabled PCI device present
<device label>
is format is configurable and set to <class>_<vendor>
by default. For more more details about configuration of the pci labels, see sources.pci
options and worker configuration instructions.
USB
Feature Value Description usb-<device label>.present
true USB device is detected
<device label>
is format is configurable and set to <class>_<vendor>_<device>
by default. For more more details about configuration of the usb labels, see sources.usb
options and worker configuration instructions.
Storage
Feature Value Description storage-nonrotationaldisk
true Non-rotational disk, like SSD, is present in the node
System
Feature Value Description system-os_release.ID
string Operating system identifier system-os_release.VERSION_ID
string Operating system version identifier (e.g. ‘6.7') system-os_release.VERSION_ID.major
string First component of the OS version id (e.g. ‘6') system-os_release.VERSION_ID.minor
string Second component of the OS version id (e.g. ‘7')
Custom
The custom label source is designed for creating user defined labels. However, it has a few statically defined built-in labels:
Feature Value Description custom-rdma.capable
true The node has an RDMA capable Network adapter custom-rdma.enabled
true The node has the needed RDMA modules loaded to run RDMA traffic
User defined labels
NFD has many extension points for creating vendor and application specific labels. See the customization guide for detailed documentation.
Extended resources
This feature is experimental and by no means a replacement for the usage of device plugins.
Labels which have integer values, can be promoted to Kubernetes extended resources by listing them to the master -resource-labels
command line flag. These labels won't then show in the node label section, they will appear only as extended resources.
An example use-case for the extended resources could be based on a hook which creates a label for the node SGX EPC memory section size. By giving the name of that label in the -resource-labels
flag, that value will then turn into an extended resource of the node, allowing PODs to request that resource and the Kubernetes scheduler to schedule such PODs to only those nodes which have a sufficient capacity of said resource left.
Similar to labels, the default namespace feature.node.kubernetes.io
is automatically prefixed to the extended resource, if the promoted label doesn't have a namespace.
Example usage of the command line arguments, using a new namespace: nfd-master -resource-labels=my_source-my.feature,sgx.some.ns/epc -extra-label-ns=sgx.some.ns
The above would result in following extended resources provided that related labels exist:
sgx.some.ns/epc: <label value>
feature.node.kubernetes.io/my_source-my.feature: <label value>
-
Node Feature Discovery v0.14
\ No newline at end of file
+
Usage instructions.
Usage instructions.
NFD-GC (NFD Garbage-Collector) is preferably run as a Kubernetes deployment with one replica. It makes sure that all NodeFeature and NodeResourceTopology objects have corresponding nodes and removes stale objects for non-existent nodes.
The daemon watches for Node deletion events and removes NodeFeature and NodeResourceTopology objects upon them. It also runs periodically to make sure no node delete event was missed and to remove any NodeFeature or NodeResourceTopology objects that were created without corresponding node. The default garbage collector interval is set to 1h which is the value when no -gc-interval is specified.
In Helm deployments (see garbage collector parameters) NFD-GC will only be deployed when enableNodeFeatureApi
or topologyUpdater.enable
is set to true.
NFD-GC (NFD Garbage-Collector) is preferably run as a Kubernetes deployment with one replica. It makes sure that all NodeFeature and NodeResourceTopology objects have corresponding nodes and removes stale objects for non-existent nodes.
The daemon watches for Node deletion events and removes NodeFeature and NodeResourceTopology objects upon them. It also runs periodically to make sure no node delete event was missed and to remove any NodeFeature or NodeResourceTopology objects that were created without corresponding node. The default garbage collector interval is set to 1h which is the value when no -gc-interval is specified.
In Helm deployments (see garbage collector parameters) NFD-GC will only be deployed when enableNodeFeatureApi
or topologyUpdater.enable
is set to true.
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.
The NodeFeature Controller uses NodeFeature objects as the input for the NodeFeatureRule processing pipeline. In addition, any labels listed in the NodeFeature object are created on the node (note the allowed label namespaces are controlled).
NFD-Master acts as the controller for NodeFeatureRule objects. It applies the rules specified in NodeFeatureRule objects on raw feature data and creates node labels accordingly. The feature data used as the input is received from nfd-worker instances through NodeFeature objects.
NOTE: when gRPC (DEPRECATED) is used for communicating the features (by setting the flag
-enable-nodefeature-api=false
on both nfd-master and nfd-worker, or via Helm values.enableNodeFeatureApi=false), (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 thecore.sleepInterval
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 and NodeFeature API is used.
NFD-Master supports dynamic configuration through a configuration file. The default location is /etc/kubernetes/node-feature-discovery/nfd-master.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-master straightforward.
Master 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 nfd-master deployment templates create an empty configmap and mount it inside the nfd-master containers. In kustomize deployments, configuration can be edited with:
kubectl -n ${NFD_NS} edit configmap nfd-master-conf
-
In Helm deployments, Master pod parameter master.config
can be used to edit the respective configuration.
See nfd-master 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.
NFD-Master runs as a deployment, by default 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 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.
Note: When NFD-Master is intended to run with more than one replica, it is advised to use
-enable-leader-election
flag. This flag turns on leader election for NFD-Master and let only one replica to act on changes in NodeFeature and NodeFeatureRule objects.
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.
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.
The NodeFeature Controller uses NodeFeature objects as the input for the NodeFeatureRule processing pipeline. In addition, any labels listed in the NodeFeature object are created on the node (note the allowed label namespaces are controlled).
NFD-Master acts as the controller for NodeFeatureRule objects. It applies the rules specified in NodeFeatureRule objects on raw feature data and creates node labels accordingly. The feature data used as the input is received from nfd-worker instances through NodeFeature objects.
NOTE: when gRPC (DEPRECATED) is used for communicating the features (by setting the flag
-enable-nodefeature-api=false
on both nfd-master and nfd-worker, or via Helm values.enableNodeFeatureApi=false), (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 thecore.sleepInterval
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 and NodeFeature API is used.
NFD-Master supports dynamic configuration through a configuration file. The default location is /etc/kubernetes/node-feature-discovery/nfd-master.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-master straightforward.
Master 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 nfd-master deployment templates create an empty configmap and mount it inside the nfd-master containers. In kustomize deployments, configuration can be edited with:
kubectl -n ${NFD_NS} edit configmap nfd-master-conf
+
In Helm deployments, Master pod parameter master.config
can be used to edit the respective configuration.
See nfd-master 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.
NFD-Master runs as a deployment, by default 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 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.
Note: When NFD-Master is intended to run with more than one replica, it is advised to use
-enable-leader-election
flag. This flag turns on leader election for NFD-Master and let only one replica to act on changes in NodeFeature and NodeFeatureRule objects.
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.
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
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
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.
NOTE: unlike nfd-worker, dynamic configuration updates are not currently supported.
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 nfd-topology-updater deployment templates create an empty configmap and mount it inside the nfd-topology-updater containers. In kustomize deployments, configuration can be edited with:
kubectl -n ${NFD_NS} edit configmap nfd-topology-updater-conf
-
In Helm deployments, Topology Updater parameters toplogyUpdater.config
can be used to edit the respective configuration.
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.
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
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
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.
NOTE: unlike nfd-worker, dynamic configuration updates are not currently supported.
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 nfd-topology-updater deployment templates create an empty configmap and mount it inside the nfd-topology-updater containers. In kustomize deployments, configuration can be edited with:
kubectl -n ${NFD_NS} edit configmap nfd-topology-updater-conf
+
In Helm deployments, Topology Updater parameters toplogyUpdater.config
can be used to edit the respective configuration.
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.
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.
The worker configuration file is watched and re-read on every change which provides a simple mechanism of dynamic run-time reconfiguration. See worker configuration for more details.
NFD-Worker supports dynamic 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 nfd-worker deployment templates create an empty configmap and mount it inside the nfd-worker containers. In kustomize deployments, configuration can be edited with:
kubectl -n ${NFD_NS} edit configmap nfd-worker-conf
+ NFD-Worker · Node Feature Discovery This documentation is for a Node Feature Discovery version that is no longer supported. Please upgrade and visit the documentation of the latest stable release.
NFD-Worker
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.
The worker configuration file is watched and re-read on every change which provides a simple mechanism of dynamic run-time reconfiguration. See worker configuration for more details.
Worker configuration
NFD-Worker supports dynamic 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 nfd-worker deployment templates create an empty configmap and mount it inside the nfd-worker containers. In kustomize deployments, configuration can be edited with:
kubectl -n ${NFD_NS} edit configmap nfd-worker-conf
In Helm deployments, Worker pod parameter worker.config
can be used to edit the respective configuration.
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.
Node Feature Discovery v0.14
\ No newline at end of file
+
Configuration options specified from the command line will override those read from the config file.
Nodes with specific features can be targeted using the nodeSelector
field. The following example shows how to target nodes with Intel TurboBoost enabled.
apiVersion: v1
+ Using node labels · Node Feature Discovery This documentation is for a Node Feature Discovery version that is no longer supported. Please upgrade and visit the documentation of the latest stable release.
Using node labels
Nodes with specific features can be targeted using the nodeSelector
field. The following example shows how to target nodes with Intel TurboBoost enabled.
apiVersion: v1
kind: Pod
metadata:
labels:
@@ -10,4 +10,4 @@
name: go1
nodeSelector:
feature.node.kubernetes.io/cpu-pstate.turbo: 'true'
-
For more details on targeting nodes, see node selection.
Node Feature Discovery v0.14
\ No newline at end of file
+
For more details on targeting nodes, see node selection.