Skip to content

Commit

Permalink
Enable NodeFeature API by default
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]>
  • Loading branch information
ArangoGutierrez committed Sep 5, 2023
1 parent 8a1facd commit a5dab91
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion cmd/nfd-master/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion cmd/nfd-worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion deployment/helm/node-feature-discovery/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ nameOverride: ""
fullnameOverride: ""
namespaceOverride: ""

enableNodeFeatureApi: false
enableNodeFeatureApi: true

master:
config: ### <NFD-MASTER-CONF-START-DO-NOT-REMOVE>
Expand Down
2 changes: 1 addition & 1 deletion docs/deployment/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

Expand Down
9 changes: 5 additions & 4 deletions docs/reference/master-commandline-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions docs/reference/worker-commandline-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/nfd_gc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/node_feature_discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit a5dab91

Please sign in to comment.