2020-09-08 07:17:40 +00:00
|
|
|
---
|
2021-03-09 11:38:09 +00:00
|
|
|
title: "Master cmdline reference"
|
2020-09-08 07:17:40 +00:00
|
|
|
layout: default
|
2022-11-02 12:34:37 +00:00
|
|
|
sort: 1
|
2020-09-08 07:17:40 +00:00
|
|
|
---
|
|
|
|
|
2021-03-09 11:38:09 +00:00
|
|
|
# Commandline flags of nfd-master
|
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-master -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-master -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
|
|
|
### -prune
|
2020-09-08 07:17:40 +00:00
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
The `-prune` flag is a sub-command like option for cleaning up the cluster. It
|
2020-09-08 07:17:40 +00:00
|
|
|
causes nfd-master to remove all NFD related labels, annotations and extended
|
|
|
|
resources from all Node objects of the cluster and exit.
|
|
|
|
|
2023-08-04 13:41:50 +00:00
|
|
|
### -metrics
|
|
|
|
|
2024-11-06 10:14:41 +00:00
|
|
|
**DEPRECATED**: Will be removed in NFD v0.17 and replaced by `-port`.
|
|
|
|
|
2023-08-04 13:41:50 +00:00
|
|
|
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-master.
|
|
|
|
|
|
|
|
Default: 8081
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
nfd-master -metrics=12345
|
|
|
|
```
|
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
### -instance
|
2021-02-03 17:49:02 +00:00
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
The `-instance` flag makes it possible to run multiple NFD deployments in
|
2021-02-03 17:49:02 +00:00
|
|
|
parallel. In practice, it separates the node annotations between deployments so
|
|
|
|
that each of them can store metadata independently. The instance name must
|
|
|
|
start and end with an alphanumeric character and may only contain alphanumeric
|
|
|
|
characters, `-`, `_` or `.`.
|
|
|
|
|
|
|
|
Default: *empty*
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 12:29:07 +00:00
|
|
|
nfd-master -instance=network
|
2021-02-03 17:49:02 +00:00
|
|
|
```
|
|
|
|
|
2023-05-05 10:01:32 +00:00
|
|
|
### -enable-leader-election
|
|
|
|
|
|
|
|
The `-enable-leader-election` flag enables leader election for NFD-Master.
|
|
|
|
It is advised to turn on this flag when running more than one instance of
|
|
|
|
NFD-Master.
|
|
|
|
|
|
|
|
Default: false
|
|
|
|
|
|
|
|
```bash
|
2024-03-18 13:51:28 +00:00
|
|
|
nfd-master -enable-leader-election
|
2023-05-05 10:01:32 +00:00
|
|
|
```
|
|
|
|
|
2022-12-13 15:14:30 +00:00
|
|
|
### -enable-taints
|
|
|
|
|
|
|
|
The `-enable-taints` flag enables/disables node tainting feature of NFD.
|
|
|
|
|
|
|
|
Default: *false*
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
nfd-master -enable-taints=true
|
|
|
|
```
|
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
### -no-publish
|
2020-09-08 07:17:40 +00:00
|
|
|
|
2021-06-08 13:30:35 +00:00
|
|
|
The `-no-publish` flag disables updates to the Node objects in the Kubernetes
|
|
|
|
API server, making a "dry-run" flag for nfd-master. No Labels, Annotations or
|
|
|
|
ExtendedResources of nodes are updated.
|
2020-09-08 07:17:40 +00:00
|
|
|
|
|
|
|
Default: *false*
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 12:29:07 +00:00
|
|
|
nfd-master -no-publish
|
2020-09-08 07:17:40 +00:00
|
|
|
```
|
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
### -label-whitelist
|
2020-09-08 07:17:40 +00:00
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
The `-label-whitelist` specifies a regular expression for filtering feature
|
2023-12-01 13:53:19 +00:00
|
|
|
labels based on their name. Each label must match against the given regular
|
2023-12-01 13:55:45 +00:00
|
|
|
expression or it will not be published.
|
2020-09-08 07:17:40 +00:00
|
|
|
|
2023-08-03 10:38:07 +00:00
|
|
|
> **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-09-08 07:17:40 +00:00
|
|
|
|
|
|
|
Default: *empty*
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 12:29:07 +00:00
|
|
|
nfd-master -label-whitelist='.*cpuid\.'
|
2020-09-08 07:17:40 +00:00
|
|
|
```
|
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
### -extra-label-ns
|
2020-09-08 07:17:40 +00:00
|
|
|
|
2021-02-24 12:29:07 +00:00
|
|
|
The `-extra-label-ns` flag specifies a comma-separated list of allowed feature
|
2023-02-03 19:27:26 +00:00
|
|
|
label namespaces. This option can be used to allow
|
2021-05-26 15:56:16 +00:00
|
|
|
other vendor or application specific namespaces for custom labels from the
|
2023-02-03 19:27:26 +00:00
|
|
|
local and custom feature sources, even though these labels were denied using
|
|
|
|
the `deny-label-ns` flag.
|
2020-09-08 07:17:40 +00:00
|
|
|
|
|
|
|
Default: *empty*
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
2021-02-24 12:29:07 +00:00
|
|
|
nfd-master -extra-label-ns=vendor-1.com,vendor-2.io
|
2020-09-08 07:17:40 +00:00
|
|
|
```
|
|
|
|
|
2023-02-03 19:27:26 +00:00
|
|
|
### -deny-label-ns
|
|
|
|
|
|
|
|
The `-deny-label-ns` flag specifies a comma-separated list of excluded
|
|
|
|
label namespaces. By default, nfd-master allows creating labels in all
|
|
|
|
namespaces, excluding `kubernetes.io` namespace and its sub-namespaces
|
|
|
|
(i.e. `*.kubernetes.io`). However, you should note that
|
|
|
|
`kubernetes.io` and its sub-namespaces are always denied.
|
|
|
|
For example, `nfd-master -deny-label-ns=""` would still disallow
|
|
|
|
`kubernetes.io` and `*.kubernetes.io`.
|
|
|
|
This option can be used to exclude some vendors or application specific
|
|
|
|
namespaces.
|
|
|
|
Note that the namespaces `feature.node.kubernetes.io` and `profile.node.kubernetes.io`
|
|
|
|
and their sub-namespaces are always allowed and cannot be denied.
|
|
|
|
|
|
|
|
Default: *empty*
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
nfd-master -deny-label-ns=*.vendor.com,vendor-2.io
|
|
|
|
```
|
|
|
|
|
2023-03-05 21:56:46 +00:00
|
|
|
### -config
|
|
|
|
|
|
|
|
The `-config` flag specifies the path of the nfd-master configuration file to
|
|
|
|
use.
|
|
|
|
|
|
|
|
Default: /etc/kubernetes/node-feature-discovery/nfd-master.conf
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
nfd-master -config=/opt/nfd/master.conf
|
|
|
|
```
|
|
|
|
|
|
|
|
### -options
|
|
|
|
|
|
|
|
The `-options` flag may be used to specify and override configuration file
|
|
|
|
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
|
|
|
|
nfd-master -options='{"noPublish": true}'
|
|
|
|
```
|
|
|
|
|
2023-05-13 19:03:53 +00:00
|
|
|
### -nfd-api-parallelism
|
|
|
|
|
|
|
|
The `-nfd-api-parallelism` flag can be used to specify the maximum
|
|
|
|
number of concurrent node updates.
|
|
|
|
|
|
|
|
Default: 10
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
nfd-master -nfd-api-parallelism=1
|
|
|
|
```
|
|
|
|
|
2021-02-19 09:03:16 +00:00
|
|
|
### Logging
|
|
|
|
|
|
|
|
The following logging-related flags are inherited from the
|
|
|
|
[klog](https://pkg.go.dev/k8s.io/klog/v2) package.
|
|
|
|
|
|
|
|
#### -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*
|
2023-04-15 15:11:59 +00:00
|
|
|
|
|
|
|
### -resync-period
|
|
|
|
|
|
|
|
The `-resync-period` flag specifies the NFD API controller resync period.
|
|
|
|
The resync means nfd-master replaying all NodeFeature and NodeFeatureRule objects,
|
|
|
|
thus effectively re-syncing all nodes in the cluster (i.e. ensuring labels, annotations,
|
|
|
|
extended resources and taints are in place).
|
2024-03-18 13:51:28 +00:00
|
|
|
|
2023-04-15 15:11:59 +00:00
|
|
|
Default: 1 hour.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
nfd-master -resync-period=2h
|
|
|
|
```
|