</span></code></pre></div></div></li></ol><p>In order to deploy the <ahref="#minimal">minimal</a> image you need to add</p><divclass="language-yaml highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code><spanclass="na">image</span><spanclass="pi">:</span><spanclass="s">gcr.io/k8s-staging-nfd/node-feature-discovery:master-minimal</span>
</code></pre></div></div><p>to the metadata of NodeFeatureDiscovery object above.</p><h3id="deployment-with-kustomize">Deployment with kustomize</h3><p>The kustomize overlays provided in the repo can be used directly:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>kubectl apply <spanclass="nt">-k</span> https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref<spanclass="o">=</span>master
</code></pre></div></div><p>This will required RBAC rules and deploy nfd-master (as a deployment) and nfd-worker (as a daemonset) in the <codeclass="language-plaintext highlighter-rouge notranslate">node-feature-discovery</code> namespace.</p><p>Alternatively you can clone the repository and customize the deployment by creating your own overlays. For example, to deploy the <ahref="#minimal">minimal</a> image. See <ahref="https://github.com/kubernetes-sigs/kustomize">kustomize</a> for more information about managing deployment configurations.</p><h4id="default-overlays">Default overlays</h4><p>The NFD repository hosts a set of overlays for different usages and deployment scenarios under <ahref="https://github.com/kubernetes-sigs/node-feature-discovery/blob/master/deployment/overlays"><codeclass="language-plaintext highlighter-rouge notranslate">deployment/overlays</code></a></p><ul><li><ahref="https://github.com/kubernetes-sigs/node-feature-discovery/blob/master/deployment/overlays/default"><codeclass="language-plaintext highlighter-rouge notranslate">default</code></a>: default deployment of nfd-worker as a daemonset, descibed above</li><li><ahref="https://github.com/kubernetes-sigs/node-feature-discovery/blob/master/deployment/overlays/default-combined"><codeclass="language-plaintext highlighter-rouge notranslate">default-combined</code></a> see <ahref="#master-worker-pod">Master-worker pod</a> below</li><li><ahref="https://github.com/kubernetes-sigs/node-feature-discovery/blob/master/deployment/overlays/default-job"><codeclass="language-plaintext highlighter-rouge notranslate">default-job</code></a>: see <ahref="#worker-one-shot">Worker one-shot</a> below</li><li><ahref="https://github.com/kubernetes-sigs/node-feature-discovery/blob/master/deployment/overlays/prune"><codeclass="language-plaintext highlighter-rouge notranslate">prune</code></a>: clean up the cluster after uninstallation, see <ahref="#removing-feature-labels">Removing feature labels</a></li><li><ahref="https://github.com/kubernetes-sigs/node-feature-discovery/blob/master/deployment/overlays/samples/cert-manager"><codeclass="language-plaintext highlighter-rouge notranslate">samples/cert-manager</code></a>: an example for supplementing the default deployment with cert-manager for TLS authentication, see <ahref="#automated-tls-certificate-management-using-cert-manager">Automated TLS certificate management using cert-manager</a> for details</li><li><ahref="https://github.com/kubernetes-sigs/node-feature-discovery/blob/master/deployment/overlays/samples/custom-rules"><codeclass="language-plaintext highlighter-rouge notranslate">samples/custom-rules</code></a>: an example for spicing up the default deployment with a separately managed configmap of custom labeling rules, see <ahref="#features.md#custom">Custom feature source</a> for more information about custom node labels</li></ul><h4id="master-worker-pod">Master-worker pod</h4><p>You can also run nfd-master and nfd-worker inside the same pod</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>kubectl apply <spanclass="nt">-k</span> https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default-combined?ref<spanclass="o">=</span>master
</code></pre></div></div><p>This creates a DaemonSet runs both nfd-worker and nfd-master in the same Pod. In this case no nfd-master is run on the master node(s), but, the worker nodes are able to label themselves which may be desirable e.g. in single-node setups.</p><h4id="worker-one-shot">Worker one-shot</h4><p>Feature discovery can alternatively be configured as a one-shot job. The <codeclass="language-plaintext highlighter-rouge notranslate">default-job</code> overlay may be used to achieve this:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code><spanclass="nv">NUM_NODES</span><spanclass="o">=</span><spanclass="si">$(</span>kubectl get no <spanclass="nt">-o</span><spanclass="nv">jsonpath</span><spanclass="o">=</span><spanclass="s1">'{.items[*].metadata.name}'</span> | <spanclass="nb">wc</span><spanclass="nt">-w</span><spanclass="si">)</span>
</code></pre></div></div><p>The example above launces as many jobs as there are non-master nodes. Note that this approach does not guarantee running once on every node. For example, tainted, non-ready nodes or some other reasons in Job scheduling may cause some node(s) will run extra job instance(s) to satisfy the request.</p><h3id="deployment-with-helm">Deployment with Helm</h3><p>Node Feature Discovery Helm chart allow to easily deploy and manage NFD.</p><h4id="prerequisites">Prerequisites</h4><p><ahref="https://helm.sh/">Helm package manager</a> should be installed.</p><h4id="deployment">Deployment</h4><p>To install the latest stable version:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code><spanclass="nb">export </span><spanclass="nv">NFD_NS</span><spanclass="o">=</span>node-feature-discovery
</code></pre></div></div><p>To install the latest development version you need to clone the NFD Git repository and install from there.</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>git clone https://github.com/kubernetes-sigs/node-feature-discovery/
</code></pre></div></div><p>See the <ahref="#configuration">configuration</a> section below for instructions how to alter the deployment parameters.</p><p>In order to deploy the <ahref="#minimal">minimal</a> image you need to override the image tag:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>helm <spanclass="nb">install </span>node-feature-discovery ./node-feature-discovery/ <spanclass="nt">--set</span> image.tag<spanclass="o">=</span>master-minimal <spanclass="nt">--namespace</span><spanclass="nv">$NFD_NS</span><spanclass="nt">--create-namespace</span>
</code></pre></div></div><h4id="configuration">Configuration</h4><p>You can override values from <codeclass="language-plaintext highlighter-rouge notranslate">values.yaml</code> and provide a file with custom values:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code><spanclass="nb">export </span><spanclass="nv">NFD_NS</span><spanclass="o">=</span>node-feature-discovery
</code></pre></div></div><p>To specify each parameter separately you can provide them to helm install command:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code><spanclass="nb">export </span><spanclass="nv">NFD_NS</span><spanclass="o">=</span>node-feature-discovery
</code></pre></div></div><p>The command removes all the Kubernetes components associated with the chart and deletes the release.</p><h4id="chart-parameters">Chart parameters</h4><p>In order to tailor the deployment of the Node Feature Discovery to your cluster needs We have introduced the following Chart parameters.</p><h5id="general-parameters">General parameters</h5><table><thead><tr><th>Name</th><th>Type</th><th>Default</th><th>description</th></tr></thead><tbody><tr><td><codeclass="language-plaintext highlighter-rouge notranslate">image.repository</code></td><td>string</td><td><codeclass="language-plaintext highlighter-rouge notranslate">gcr.io/k8s-staging-nfd/node-feature-discovery</code></td><td>NFD image repository</td></tr><tr><td><codeclass="language-plaintext highlighter-rouge notranslate">image.tag</code></td><td>string</td><td><codeclass="language-plaintext highlighter-rouge notranslate">master</code></td><td>NFD image tag</td></tr><tr><td><codeclass="language-plaintext highlighter-rouge notranslate">image.pullPolicy</code></td><td>string</td><td><codeclass="language-plaintext highlighter-rouge notranslate">Always</code></td><td>Image pull policy</td></tr><tr><td><codeclass="language-plaintext highlighter-rouge notranslate">imagePullSecrets</code></td><td>list</td><td>[]</td><td>ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. <ahref="https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod">More info</a></td></tr><tr><td><codeclass="language-plaintext highlighter-rouge notranslate">serviceAccount.create</code></td><td>bool</td><td>true</td><td>Specifies whether a service account should be created</td></tr><tr><td><codeclass="language-plaintext highlighter-rouge notranslate">serviceAccount.annotations</code></td><td>dict</td><td>{}</td><td>Annotations to add to the service account</td></tr><tr><td><codeclass="language-plaintext highlighter-rouge notranslate">serviceAccount.name</code></td><td>string</td><td></td><td>The name of the service account to use. If not set and create is true, a name is generated using the fullname template</td></tr><tr><td><codeclass="language-plaintext highlighter-rouge notranslate">rbac</code></td><td>dict</td><td></td><td>RBAC <ahref="https://kubernetes.io/docs/reference/access-authn-authz/rbac/">parameteres</a></td></tr><tr><td><codeclass="language-plaintext highlighter-rouge notranslate">nameOverride</code></td><td>string</td><td></td><td>Override the name of the chart</td></tr><tr><td><codeclass="language-plaintext highlighter-rouge notranslate">fullnameOverride</code></td><td>string</td><td></td><td>Override a default fully qualified app name</td></tr></tbody></table><h5id="master-pod-parameters">Master pod parameters</h5><table><thead><tr><th>Name</th><th>Type</th><th>Default</th><th>description</th></tr></thead><tbody><tr><td><codeclass="language-plaintext highlighter-rouge notranslate">master.*</code></td><td>dict</td><td></td><td>NFD master deployment configuration</td></tr><tr><td><codeclass="language-plaintext highlighter-rouge notranslate">master.instance</code></td><td>string</td><td></td><td>Instance name. Used to separate annotation namespaces for multiple parallel deployments</td></tr><tr><td><codeclass="language-plaintext highlighter-rouge notranslate">master.extraLabelNs</code></td><td>array</td><td>[]</td><td>List of allowed extra label namespaces</td></tr><tr><td><codeclass="language-plaintext highlighter-rouge notranslate">master.replicaCount</code></td><td>integer</td><td>1</td><td>Number of desired pods. This is a pointer to distinguish between explicit zero and not specified</td></tr><tr><td><codeclass="langua
</code></pre></div></div><h2id="worker-configuration">Worker configuration</h2><p>NFD-Worker supports dynamic configuration through a configuration file. The default location is <codeclass="language-plaintext highlighter-rouge notranslate">/etc/kubernetes/node-feature-discovery/nfd-worker.conf</code>, but, this can be changed by specifying the<codeclass="language-plaintext highlighter-rouge notranslate">-config</code> command line flag. Configuration file is re-read whenever it is modified which makes run-time re-configuration of nfd-worker straightforward.</p><p>Worker configuration file is read inside the container, and thus, Volumes and VolumeMounts are needed to make your configuration available for NFD. The preferred method is to use a ConfigMap which provides easy deployment and re-configurability.</p><p>The provided nfd-worker deployment templates create an empty configmap and mount it inside the nfd-worker containers. Configuration can be edited with:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>kubectl <spanclass="nt">-n</span><spanclass="k">${</span><spanclass="nv">NFD_NS</span><spanclass="k">}</span> edit configmap nfd-worker-conf
</code></pre></div></div><p>See <ahref="/node-feature-discovery/master/advanced/worker-configuration-reference.html">nfd-worker configuration file reference</a> for more details. The (empty-by-default) <ahref="https://github.com/kubernetes-sigs/node-feature-discovery/blob/master/deployment/components/worker-config/nfd-worker.conf.example">example config</a> contains all available configuration options and can be used as a reference for creating creating a configuration.</p><p>Configuration options can also be specified via the <codeclass="language-plaintext highlighter-rouge notranslate">-options</code> command line flag, in which case no mounts need to be used. The same format as in the config file must be used, i.e. JSON (or YAML). For example:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code><spanclass="nt">-options</span><spanclass="o">=</span><spanclass="s1">'{"sources": { "pci": { "deviceClassWhitelist": ["12"] } } }'</span>
</code></pre></div></div><p>Configuration options specified from the command line will override those read from the config file.</p><h2id="using-node-labels">Using node labels</h2><p>Nodes with specific features can be targeted using the <codeclass="language-plaintext highlighter-rouge notranslate">nodeSelector</code> field. The following example shows how to target nodes with Intel TurboBoost enabled.</p><divclass="language-yaml highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code><spanclass="na">apiVersion</span><spanclass="pi">:</span><spanclass="s">v1</span>
</code></pre></div></div><p>For more details on targeting nodes, see <ahref="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/">node selection</a>.</p><h2id="uninstallation">Uninstallation</h2><h3id="operator-was-used-for-deployment">Operator was used for deployment</h3><p>If you followed the deployment instructions above you can simply do:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>kubectl <spanclass="nt">-n</span> nfd delete NodeFeatureDiscovery my-nfd-deployment
</code></pre></div></div><p>Optionally, you can also remove the namespace:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>kubectl delete ns nfd
</code></pre></div></div><p>See the <ahref="https://github.com/kubernetes-sigs/node-feature-discovery-operator">node-feature-discovery-operator</a> and <ahref="https://github.com/operator-framework/operator-lifecycle-manager">OLM</a> project documentation for instructions for uninstalling the operator and operator lifecycle manager, respectively.</p><h3id="manual">Manual</h3><p>Simplest way is to invoke <codeclass="language-plaintext highlighter-rouge notranslate">kubectl delete</code> on the deployment files you used. Beware that this will also delete the namespace that NFD is running in. For example, in case the default deployment from the repo was used:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>
</code></pre></div></div><p>Alternatively you can delete create objects one-by-one, depending on the type of deployment, for example:</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code><spanclass="nv">NFD_NS</span><spanclass="o">=</span>node-feature-discovery
</code></pre></div></div><h3id="removing-feature-labels">Removing feature labels</h3><p>NFD-Master has a special <codeclass="language-plaintext highlighter-rouge notranslate">-prune</code> command line flag for removing all nfd-related node labels, annotations and extended resources from the cluster.</p><divclass="language-bash highlighter-rouge notranslate"><divclass="highlight"><preclass="highlight"><code>kubectl apply <spanclass="nt">-k</span> https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/prune?ref<spanclass="o">=</span>master