Skip to content

Commit 869bb20

Browse files
authored
Merge pull request #1632 from marquiz/devel/fix-nodefeatureapi-feature-gate
Remove references to -enable-nodefeature-api flag
2 parents 4790962 + 6f891ce commit 869bb20

File tree

9 files changed

+36
-30
lines changed

9 files changed

+36
-30
lines changed

cmd/nfd-master/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,9 @@ func initFlags(flagset *flag.FlagSet) (*master.Args, *master.ConfigOverrideArgs)
185185
"Comma separated list of labels to be exposed as extended resources. DEPRECATED: use NodeFeatureRule objects instead")
186186
flagset.Var(overrides.ResyncPeriod, "resync-period",
187187
"Specify the NFD API controller resync period."+
188-
"It has an effect when the NodeFeature API has been enabled (with -enable-nodefeature-api).")
188+
"It does not have effect when the NodeFeature API has been disabled (with -feature-gates NodeFeatureAPI=false).")
189189
overrides.NfdApiParallelism = flagset.Int("nfd-api-parallelism", 10, "Defines the maximum number of goroutines responsible of updating nodes. "+
190-
"Can be used for the throttling mechanism. It has effect only when -enable-nodefeature-api has been set.")
190+
"Can be used for the throttling mechanism. It does not have effect if NodeFeatureAPI feature gate is disabled.")
191191

192192
return args, overrides
193193
}

cmd/nfd-worker/main.go

