2020-09-08 10:17:40 +03:00
|
|
|
---
|
2021-03-09 13:38:09 +02:00
|
|
|
title: "Worker cmdline reference"
|
2020-09-08 10:17:40 +03:00
|
|
|
layout: default
|
|
|
|
sort: 3
|
|
|
|
---
|
|
|
|
|
2021-03-09 13:38:09 +02:00
|
|
|
# Commandline flags of nfd-worker
|
2021-09-27 15:31:49 +03:00
|
|
|
{: .no_toc}
|
2020-09-08 10:17:40 +03:00
|
|
|
|
2021-03-09 13:38:09 +02:00
|
|
|
## Table of contents
|
2021-09-27 15:31:49 +03:00
|
|
|
{: .no_toc .text-delta}
|
2020-09-08 10:17:40 +03:00
|
|
|
|
|
|
|
1. TOC
|
|
|
|
{:toc}
|
|
|
|
|
|
|
|
---
|
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
To quickly view available command line flags execute `nfd-worker -help`.
|
2020-09-08 10:17:40 +03:00
|
|
|
In a docker container:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 14:29:07 +02:00
|
|
|
docker run {{ site.container_image }} nfd-worker -help
|
2020-09-08 10:17:40 +03:00
|
|
|
```
|
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
### -h, -help
|
2020-09-08 10:17:40 +03:00
|
|
|
|
|
|
|
Print usage and exit.
|
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
### -version
|
2020-09-08 10:17:40 +03:00
|
|
|
|
|
|
|
Print version and exit.
|
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
### -config
|
2020-09-08 10:17:40 +03:00
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
The `-config` flag specifies the path of the nfd-worker configuration file to
|
2020-09-08 10:17:40 +03:00
|
|
|
use.
|
|
|
|
|
|
|
|
Default: /etc/kubernetes/node-feature-discovery/nfd-worker.conf
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 14:29:07 +02:00
|
|
|
nfd-worker -config=/opt/nfd/worker.conf
|
2020-09-08 10:17:40 +03:00
|
|
|
```
|
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
### -options
|
2020-09-08 10:17:40 +03:00
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
The `-options` flag may be used to specify and override configuration file
|
2020-09-08 10:17:40 +03: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 14:29:07 +02:00
|
|
|
nfd-worker -options='{"sources":{"cpu":{"cpuid":{"attributeWhitelist":["AVX","AVX2"]}}}}'
|
2020-09-08 10:17:40 +03:00
|
|
|
```
|
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
### -server
|
2020-09-08 10:17:40 +03:00
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
The `-server` flag specifies the address of the nfd-master endpoint where to
|
2020-09-08 10:17:40 +03:00
|
|
|
connect to.
|
|
|
|
|
|
|
|
Default: localhost:8080
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 14:29:07 +02:00
|
|
|
nfd-worker -server=nfd-master.nfd.svc.cluster.local:443
|
2020-09-08 10:17:40 +03:00
|
|
|
```
|
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
### -ca-file
|
2020-09-08 10:17:40 +03:00
|
|
|
|
2021-02-24 14:29:07 +02: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 10:17:40 +03:00
|
|
|
This flag specifies the TLS root certificate that is used for verifying the
|
|
|
|
authenticity of nfd-master.
|
|
|
|
|
|
|
|
Default: *empty*
|
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
Note: Must be specified together with `-cert-file` and `-key-file`
|
2020-09-08 10:17:40 +03:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 14:29:07 +02:00
|
|
|
nfd-worker -ca-file=/opt/nfd/ca.crt -cert-file=/opt/nfd/worker.crt -key-file=/opt/nfd/worker.key
|
2020-09-08 10:17:40 +03:00
|
|
|
```
|
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
### -cert-file
|
2020-09-08 10:17:40 +03:00
|
|
|
|
2021-02-24 14:29:07 +02: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 10:17:40 +03:00
|
|
|
flag specifies the TLS certificate presented for authenticating outgoing
|
|
|
|
requests.
|
|
|
|
|
|
|
|
Default: *empty*
|
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
Note: Must be specified together with `-ca-file` and `-key-file`
|
2020-09-08 10:17:40 +03:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 14:29:07 +02:00
|
|
|
nfd-workerr -cert-file=/opt/nfd/worker.crt -key-file=/opt/nfd/worker.key -ca-file=/opt/nfd/ca.crt
|
2020-09-08 10:17:40 +03:00
|
|
|
```
|
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
### -key-file
|
2020-09-08 10:17:40 +03:00
|
|
|
|
2021-02-24 14:29:07 +02: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 10:17:40 +03:00
|
|
|
This flag specifies the private key corresponding the given certificate file
|
2021-02-24 14:29:07 +02:00
|
|
|
(`-cert-file`) that is used for authenticating outgoing requests.
|
2020-09-08 10:17:40 +03:00
|
|
|
|
|
|
|
Default: *empty*
|
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
Note: Must be specified together with `-cert-file` and `-ca-file`
|
2020-09-08 10:17:40 +03:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 14:29:07 +02:00
|
|
|
nfd-worker -key-file=/opt/nfd/worker.key -cert-file=/opt/nfd/worker.crt -ca-file=/opt/nfd/ca.crt
|
2020-09-08 10:17:40 +03:00
|
|
|
```
|
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
### -server-name-override
|
2020-09-08 10:17:40 +03:00
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
The `-server-name-override` flag specifies the common name (CN) which to
|
2020-09-08 10:17:40 +03: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 14:29:07 +02:00
|
|
|
nfd-worker -server-name-override=localhost
|
2020-09-08 10:17:40 +03:00
|
|
|
```
|
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
### -sources
|
2020-09-08 10:17:40 +03:00
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
The `-sources` flag specifies a comma-separated list of enabled feature
|
2020-09-09 11:24:29 +03:00
|
|
|
sources. A special value `all` enables all feature sources.
|
2020-09-08 10:17:40 +03:00
|
|
|
|
2020-12-01 15:53:04 +02:00
|
|
|
Note: This flag takes precedence over the `core.sources` configuration
|
|
|
|
file option.
|
|
|
|
|
2020-09-09 11:24:29 +03:00
|
|
|
Default: all
|
2020-09-08 10:17:40 +03:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 14:29:07 +02:00
|
|
|
nfd-worker -sources=kernel,system,local
|
2020-09-08 10:17:40 +03:00
|
|
|
```
|
|
|
|
|
2020-12-01 15:53:04 +02:00
|
|
|
**DEPRECATED**: you should use the `core.sources` option in the
|
|
|
|
configuration file, instead.
|
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
### -no-publish
|
2020-09-08 10:17:40 +03:00
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
The `-no-publish` flag disables all communication with the nfd-master, making
|
2020-09-08 10:17:40 +03:00
|
|
|
it a "dry-run" flag for nfd-worker. NFD-Worker runs feature detection normally,
|
|
|
|
but no labeling requests are sent to nfd-master.
|
|
|
|
|
|
|
|
Default: *false*
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 14:29:07 +02:00
|
|
|
nfd-worker -no-publish
|
2020-09-08 10:17:40 +03:00
|
|
|
```
|
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
### -label-whitelist
|
2020-09-08 10:17:40 +03:00
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
The `-label-whitelist` specifies a regular expression for filtering feature
|
2020-09-08 10:17:40 +03:00
|
|
|
labels based on their name. Each label must match against the given reqular
|
|
|
|
expression in order to be published.
|
|
|
|
|
|
|
|
Note: The regular expression is only matches against the "basename" part of the
|
|
|
|
label, i.e. to the part of the name after '/'. The label namespace is omitted.
|
|
|
|
|
2020-12-01 14:54:59 +02:00
|
|
|
Note: This flag takes precedence over the `core.labelWhiteList` configuration
|
|
|
|
file option.
|
|
|
|
|
2020-09-08 10:17:40 +03:00
|
|
|
Default: *empty*
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 14:29:07 +02:00
|
|
|
nfd-worker -label-whitelist='.*cpuid\.'
|
2020-09-08 10:17:40 +03:00
|
|
|
```
|
|
|
|
|
2020-12-01 14:54:59 +02:00
|
|
|
**DEPRECATED**: you should use the `core.labelWhiteList` option in the
|
|
|
|
configuration file, instead.
|
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
### -oneshot
|
2020-09-08 10:17:40 +03:00
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
The `-oneshot` flag causes nfd-worker to exit after one pass of feature
|
2020-09-08 10:17:40 +03:00
|
|
|
detection.
|
|
|
|
|
|
|
|
Default: *false*
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 14:29:07 +02:00
|
|
|
nfd-worker -oneshot -no-publish
|
2020-09-08 10:17:40 +03:00
|
|
|
```
|
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
### -sleep-interval
|
2020-09-08 10:17:40 +03:00
|
|
|
|
2021-02-24 14:29:07 +02:00
|
|
|
The `-sleep-interval` specifies the interval between feature re-detection (and
|
2020-09-08 10:17:40 +03:00
|
|
|
node re-labeling). A non-positive value implies infinite sleep interval, i.e.
|
|
|
|
no re-detection or re-labeling is done.
|
|
|
|
|
2020-12-01 14:27:47 +02:00
|
|
|
Note: This flag takes precedence over the `core.sleepInterval` configuration
|
|
|
|
file option.
|
|
|
|
|
2020-09-08 10:17:40 +03:00
|
|
|
Default: 60s
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 14:29:07 +02:00
|
|
|
nfd-worker -sleep-interval=1h
|
2020-09-08 10:17:40 +03:00
|
|
|
```
|
2020-12-01 14:27:47 +02:00
|
|
|
|
|
|
|
**DEPRECATED**: you should use the `core.sleepInterval` option in the
|
|
|
|
configuration file, instead.
|
|
|
|
|
2021-02-23 10:05:13 +02:00
|
|
|
### Logging
|
|
|
|
|
|
|
|
The following logging-related flags are inherited from the
|
|
|
|
[klog](https://pkg.go.dev/k8s.io/klog/v2) package.
|
|
|
|
|
2021-02-23 20:42:17 +02: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 10:05:13 +02: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*
|