</code></pre></div></div><h3id="-h--help">-h, -help</h3><p>Print usage and exit.</p><h3id="-version">-version</h3><p>Print version and exit.</p><h3id="-feature-gates">-feature-gates</h3><p>The <codeclass="language-plaintext highlighter-rouge notranslate">-feature-gates</code> flag is used to enable or disable non GA features. The list of available feature gates can be found in the <ahref="../feature-gates.md">feature gates documentation</a>.</p><p>Example:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>nfd-master <spanclass="nt">-feature-gates</span><spanclass="nv">NodeFeatureAPI</span><spanclass="o">=</span><spanclass="nb">false</span>
</code></pre></div></div><h3id="-prune">-prune</h3><p>The <codeclass="language-plaintext highlighter-rouge notranslate">-prune</code> flag is a sub-command like option for cleaning up the cluster. It causes nfd-master to remove all NFD related labels, annotations and extended resources from all Node objects of the cluster and exit.</p><h3id="-port">-port</h3><p>The <codeclass="language-plaintext highlighter-rouge notranslate">-port</code> flag specifies the TCP port that nfd-master listens for incoming requests.</p><p>Default: 8080</p><p>Example:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>nfd-master <spanclass="nt">-port</span><spanclass="o">=</span>443
</code></pre></div></div><h3id="-metrics">-metrics</h3><p>The <codeclass="language-plaintext highlighter-rouge notranslate">-metrics</code> flag specifies the port on which to expose <ahref="https://prometheus.io/">Prometheus</a> metrics. Setting this to 0 disables the metrics server on nfd-master.</p><p>Default: 8081</p><p>Example:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>nfd-master <spanclass="nt">-metrics</span><spanclass="o">=</span>12345
</code></pre></div></div><h3id="-instance">-instance</h3><p>The <codeclass="language-plaintext highlighter-rouge notranslate">-instance</code> flag makes it possible to run multiple NFD deployments in 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, <codeclass="language-plaintext highlighter-rouge notranslate">-</code>, <codeclass="language-plaintext highlighter-rouge notranslate">_</code> or <codeclass="language-plaintext highlighter-rouge notranslate">.</code>.</p><p>Default: <em>empty</em></p><p>Example:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>nfd-master <spanclass="nt">-instance</span><spanclass="o">=</span>network
</code></pre></div></div><h3id="-ca-file">-ca-file</h3><blockquote><p><strong>NOTE</strong> the gRPC API is deprecated and will be removed in a future release. and this flag will be removed as well.</p></blockquote><p>The <codeclass="language-plaintext highlighter-rouge notranslate">-ca-file</code> is one of the three flags (together with <codeclass="language-plaintext highlighter-rouge notranslate">-cert-file</code> and <codeclass="language-plaintext highlighter-rouge notranslate">-key-file</code>) controlling master-worker mutual TLS authentication on the nfd-master side. This flag specifies the TLS root certificate that is used for authenticating incoming connections. NFD-Worker side needs to have matching key and cert files configured for the incoming requests to be accepted.</p><p>Default: <em>empty</em></p><blockquote><p><strong>NOTE:</strong> Must be specified together with <codeclass="language-plaintext highlighter-rouge notranslate">-cert-file</code> and <codeclass="language-plaintext highlighter-rouge notranslate">-key-file</code></p></blockquote><p>Example:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>nfd-master <spanclass="nt">-ca-file</span><spanclass="o">=</span>/opt/nfd/ca.crt <spanclass="nt">-cert-file</span><spanclass="o">=</span>/opt/nfd/master.crt <spanclass="nt">-key-file</span><spanclass="o">=</span>/opt/nfd/master.key
</code></pre></div></div><h3id="-cert-file">-cert-file</h3><blockquote><p><strong>NOTE</strong> the gRPC API is deprecated and will be removed in a future release. and this flag will be removed as well.</p></blockquote><p>The <codeclass="language-plaintext highlighter-rouge notranslate">-cert-file</code> is one of the three flags (together with <codeclass="language-plaintext highlighter-rouge notranslate">-ca-file</code> and <codeclass="language-plaintext highlighter-rouge notranslate">-key-file</code>) controlling master-worker mutual TLS authentication on the nfd-master side. This flag specifies the TLS certificate presented for authenticating outgoing traffic towards nfd-worker.</p><p>Default: <em>empty</em></p><blockquote><p><strong>NOTE:</strong> Must be specified together with <codeclass="language-plaintext highlighter-rouge notranslate">-ca-file</code> and <codeclass="language-plaintext highlighter-rouge notranslate">-key-file</code></p></blockquote><p>Example:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>nfd-master <spanclass="nt">-cert-file</span><spanclass="o">=</span>/opt/nfd/master.crt <spanclass="nt">-key-file</span><spanclass="o">=</span>/opt/nfd/master.key <spanclass="nt">-ca-file</span><spanclass="o">=</span>/opt/nfd/ca.crt
</code></pre></div></div><h3id="-key-file">-key-file</h3><blockquote><p><strong>NOTE</strong> the gRPC API is deprecated and will be removed in a future release. and this flag will be removed as well.</p></blockquote><p>The <codeclass="language-plaintext highlighter-rouge notranslate">-key-file</code> is one of the three flags (together with <codeclass="language-plaintext highlighter-rouge notranslate">-ca-file</code> and <codeclass="language-plaintext highlighter-rouge notranslate">-cert-file</code>) controlling master-worker mutual TLS authentication on the nfd-master side. This flag specifies the private key corresponding the given certificate file (<codeclass="language-plaintext highlighter-rouge notranslate">-cert-file</code>) that is used for authenticating outgoing traffic.</p><p>Default: <em>empty</em></p><blockquote><p><strong>NOTE:</strong> Must be specified together with <codeclass="language-plaintext highlighter-rouge notranslate">-cert-file</code> and <codeclass="language-plaintext highlighter-rouge notranslate">-ca-file</code></p></blockquote><p>Example:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>nfd-master <spanclass="nt">-key-file</span><spanclass="o">=</span>/opt/nfd/master.key <spanclass="nt">-cert-file</span><spanclass="o">=</span>/opt/nfd/master.crt <spanclass="nt">-ca-file</span><spanclass="o">=</span>/opt/nfd/ca.crt
</code></pre></div></div><h3id="-verify-node-name">-verify-node-name</h3><blockquote><p><strong>NOTE</strong> the gRPC API is deprecated and will be removed in a future release. and this flag will be removed as well.</p></blockquote><p>The <codeclass="language-plaintext highlighter-rouge notranslate">-verify-node-name</code> flag controls the NodeName based authorization of incoming requests and only has effect when mTLS authentication has been enabled (with <codeclass="language-plaintext highlighter-rouge notranslate">-ca-file</code>, <codeclass="language-plaintext highlighter-rouge notranslate">-cert-file</code> and <codeclass="language-plaintext highlighter-rouge notranslate">-key-file</code>). If enabled, the worker node name of the incoming must match with the CN or a SAN in its TLS certificate. Thus, workers are only able to label the node they are running on (or the node whose certificate they present).</p><p>Node Name based authorization is disabled by default.</p><p>Default: <em>false</em></p><p>Example:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>nfd-master <spanclass="nt">-verify-node-name</span><spanclass="nt">-ca-file</span><spanclass="o">=</span>/opt/nfd/ca.crt <spanclass="se">\</span>
</code></pre></div></div><h3id="-enable-nodefeature-api">-enable-nodefeature-api</h3><p><strong>DEPRECATED</strong>: will be removed in NFD v0.17. Use' <ahref="#-feature-gates"><codeclass="language-plaintext highlighter-rouge notranslate">-feature-gates</code></a><ahref="/node-feature-discovery/master/reference/feature-gates.html#nodefeatureapi">NodeFeatureAPI</a> instead.</p><blockquote><p><strong>NOTE</strong> the gRPC API is deprecated and will be removed in a future release.</p></blockquote><p>The <codeclass="language-plaintext highlighter-rouge notranslate">-enable-nodefeature-api</code> flag enables/disables the <ahref="/node-feature-discovery/master/usage/custom-resources.html#nodefeature">NodeFeature</a> CRD API for receiving feature requests. This will also automatically disable/enable the gRPC interface.</p><p>Default: true</p><p>Example:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>nfd-master <spanclass="nt">-enable-nodefeature-api</span><spanclass="o">=</span><spanclass="nb">false</span>
</code></pre></div></div><h3id="-enable-leader-election">-enable-leader-election</h3><p>The <codeclass="language-plaintext highlighter-rouge notranslate">-enable-leader-election</code> flag enables leader election for NFD-Master. It is advised to turn on this flag when running more than one instance of NFD-Master.</p><p>Does not have effect if the <ahref="/node-feature-discovery/master/reference/feature-gates.html#nodefeatureapi">NodeFeatureAPI</a> feature gate is disabled.</p><p>Default: false</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>nfd-master <spanclass="nt">-enable-leader-election</span>
</code></pre></div></div><h3id="-no-publish">-no-publish</h3><p>The <codeclass="language-plaintext highlighter-rouge notranslate">-no-publish</code> 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.</p><p>Default: <em>false</em></p><p>Example:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>nfd-master <spanclass="nt">-no-publish</span>
</code></pre></div></div><h3id="-crd-controller">-crd-controller</h3><blockquote><p><strong>NOTE</strong> This flag will be removed in a future release at the same time with the deprecated gRPC API.</p></blockquote><p>The <codeclass="language-plaintext highlighter-rouge notranslate">-crd-controller</code> flag specifies whether the NFD CRD API controller is enabled or not. The controller is responsible for processing <ahref="/node-feature-discovery/master/usage/custom-resources.html#nodefeature">NodeFeature</a> and <ahref="/node-feature-discovery/master/usage/custom-resources.html#nodefeaturerule">NodeFeatureRule</a> objects.</p><p>Default: <em>true</em></p><p>Example:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>nfd-master <spanclass="nt">-crd-controller</span><spanclass="o">=</span><spanclass="nb">false</span>
</code></pre></div></div><h3id="-featurerules-controller">-featurerules-controller</h3><p><strong>DEPRECATED</strong>: use <ahref="#-crd-controller"><codeclass="language-plaintext highlighter-rouge notranslate">-crd-controller</code></a> instead.</p><h3id="-label-whitelist">-label-whitelist</h3><p>The <codeclass="language-plaintext highlighter-rouge notranslate">-label-whitelist</code> specifies a regular expression for filtering feature labels based on their name. Each label must match against the given regular expression or it will not be published.</p><blockquote><p><strong>NOTE:</strong> 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.</p></blockquote><p>Default: <em>empty</em></p><p>Example:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>nfd-master <spanclass="nt">-label-whitelist</span><spanclass="o">=</span><spanclass="s1">'.*cpuid\.'</span>
</code></pre></div></div><h3id="-extra-label-ns">-extra-label-ns</h3><p>The <codeclass="language-plaintext highlighter-rouge notranslate">-extra-label-ns</code> flag specifies a comma-separated list of allowed feature label namespaces. This option can be used to allow other vendor or application specific namespaces for custom labels from the local and custom feature sources, even though these labels were denied using the <codeclass="language-plaintext highlighter-rouge notranslate">deny-label-ns</code> flag.</p><p>The same namespace control and this flag applies Extended Resources (created with <codeclass="language-plaintext highlighter-rouge notranslate">-resource-labels</code>), too.</p><p>Default: <em>empty</em></p><p>Example:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>nfd-master <spanclass="nt">-extra-label-ns</span><spanclass="o">=</span>vendor-1.com,vendor-2.io
</code></pre></div></div><h3id="-deny-label-ns">-deny-label-ns</h3><p>The <codeclass="language-plaintext highlighter-rouge notranslate">-deny-label-ns</code> flag specifies a comma-separated list of excluded label namespaces. By default, nfd-master allows creating labels in all namespaces, excluding <codeclass="language-plaintext highlighter-rouge notranslate">kubernetes.io</code> namespace and its sub-namespaces (i.e. <codeclass="language-plaintext highlighter-rouge notranslate">*.kubernetes.io</code>). However, you should note that <codeclass="language-plaintext highlighter-rouge notranslate">kubernetes.io</code> and its sub-namespaces are always denied. For example, <codeclass="language-plaintext highlighter-rouge notranslate">nfd-master -deny-label-ns=""</code> would still disallow <codeclass="language-plaintext highlighter-rouge notranslate">kubernetes.io</code> and <codeclass="language-plaintext highlighter-rouge notranslate">*.kubernetes.io</code>. This option can be used to exclude some vendors or application specific namespaces. Note that the namespaces <codeclass="language-plaintext highlighter-rouge notranslate">feature.node.kubernetes.io</code> and <codeclass="language-plaintext highlighter-rouge notranslate">profile.node.kubernetes.io</code> and their sub-namespaces are always allowed and cannot be denied.</p><p>Default: <em>empty</em></p><p>Example:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>nfd-master <spanclass="nt">-deny-label-ns</span><spanclass="o">=</span><spanclass="k">*</span>.vendor.com,vendor-2.io
</code></pre></div></div><h3id="-resource-labels">-resource-labels</h3><p><strong>DEPRECATED</strong>: <ahref="/node-feature-discovery/master/usage/custom-resources.html#nodefeaturerule">NodeFeatureRule</a> should be used for managing extended resources in NFD.</p><p>The <codeclass="language-plaintext highlighter-rouge notranslate">-resource-labels</code> flag specifies a comma-separated list of features to be advertised as extended resources instead of labels. Features that have integer values can be published as Extended Resources by listing them in this flag.</p><p>Default: <em>empty</em></p><p>Example:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>nfd-master <spanclass="nt">-resource-labels</span><spanclass="o">=</span>vendor-1.com/feature-1,vendor-2.io/feature-2
</code></pre></div></div><h3id="-config">-config</h3><p>The <codeclass="language-plaintext highlighter-rouge notranslate">-config</code> flag specifies the path of the nfd-master configuration file to use.</p><p>Default: /etc/kubernetes/node-feature-discovery/nfd-master.conf</p><p>Example:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>nfd-master <spanclass="nt">-config</span><spanclass="o">=</span>/opt/nfd/master.conf
</code></pre></div></div><h3id="-options">-options</h3><p>The <codeclass="language-plaintext highlighter-rouge notranslate">-options</code> 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:</p><p>Default: <em>empty</em></p><p>Example:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>nfd-master <spanclass="nt">-options</span><spanclass="o">=</span><spanclass="s1">'{"noPublish": true}'</span>
</code></pre></div></div><h3id="-nfd-api-parallelism">-nfd-api-parallelism</h3><p>The <codeclass="language-plaintext highlighter-rouge notranslate">-nfd-api-parallelism</code> flag can be used to specify the maximum number of concurrent node updates.</p><p>Does not have effect if the <ahref="/node-feature-discovery/master/reference/feature-gates.html#nodefeatureapi">NodeFeatureAPI</a> feature gate is disabled.</p><p>Default: 10</p><p>Example:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>nfd-master <spanclass="nt">-nfd-api-parallelism</span><spanclass="o">=</span>1
</code></pre></div></div><h3id="logging">Logging</h3><p>The following logging-related flags are inherited from the <ahref="https://pkg.go.dev/k8s.io/klog/v2">klog</a> package.</p><h4id="-add_dir_header">-add_dir_header</h4><p>If true, adds the file directory to the header of the log messages.</p><p>Default: false</p><h4id="-alsologtostderr">-alsologtostderr</h4><p>Log to standard error as well as files.</p><p>Default: false</p><h4id="-log_backtrace_at">-log_backtrace_at</h4><p>When logging hits line file:N, emit a stack trace.</p><p>Default: <em>empty</em></p><h4id="-log_dir">-log_dir</h4><p>If non-empty, write log files in this directory.</p><p>Default: <em>empty</em></p><h4id="-log_file">-log_file</h4><p>If non-empty, use this log file.</p><p>Default: <em>empty</em></p><h4id="-log_file_max_size">-log_file_max_size</h4><p>Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited.</p><p>Default: 1800</p><h4id="-logtostderr">-logtostderr</h4><p>Log to standard error instead of files</p><p>Default: true</p><h4id="-skip_headers">-skip_headers</h4><p>If true, avoid header prefixes in the log messages.</p><p>Default: false</p><h4id="-skip_log_headers">-skip_log_headers</h4><p>If true, avoid headers when opening log files.</p><p>Default: false</p><h4id="-stderrthreshold">-stderrthreshold</h4><p>Logs at or above this threshold go to stderr.</p><p>Default: 2</p><h4id="-v">-v</h4><p>Number for the log level verbosity.</p><p>Default: 0</p><h4id="-vmodule">-vmodule</h4><p>Comma-separated list of <codeclass="language-plaintext highlighter-rouge notranslate">pattern=N</code> settings for file-filtered logging.</p><p>Default: <em>empty</em></p><h3id="-resync-period">-resync-period</h3><p>The <codeclass="language-plaintext highlighter-rouge notranslate">-resync-period</code> 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).</p><p>Does not have effect if the <ahref="/node-feature-discovery/master/reference/feature-gates.html#nodefeatureapi">NodeFeatureAPI</a> feature gate is disabled.</p><p>Default: 1 hour.</p><p>Example:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>nfd-master <spanclass="nt">-resync-period</span><spanclass="o">=</span>2h