diff --git a/cmd/nfd-master/main.go b/cmd/nfd-master/main.go index 277747bd44..0718be36e3 100644 --- a/cmd/nfd-master/main.go +++ b/cmd/nfd-master/main.go @@ -116,7 +116,7 @@ func initFlags(flagset *flag.FlagSet) (*master.Args, *master.ConfigOverrideArgs) "Config file to use.") flagset.StringVar(&args.Kubeconfig, "kubeconfig", "", "Kubeconfig to use") - flagset.BoolVar(&args.EnableNodeFeatureApi, "enable-nodefeature-api", false, + flagset.BoolVar(&args.EnableNodeFeatureApi, "enable-nodefeature-api", true, "Enable the NodeFeature CRD API for receiving node features. This will automatically disable the gRPC communication.") flagset.BoolVar(&args.CrdController, "featurerules-controller", true, "Enable NFD CRD API controller. DEPRECATED: use -crd-controller instead") diff --git a/cmd/nfd-worker/main.go b/cmd/nfd-worker/main.go index 351260c9ea..f9c8a47a6e 100644 --- a/cmd/nfd-worker/main.go +++ b/cmd/nfd-worker/main.go @@ -103,7 +103,7 @@ func initFlags(flagset *flag.FlagSet) (*worker.Args, *worker.ConfigOverrideArgs) "Config file to use.") flagset.StringVar(&args.KeyFile, "key-file", "", "Private key matching -cert-file") - flagset.BoolVar(&args.EnableNodeFeatureApi, "enable-nodefeature-api", false, + flagset.BoolVar(&args.EnableNodeFeatureApi, "enable-nodefeature-api", true, "Enable the NodeFeature CRD API for communicating with nfd-master. This will automatically disable the gRPC communication.") flagset.StringVar(&args.Kubeconfig, "kubeconfig", "", "Kubeconfig to use") diff --git a/deployment/helm/node-feature-discovery/values.yaml b/deployment/helm/node-feature-discovery/values.yaml index 80c50bf614..d285da1763 100644 --- a/deployment/helm/node-feature-discovery/values.yaml +++ b/deployment/helm/node-feature-discovery/values.yaml @@ -10,7 +10,7 @@ nameOverride: "" fullnameOverride: "" namespaceOverride: "" -enableNodeFeatureApi: false +enableNodeFeatureApi: true master: config: ### diff --git a/docs/deployment/helm.md b/docs/deployment/helm.md index 5056f9bdc5..3ca9819282 100644 --- a/docs/deployment/helm.md +++ b/docs/deployment/helm.md @@ -101,7 +101,7 @@ We have introduced the following Chart parameters. | `fullnameOverride` | string | | Override a default fully qualified app name | | `tls.enable` | bool | false | Specifies whether to use TLS for communications between components | | `tls.certManager` | bool | false | If enabled, requires [cert-manager](https://cert-manager.io/docs/) to be installed and will automatically create the required TLS certificates | -| `enableNodeFeatureApi` | bool | false | Enable the [NodeFeature](../usage/custom-resources.md#nodefeature) CRD API for communicating node features. This will automatically disable the gRPC communication. +| `enableNodeFeatureApi` | bool | true | Enable the [NodeFeature](../usage/custom-resources.md#nodefeature) CRD API for communicating node features. This will automatically disable the gRPC communication. | `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 | diff --git a/docs/get-started/introduction.md b/docs/get-started/introduction.md index f69d6dc3e4..c38ecd2f86 100644 --- a/docs/get-started/introduction.md +++ b/docs/get-started/introduction.md @@ -117,8 +117,8 @@ only created on nodes running nfd-master. NFD takes use of some Kubernetes Custom Resources. -[NodeFeature](../usage/custom-resources.md#nodefeature)s (EXPERIMENTAL) -can be used for representing node features and requesting node labels to be +[NodeFeature](../usage/custom-resources.md#nodefeature)s +is be used for representing node features and requesting node labels to be generated. NFD-Master uses [NodeFeatureRule](../usage/custom-resources.md#nodefeaturerule)s diff --git a/docs/reference/master-commandline-reference.md b/docs/reference/master-commandline-reference.md index 363067c238..829f038870 100644 --- a/docs/reference/master-commandline-reference.md +++ b/docs/reference/master-commandline-reference.md @@ -153,16 +153,17 @@ nfd-master -verify-node-name -ca-file=/opt/nfd/ca.crt \ ### -enable-nodefeature-api -The `-enable-nodefeature-api` flag enables the +The `-enable-nodefeature-api` flag enables/disables the [NodeFeature](../usage/custom-resources.md#nodefeature) CRD API for receiving -feature requests. This will also automatically disable the gRPC interface. +feature requests. This will also automatically disable/enable the gRPC +interface. -Default: false +Default: true Example: ```bash -nfd-master -enable-nodefeature-api +nfd-master -enable-nodefeature-api=false ``` ### -enable-leader-election diff --git a/docs/reference/worker-commandline-reference.md b/docs/reference/worker-commandline-reference.md index 40d018be88..a8d35e694a 100644 --- a/docs/reference/worker-commandline-reference.md +++ b/docs/reference/worker-commandline-reference.md @@ -197,19 +197,19 @@ nfd-worker -label-sources=kernel,system,local ### -enable-nodefeature-api -The `-enable-nodefeature-api` flag enables the experimental +The `-enable-nodefeature-api` flag enables/disables the [NodeFeature](../usage/custom-resources.md#nodefeature) CRD API -for communicating with nfd-master. This will also automatically disable the -gRPC communication to nfd-master. When enabled, nfd-worker will create per-node +for communicating with nfd-master. When enabled nfd-worker creates per-node NodeFeature objects the contain all discovered node features and the set of -feature labels to be created. +feature labels to be created. Setting the flag to false will enable +gRPC communication to nfd-master. -Default: false +Default: true Example: ```bash -nfd-worker -enable-nodefeature-api +nfd-worker -enable-nodefeature-api=false ``` ### -metrics diff --git a/docs/usage/custom-resources.md b/docs/usage/custom-resources.md index 71ea942f45..b36b447b1d 100644 --- a/docs/usage/custom-resources.md +++ b/docs/usage/custom-resources.md @@ -19,13 +19,11 @@ NFD uses some Kubernetes [custom resources][custom-resources]. ## NodeFeature -**EXPERIMENTAL** NodeFeature is an NFD-specific custom resource for communicating node -features and node labeling requests. Support for NodeFeature objects is -disabled by default. If enabled, nfd-master watches for NodeFeature objects, -labels nodes as specified and uses the listed features as input when evaluating -[NodeFeatureRule](#nodefeaturerule)s. NodeFeature objects can be used for -implementing 3rd party extensions (see +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 [NodeFeatureRule](#nodefeaturerule)s. NodeFeature objects can be +used for implementing 3rd party extensions (see [customization guide](customization-guide.md#nodefeature-custom-resource) for more details). diff --git a/docs/usage/customization-guide.md b/docs/usage/customization-guide.md index 1ff4e64942..4b48272601 100644 --- a/docs/usage/customization-guide.md +++ b/docs/usage/customization-guide.md @@ -20,7 +20,7 @@ sort: 8 NFD provides multiple extension points for vendor and application specific labeling: -- [`NodeFeature`](#nodefeature-custom-resource) (EXPERIMENTAL) objects can be +- [`NodeFeature`](#nodefeature-custom-resource) objects can be used to communicate "raw" node features and node labeling requests to nfd-master. - [`NodeFeatureRule`](#nodefeaturerule-custom-resource) objects provide a way to @@ -32,7 +32,6 @@ labeling: ## NodeFeature custom resource -**EXPERIMENTAL** NodeFeature objects provide a way for 3rd party extensions to advertise custom features, both as "raw" features that serve as input to [NodeFeatureRule](#nodefeaturerule-custom-resource) objects and as feature @@ -41,9 +40,10 @@ 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. -Support for NodeFeature CRD API is enabled with the `-enable-nodefeature-api` -command line flag. This flag must be specified for both nfd-master and -nfd-worker as it will disable the gRPC communication between them. +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. ### A NodeFeature example diff --git a/docs/usage/nfd-master.md b/docs/usage/nfd-master.md index d2190df258..b769a3fcf1 100644 --- a/docs/usage/nfd-master.md +++ b/docs/usage/nfd-master.md @@ -15,40 +15,26 @@ extended resources based on requests from nfd-workers and 3rd party extensions. ## NodeFeature controller -**EXPERIMENTAL** -Controller for [NodeFeature](custom-resources.md#nodefeature-custom-resource) -objects can be enabled with the -[`-enable-nodefeature-api`](../reference/master-commandline-reference.md#-enable-nodefeature-api) -command line flag. When enabled, features from NodeFeature objects are used as +The NodeFeature Controller uses NodeFeature objects as the input for the [NodeFeatureRule](custom-resources.md#nodefeaturerule) processing pipeline. In addition, any labels listed in the NodeFeature object are created on the node (note the allowed [label namespaces](customization-guide.md#node-labels) are controlled). -> **NOTE:** NodeFeature API must also be enabled in nfd-worker with -> its [`-enable-nodefeature-api`](../reference/worker-commandline-reference.md#-enable-nodefeature-api) -> flag. - -When `-enable-nodefeature-api` option is enabled and 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. - ## NodeFeatureRule controller NFD-Master acts as the controller for [NodeFeatureRule](custom-resources.md#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 can be -received from nfd-worker instances through the gRPC interface or from -[NodeFeature](custom-resources.md#nodefeature-custom-resource) objects. The latter -requires that the [NodeFeaure controller](#nodefeature-controller) has been -enabled. - -> **NOTE:** when gRPC is used for communicating the features (the default -> mechanism), (re-)labelling only happens when a request is received from -> nfd-worker. That is, in practice rules are evaluated and labels for each node -> are created on intervals specified by the +and creates node labels accordingly. The feature data used as the input is +received from nfd-worker instances through +[NodeFeature](custom-resources.md#nodefeature-custom-resource) objects. + +> **NOTE:** when gRPC 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 the > [`core.sleepInterval`](../reference/worker-configuration-reference.md#coresleepinterval) > configuration option of nfd-worker instances. This means that modification or > creation of NodeFeatureRule objects does not instantly cause the node @@ -103,8 +89,10 @@ 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:** If the [NodeFeature controller](#nodefeature-controller) is enabled -> the replica count should be 1. +> **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, diff --git a/test/e2e/node_feature_discovery_test.go b/test/e2e/node_feature_discovery_test.go index c239a0d763..311f7d814a 100644 --- a/test/e2e/node_feature_discovery_test.go +++ b/test/e2e/node_feature_discovery_test.go @@ -175,8 +175,8 @@ var _ = SIGDescribe("NFD master and worker", func() { nfdTestSuite := func(useNodeFeatureApi bool) { createPodSpecOpts := func(opts ...testpod.SpecOption) []testpod.SpecOption { - if useNodeFeatureApi { - return append(opts, testpod.SpecWithContainerExtraArgs("-enable-nodefeature-api")) + if !useNodeFeatureApi { + return append(opts, testpod.SpecWithContainerExtraArgs("-enable-nodefeature-api=false")) } return opts }