Commandline flags of nfd-worker

Table of contents

  1. -h, -help
  2. -version
  3. -feature-gates
  4. -config
  5. -options
  6. -kubeconfig
  7. -feature-sources
  8. -label-sources
  9. -metrics
  10. -no-publish
  11. -no-owner-refs
  12. -oneshot
  13. Logging

To quickly view available command line flags execute nfd-worker -help. In a docker container:

docker run registry.k8s.io/nfd/node-feature-discovery:v0.17.0 nfd-worker -help

-h, -help

Print usage and exit.

-version

Print version and exit.

-feature-gates

The -feature-gates flag is used to enable or disable non GA features. The list of available feature gates can be found in the feature gates documentation.

Example:

nfd-master -feature-gates NodeFeatureGroupAPI=true

-config

The -config flag specifies the path of the nfd-worker configuration file to use.

Default: /etc/kubernetes/node-feature-discovery/nfd-worker.conf

Example:

nfd-worker -config=/opt/nfd/worker.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:

nfd-worker -options='{"sources":{"cpu":{"cpuid":{"attributeWhitelist":["AVX","AVX2"]}}}}'

-kubeconfig

The -kubeconfig flag specifies the kubeconfig to use for connecting to the Kubernetes API server. It is needed for manipulating NodeFeature objects. An empty value (which is also the default) implies in-cluster kubeconfig.

Default: empty

Example:

nfd-worker -kubeconfig ${HOME}/.kube/config

-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.

NOTE: This flag takes precedence over the core.featureSources configuration file option.

Default: all

Example:

nfd-worker -feature-sources=all,-pci

-label-sources

The -label-sources flag specifies a comma-separated list of enabled label 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 core.labelSources config file option, instead, allowing dynamic configurability.

NOTE: This flag takes precedence over the core.labelSources configuration file option.

Default: all

Example:

nfd-worker -label-sources=kernel,system,local

-metrics

DEPRECATED: Will be removed in NFD v0.17 and replaced by -port.

The -metrics flag specifies the port on which to expose Prometheus metrics. Setting this to 0 disables the metrics server on nfd-worker.

Default: 8081

Example:

nfd-worker -metrics=12345

-no-publish

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.

NOTE: This flag takes precedence over the core.noPublish configuration file option.

Default: false

Example:

nfd-worker -no-publish

-no-owner-refs

The -no-owner-refs flag disables setting the owner references to Pod of the NodeFeature object.

NOTE: This flag takes precedence over the core.noOwnerRefs configuration file option.

Default: false

Example:

nfd-worker -no-owner-refs

-oneshot

The -oneshot flag causes nfd-worker to exit after one pass of feature detection.

Default: false

Example:

nfd-worker -oneshot -no-publish

Logging

The following logging-related flags are inherited from the klog package.

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.

-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