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/reference/master-commandline-reference.md b/docs/reference/master-commandline-reference.md index 363067c238..8f494d2c17 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/disable 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..d9f2ad9f54 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/disable the experimental [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, by default nfd-worker will create per-node NodeFeature objects the contain all discovered node features and the set of -feature labels to be created. +feature labels to be created. This will also automatically disable/enable the +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/test/e2e/nfd_gc_test.go b/test/e2e/nfd_gc_test.go index babdbbed9c..f2c5148cb2 100644 --- a/test/e2e/nfd_gc_test.go +++ b/test/e2e/nfd_gc_test.go @@ -31,7 +31,7 @@ import ( "k8s.io/kubernetes/test/e2e/framework" "sigs.k8s.io/node-feature-discovery/pkg/apis/nfd/v1alpha1" nfdclient "sigs.k8s.io/node-feature-discovery/pkg/generated/clientset/versioned" - "sigs.k8s.io/node-feature-discovery/test/e2e/utils" + testutils "sigs.k8s.io/node-feature-discovery/test/e2e/utils" testdeploy "sigs.k8s.io/node-feature-discovery/test/e2e/utils/deployment" testpod "sigs.k8s.io/node-feature-discovery/test/e2e/utils/pod" @@ -87,10 +87,10 @@ var _ = SIGDescribe("NFD GC", func() { // Helper functions createCRs := func(ctx context.Context, nodeNames []string) error { for _, name := range nodeNames { - if err := utils.CreateNodeFeature(ctx, nfdClient, f.Namespace.Name, name, name); err != nil { + if err := testutils.CreateNodeFeature(ctx, nfdClient, f.Namespace.Name, name, name); err != nil { return err } - if err := utils.CreateNodeResourceTopology(ctx, topologyClient, name); err != nil { + if err := testutils.CreateNodeResourceTopology(ctx, topologyClient, name); err != nil { return err } framework.Logf("CREATED CRS FOR node %q", name) 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 }