2020-09-08 07:17:40 +00:00
|
|
|
---
|
2021-03-09 11:38:09 +00:00
|
|
|
title: "Worker cmdline reference"
|
2020-09-08 07:17:40 +00:00
|
|
|
layout: default
|
2022-11-02 12:34:37 +00:00
|
|
|
sort: 2
|
2020-09-08 07:17:40 +00:00
|
|
|
---
|
|
|
|
|
2021-03-09 11:38:09 +00:00
|
|
|
# Commandline flags of nfd-worker
|
2021-09-27 12:31:49 +00:00
|
|
|
{: .no_toc}
|
2020-09-08 07:17:40 +00:00
|
|
|
|
2021-03-09 11:38:09 +00:00
|
|
|
## Table of contents
|
2021-09-27 12:31:49 +00:00
|
|
|
{: .no_toc .text-delta}
|
2020-09-08 07:17:40 +00:00
|
|
|
|
|
|
|
1. TOC
|
|
|
|
{:toc}
|
|
|
|
|
|
|
|
---
|
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
To quickly view available command line flags execute `nfd-worker -help`.
|
2020-09-08 07:17:40 +00:00
|
|
|
In a docker container:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 12:29:07 +00:00
|
|
|
docker run {{ site.container_image }} nfd-worker -help
|
2020-09-08 07:17:40 +00:00
|
|
|
```
|
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
### -h, -help
|
2020-09-08 07:17:40 +00:00
|
|
|
|
|
|
|
Print usage and exit.
|
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
### -version
|
2020-09-08 07:17:40 +00:00
|
|
|
|
|
|
|
Print version and exit.
|
|
|
|
|
2024-03-14 18:23:07 +00:00
|
|
|
### -feature-gates
|
|
|
|
|
|
|
|
The `-feature-gates` flag is used to enable or disable non GA features.
|
2024-07-29 09:26:41 +00:00
|
|
|
The list of available feature gates can be found in the [feature gates documentation](feature-gates.md).
|
2024-03-14 18:23:07 +00:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2024-07-10 08:16:32 +00:00
|
|
|
nfd-master -feature-gates NodeFeatureGroupAPI=true
|
2024-03-14 18:23:07 +00:00
|
|
|
```
|
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
### -config
|
2020-09-08 07:17:40 +00:00
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
The `-config` flag specifies the path of the nfd-worker configuration file to
|
2020-09-08 07:17:40 +00:00
|
|
|
use.
|
|
|
|
|
|
|
|
Default: /etc/kubernetes/node-feature-discovery/nfd-worker.conf
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 12:29:07 +00:00
|
|
|
nfd-worker -config=/opt/nfd/worker.conf
|
2020-09-08 07:17:40 +00:00
|
|
|
```
|
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
### -options
|
2020-09-08 07:17:40 +00:00
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
The `-options` flag may be used to specify and override configuration file
|
2020-09-08 07:17:40 +00:00
|
|
|
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:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 12:29:07 +00:00
|
|
|
nfd-worker -options='{"sources":{"cpu":{"cpuid":{"attributeWhitelist":["AVX","AVX2"]}}}}'
|
2020-09-08 07:17:40 +00:00
|
|
|
```
|
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
### -server
|
2020-09-08 07:17:40 +00:00
|
|
|
|
Deprecate gRPC API
Now that the NodeFeature API has been set enabled by default, the gRPC
mode will be deprecated and with it all flags and features around it.
For nfd-master, flags
-port, -key-file, -ca-file, -cert-file, -verify-node-name, -enable-nodefeature-api
are now marked as deprecated.
For nfd-worker flags
-enable-nodefeature-api, -ca-file, -cert-file, -key-file, -server, -server-name-override
are now marked as deprecated.
Deprecated flags, as well as gRPC related code will be removed in future
releases.
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
Co-authored-by: Markus Lehtonen <markus.lehtonen@intel.com>
2023-09-06 08:22:13 +00:00
|
|
|
> **NOTE** the gRPC API is deprecated and will be removed in a future release.
|
|
|
|
> and this flag will be removed as well.
|
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
The `-server` flag specifies the address of the nfd-master endpoint where to
|
2020-09-08 07:17:40 +00:00
|
|
|
connect to.
|
|
|
|
|
|
|
|
Default: localhost:8080
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 12:29:07 +00:00
|
|
|
nfd-worker -server=nfd-master.nfd.svc.cluster.local:443
|
2020-09-08 07:17:40 +00:00
|
|
|
```
|
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
### -ca-file
|
2020-09-08 07:17:40 +00:00
|
|
|
|
Deprecate gRPC API
Now that the NodeFeature API has been set enabled by default, the gRPC
mode will be deprecated and with it all flags and features around it.
For nfd-master, flags
-port, -key-file, -ca-file, -cert-file, -verify-node-name, -enable-nodefeature-api
are now marked as deprecated.
For nfd-worker flags
-enable-nodefeature-api, -ca-file, -cert-file, -key-file, -server, -server-name-override
are now marked as deprecated.
Deprecated flags, as well as gRPC related code will be removed in future
releases.
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
Co-authored-by: Markus Lehtonen <markus.lehtonen@intel.com>
2023-09-06 08:22:13 +00:00
|
|
|
> **NOTE** the gRPC API is deprecated and will be removed in a future release.
|
|
|
|
> and this flag will be removed as well.
|
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
The `-ca-file` is one of the three flags (together with `-cert-file` and
|
|
|
|
`-key-file`) controlling the mutual TLS authentication on the worker side.
|
2020-09-08 07:17:40 +00:00
|
|
|
This flag specifies the TLS root certificate that is used for verifying the
|
|
|
|
authenticity of nfd-master.
|
|
|
|
|
|
|
|
Default: *empty*
|
|
|
|
|
2023-08-03 10:38:07 +00:00
|
|
|
> **NOTE:** Must be specified together with `-cert-file` and `-key-file`
|
2020-09-08 07:17:40 +00:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 12:29:07 +00:00
|
|
|
nfd-worker -ca-file=/opt/nfd/ca.crt -cert-file=/opt/nfd/worker.crt -key-file=/opt/nfd/worker.key
|
2020-09-08 07:17:40 +00:00
|
|
|
```
|
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
### -cert-file
|
2020-09-08 07:17:40 +00:00
|
|
|
|
Deprecate gRPC API
Now that the NodeFeature API has been set enabled by default, the gRPC
mode will be deprecated and with it all flags and features around it.
For nfd-master, flags
-port, -key-file, -ca-file, -cert-file, -verify-node-name, -enable-nodefeature-api
are now marked as deprecated.
For nfd-worker flags
-enable-nodefeature-api, -ca-file, -cert-file, -key-file, -server, -server-name-override
are now marked as deprecated.
Deprecated flags, as well as gRPC related code will be removed in future
releases.
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
Co-authored-by: Markus Lehtonen <markus.lehtonen@intel.com>
2023-09-06 08:22:13 +00:00
|
|
|
> **NOTE** the gRPC API is deprecated and will be removed in a future release.
|
|
|
|
> and this flag will be removed as well.
|
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
The `-cert-file` is one of the three flags (together with `-ca-file` and
|
|
|
|
`-key-file`) controlling mutual TLS authentication on the worker side. This
|
2020-09-08 07:17:40 +00:00
|
|
|
flag specifies the TLS certificate presented for authenticating outgoing
|
|
|
|
requests.
|
|
|
|
|
|
|
|
Default: *empty*
|
|
|
|
|
2023-08-03 10:38:07 +00:00
|
|
|
> **NOTE:** Must be specified together with `-ca-file` and `-key-file`
|
2020-09-08 07:17:40 +00:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 12:29:07 +00:00
|
|
|
nfd-workerr -cert-file=/opt/nfd/worker.crt -key-file=/opt/nfd/worker.key -ca-file=/opt/nfd/ca.crt
|
2020-09-08 07:17:40 +00:00
|
|
|
```
|
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
### -key-file
|
2020-09-08 07:17:40 +00:00
|
|
|
|
Deprecate gRPC API
Now that the NodeFeature API has been set enabled by default, the gRPC
mode will be deprecated and with it all flags and features around it.
For nfd-master, flags
-port, -key-file, -ca-file, -cert-file, -verify-node-name, -enable-nodefeature-api
are now marked as deprecated.
For nfd-worker flags
-enable-nodefeature-api, -ca-file, -cert-file, -key-file, -server, -server-name-override
are now marked as deprecated.
Deprecated flags, as well as gRPC related code will be removed in future
releases.
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
Co-authored-by: Markus Lehtonen <markus.lehtonen@intel.com>
2023-09-06 08:22:13 +00:00
|
|
|
> **NOTE** the gRPC API is deprecated and will be removed in a future release.
|
|
|
|
> and this flag will be removed as well.
|
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
The `-key-file` is one of the three flags (together with `-ca-file` and
|
|
|
|
`-cert-file`) controlling the mutual TLS authentication on the worker side.
|
2020-09-08 07:17:40 +00:00
|
|
|
This flag specifies the private key corresponding the given certificate file
|
2021-02-24 12:29:07 +00:00
|
|
|
(`-cert-file`) that is used for authenticating outgoing requests.
|
2020-09-08 07:17:40 +00:00
|
|
|
|
|
|
|
Default: *empty*
|
|
|
|
|
2023-08-03 10:38:07 +00:00
|
|
|
> **NOTE:** Must be specified together with `-cert-file` and `-ca-file`
|
2020-09-08 07:17:40 +00:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 12:29:07 +00:00
|
|
|
nfd-worker -key-file=/opt/nfd/worker.key -cert-file=/opt/nfd/worker.crt -ca-file=/opt/nfd/ca.crt
|
2020-09-08 07:17:40 +00:00
|
|
|
```
|
|
|
|
|
2022-08-12 10:10:48 +00:00
|
|
|
### -kubeconfig
|
|
|
|
|
|
|
|
The `-kubeconfig` flag specifies the kubeconfig to use for connecting to the
|
2024-03-18 13:51:28 +00:00
|
|
|
Kubernetes API server. It is needed for manipulating
|
|
|
|
[NodeFeature](../usage/custom-resources.md#nodefeature) objects. An empty value
|
|
|
|
(which is also the default) implies in-cluster kubeconfig.
|
|
|
|
|
2022-08-12 10:10:48 +00:00
|
|
|
Default: *empty*
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
nfd-worker -kubeconfig ${HOME}/.kube/config
|
|
|
|
```
|
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
### -server-name-override
|
2020-09-08 07:17:40 +00:00
|
|
|
|
Deprecate gRPC API
Now that the NodeFeature API has been set enabled by default, the gRPC
mode will be deprecated and with it all flags and features around it.
For nfd-master, flags
-port, -key-file, -ca-file, -cert-file, -verify-node-name, -enable-nodefeature-api
are now marked as deprecated.
For nfd-worker flags
-enable-nodefeature-api, -ca-file, -cert-file, -key-file, -server, -server-name-override
are now marked as deprecated.
Deprecated flags, as well as gRPC related code will be removed in future
releases.
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
Co-authored-by: Markus Lehtonen <markus.lehtonen@intel.com>
2023-09-06 08:22:13 +00:00
|
|
|
> **NOTE** the gRPC API is deprecated and will be removed in a future release.
|
|
|
|
> and this flag will be removed as well.
|
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
The `-server-name-override` flag specifies the common name (CN) which to
|
2020-09-08 07:17:40 +00:00
|
|
|
expect from the nfd-master TLS certificate. This flag is mostly intended for
|
|
|
|
development and debugging purposes.
|
|
|
|
|
|
|
|
Default: *empty*
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 12:29:07 +00:00
|
|
|
nfd-worker -server-name-override=localhost
|
2020-09-08 07:17:40 +00:00
|
|
|
```
|
|
|
|
|
2021-12-03 07:22:43 +00:00
|
|
|
### -feature-sources
|
|
|
|
|
|
|
|
The `-feature-sources` flag specifies a comma-separated 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 command line flag 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. Consider using the `core.featureSources` config file option,
|
|
|
|
instead, allowing dynamic configurability.
|
|
|
|
|
2023-08-03 10:38:07 +00:00
|
|
|
> **NOTE:** This flag takes precedence over the `core.featureSources`
|
|
|
|
> configuration file option.
|
2021-12-03 07:22:43 +00:00
|
|
|
|
|
|
|
Default: all
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
nfd-worker -feature-sources=all,-pci
|
|
|
|
```
|
|
|
|
|
2021-11-25 12:14:15 +00:00
|
|
|
### -label-sources
|
2020-09-08 07:17:40 +00:00
|
|
|
|
2021-11-25 12:14:15 +00:00
|
|
|
The `-label-sources` flag specifies a comma-separated list of enabled label
|
2021-11-25 08:22:20 +00:00
|
|
|
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`. Consider using the
|
2021-11-25 12:14:15 +00:00
|
|
|
`core.labelSources` config file option, instead, allowing dynamic
|
|
|
|
configurability.
|
2020-09-08 07:17:40 +00:00
|
|
|
|
2023-08-03 10:38:07 +00:00
|
|
|
> **NOTE:** This flag takes precedence over the `core.labelSources`
|
|
|
|
> configuration file option.
|
2020-12-01 13:53:04 +00:00
|
|
|
|
2020-09-09 08:24:29 +00:00
|
|
|
Default: all
|
2020-09-08 07:17:40 +00:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-11-25 12:14:15 +00:00
|
|
|
nfd-worker -label-sources=kernel,system,local
|
2020-09-08 07:17:40 +00:00
|
|
|
```
|
|
|
|
|
2023-08-04 13:41:50 +00:00
|
|
|
### -metrics
|
|
|
|
|
|
|
|
The `-metrics` flag specifies the port on which to expose
|
|
|
|
[Prometheus](https://prometheus.io/) metrics. Setting this to 0 disables the
|
|
|
|
metrics server on nfd-worker.
|
|
|
|
|
|
|
|
Default: 8081
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
nfd-worker -metrics=12345
|
|
|
|
```
|
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
### -no-publish
|
2020-09-08 07:17:40 +00:00
|
|
|
|
2022-08-12 10:10:48 +00:00
|
|
|
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.
|
|
|
|
|
2023-08-03 10:38:07 +00:00
|
|
|
> **NOTE:** This flag takes precedence over the
|
|
|
|
> [`core.noPublish`](worker-configuration-reference.md#corenopublish)
|
|
|
|
> configuration file option.
|
2020-09-08 07:17:40 +00:00
|
|
|
|
|
|
|
Default: *false*
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 12:29:07 +00:00
|
|
|
nfd-worker -no-publish
|
2020-09-08 07:17:40 +00:00
|
|
|
```
|
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
### -oneshot
|
2020-09-08 07:17:40 +00:00
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
The `-oneshot` flag causes nfd-worker to exit after one pass of feature
|
2020-09-08 07:17:40 +00:00
|
|
|
detection.
|
|
|
|
|
|
|
|
Default: *false*
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 12:29:07 +00:00
|
|
|
nfd-worker -oneshot -no-publish
|
2020-09-08 07:17:40 +00:00
|
|
|
```
|
|
|
|
|
2021-02-23 08:05:13 +00:00
|
|
|
### Logging
|
|
|
|
|
|
|
|
The following logging-related flags are inherited from the
|
|
|
|
[klog](https://pkg.go.dev/k8s.io/klog/v2) package.
|
|
|
|
|
2023-08-03 10:38:07 +00:00
|
|
|
> **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.
|
2021-02-23 18:42:17 +00:00
|
|
|
|
2021-02-23 08:05:13 +00:00
|
|
|
#### -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*
|