-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ func main() {
6262
// Check deprecated flags
6363
flags.Visit(func(f *flag.Flag) {
6464
switch f.Name {
65-
case "enable-nodefeature-api":
66-
klog.InfoS("-enable-nodefeature-api is deprecated, will be removed in a future release along with the deprecated gRPC API")
6765
case "ca-file":
6866
klog.InfoS("-ca-file is deprecated, will be removed in a future release along with the deprecated gRPC API")
6967
case "cert-file":

docs/deployment/tls.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ sort: 5
1616
---
1717

1818
> **DEPRECATED**: this section only applies when the gRPC API is used, i.e.
19-
> when the NodeFeature API is disabled via the `-enable-nodefeature-api=false`
20-
> flag on both nfd-master and nfd-worker. The gRPC API is deprecated and will
21-
> be removed in a future release.
19+
> when the NodeFeature API is disabled (via the `-feature-gates
20+
> NodeFeatureAPI=false` flag) on both nfd-master and nfd-worker. The gRPC API
21+
> is deprecated and will be removed in a future release.
2222
2323
NFD supports mutual TLS authentication between the nfd-master and nfd-worker
2424
instances. That is, nfd-worker and nfd-master both verify that the other end

docs/developer-guide/index.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ e2e-tests:
175175

176176
> ****DEPRECATED**: Running NFD locally is deprecated and will be removed in a
177177
> future release. It depends on the gRPC API which is deprecated and will be
178-
> removed in a future release. To run NFD locally, use the
179-
> `-enable-nodefeature-api=false` flag.
178+
> removed in a future release. To run NFD locally, disable the NodeFeature API
179+
> with `-feature-gates NodeFeatureAPI=false` flag.
180180

181181
You can run NFD locally, either directly on your host OS or in containers for
182182
testing and development purposes. This may be useful e.g. for checking
@@ -186,12 +186,12 @@ features-detection.
186186

187187
When running as a standalone container labeling is expected to fail because
188188
Kubernetes API is not available. Thus, it is recommended to use `-no-publish`
189-
Also specify `-crd-controller=false` and `-enable-nodefeature-api=false`
189+
Also specify `-crd-controller=false` and `-feature-gates NodeFeatureAPI=false`
190190
command line flags to disable CRD controller and enable gRPC. E.g.
191191

192192
```bash
193193
$ export NFD_CONTAINER_IMAGE={{ site.container_image }}
194-
$ docker run --rm --name=nfd-test ${NFD_CONTAINER_IMAGE} nfd-master -no-publish -crd-controller=false -enable-nodefeature-api=false
194+
$ docker run --rm --name=nfd-test ${NFD_CONTAINER_IMAGE} nfd-master -no-publish -crd-controller=false -feature-gates NodeFeatureAPI=false
195195
2019/02/01 14:48:21 Node Feature Discovery Master <NFD_VERSION>
196196
2019/02/01 14:48:21 gRPC server serving on port: 8080
197197
```
@@ -202,7 +202,7 @@ To run nfd-worker as a "stand-alone" container you need to run it in the same
202202
network namespace as the nfd-master container:
203203

204204
```bash
205-
$ docker run --rm --network=container:nfd-test ${NFD_CONTAINER_IMAGE} nfd-worker -enable-nodefeature-api=false
205+
$ docker run --rm --network=container:nfd-test ${NFD_CONTAINER_IMAGE} nfd-worker -feature-gates NodeFeatureAPI=false
206206
2019/02/01 14:48:56 Node Feature Discovery Worker <NFD_VERSION>
207207
...
208208
```

docs/reference/master-commandline-reference.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,13 @@ The `-enable-leader-election` flag enables leader election for NFD-Master.
181181
It is advised to turn on this flag when running more than one instance of
182182
NFD-Master.
183183

184-
This flag takes effect only when combined with `-enable-nodefeature-api` flag.
184+
Does not have effect if the [NodeFeatureAPI](feature-gates.md#nodefeatureapi)
185+
feature gate is disabled.
185186

186187
Default: false
187188

188189
```bash
189-
nfd-master -enable-nodefeature-api -enable-leader-election
190+
nfd-master -enable-leader-election
190191
```
191192

192193
### -enable-taints
@@ -346,7 +347,8 @@ nfd-master -options='{"noPublish": true}'
346347
The `-nfd-api-parallelism` flag can be used to specify the maximum
347348
number of concurrent node updates.
348349

349-
It takes effect only when `-enable-nodefeature-api` has been set.
350+
Does not have effect if the [NodeFeatureAPI](feature-gates.md#nodefeatureapi)
351+
feature gate is disabled.
350352

351353
Default: 10
352354

@@ -440,8 +442,9 @@ The `-resync-period` flag specifies the NFD API controller resync period.
440442
The resync means nfd-master replaying all NodeFeature and NodeFeatureRule objects,
441443
thus effectively re-syncing all nodes in the cluster (i.e. ensuring labels, annotations,
442444
extended resources and taints are in place).
443-
Only has effect when the [NodeFeature](../usage/custom-resources.md#nodefeature)
444-
CRD API has been enabled with [`-enable-nodefeature-api`](master-commandline-reference.md#-enable-nodefeature-api).
445+
446+
Does not have effect if the [NodeFeatureAPI](feature-gates.md#nodefeatureapi)
447+
feature gate is disabled.
445448

446449
Default: 1 hour.
447450

docs/reference/master-configuration-reference.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,9 @@ The `resyncPeriod` option specifies the NFD API controller resync period.
152152
The resync means nfd-master replaying all NodeFeature and NodeFeatureRule objects,
153153
thus effectively re-syncing all nodes in the cluster (i.e. ensuring labels, annotations,
154154
extended resources and taints are in place).
155-
Only has effect when the [NodeFeature](../usage/custom-resources.md#nodefeature)
156-
CRD API has been enabled with [`-enable-nodefeature-api`](master-commandline-reference.md#-enable-nodefeature-api).
155+
156+
Does not have effect if the [NodeFeatureAPI](feature-gates.md#nodefeatureapi)
157+
feature gate is disabled.
157158

158159
Default: 1 hour.
159160

@@ -227,7 +228,8 @@ leaderElection:
227228
The `nfdApiParallelism` option can be used to specify the maximum
228229
number of concurrent node updates.
229230

230-
It takes effect only when `-enable-nodefeature-api` has been set.
231+
Does not have effect if the [NodeFeatureAPI](feature-gates.md#nodefeatureapi)
232+
feature gate is disabled.
231233

232234
Default: 10
233235

docs/reference/worker-commandline-reference.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,12 @@ nfd-worker -key-file=/opt/nfd/worker.key -cert-file=/opt/nfd/worker.crt -ca-file
149149
### -kubeconfig
150150

151151
The `-kubeconfig` flag specifies the kubeconfig to use for connecting to the
152-
Kubernetes API server. It is only needed for manipulating
153-
[NodeFeature](../usage/custom-resources.md#nodefeature) objects, and thus the flag
154-
only takes effect when
155-
[`-enable-nodefeature-api`](#-enable-nodefeature-api)) is specified. An empty
156-
value (which is also the default) implies in-cluster kubeconfig.
152+
Kubernetes API server. It is needed for manipulating
153+
[NodeFeature](../usage/custom-resources.md#nodefeature) objects. An empty value
154+
(which is also the default) implies in-cluster kubeconfig.
155+
156+
Does not have effect if the [NodeFeatureAPI](feature-gates.md#nodefeatureapi)
157+
feature gate is disabled.
157158

158159
Default: *empty*
159160

docs/usage/customization-guide.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ Note that RBAC rules must be created for each extension for them to be able to
4141
create and manipulate NodeFeature objects in their namespace.
4242

4343
The NodeFeature CRD API can be disabled with the
44-
`-enable-nodefeature-api=false` command line flag. This flag must be specified
45-
for both nfd-master and nfd-worker as it will enable the gRPC communication
46-
between them. Note that the gRPC API is **DEPRECATED** and will be removed in a
47-
future release, at which point the NodeFeature API cannot be disabled.
44+
[NodeFeatureAPI](../reference/feature-gates.md#nodefeatureapi) feature gate
45+
(`-feature-gates NodeFeatureAPI=false` on command line). The `-feature-gates`
46+
command line flag must be specified for both nfd-master and nfd-worker as it
47+
will enable the gRPC communication between them. Note that the gRPC API is
48+
**DEPRECATED** and will be removed in a future release, at which point the
49+
NodeFeature API cannot be disabled.
4850

4951
### A NodeFeature example
5052

test/e2e/node_feature_discovery_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ var _ = NFDDescribe(Label("nfd-master"), func() {
190190
nfdTestSuite := func(useNodeFeatureApi bool) {
191191
createPodSpecOpts := func(opts ...testpod.SpecOption) []testpod.SpecOption {
192192
if !useNodeFeatureApi {
193-
return append(opts, testpod.SpecWithContainerExtraArgs("-enable-nodefeature-api=false"))
193+
return append(opts, testpod.SpecWithContainerExtraArgs("-feature-gates", "NodeFeatureAPI=false"))
194194
}
195195
return opts
196196
}

0 commit comments

Comments
 (0)