1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00
node-feature-discovery/v0.11/data.json
Github Actions 1752420a3c Update documentation for v0.11
Auto-generated from v0.11.2-12-g317c1a06 by 'update-gh-pages.sh'
2022-11-01 07:22:12 +00:00

1 line
No EOL
278 KiB
JSON
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[{"title":"Developer guide","layout":"default","sort":1,"content":"<h1 class=\"no_toc\" id=\"developer-guide\">Developer guide</h1>\n\n<h2 class=\"no_toc text-delta\" id=\"table-of-contents\">Table of contents</h2>\n\n<ol id=\"markdown-toc\">\n <li><a href=\"#building-from-source\" id=\"markdown-toc-building-from-source\">Building from source</a> <ol>\n <li><a href=\"#download-the-source-code\" id=\"markdown-toc-download-the-source-code\">Download the source code</a></li>\n <li><a href=\"#docker-build\" id=\"markdown-toc-docker-build\">Docker build</a></li>\n <li><a href=\"#docker-multi-arch-builds-with-buildx\" id=\"markdown-toc-docker-multi-arch-builds-with-buildx\">Docker multi-arch builds with buildx</a></li>\n <li><a href=\"#deployment\" id=\"markdown-toc-deployment\">Deployment</a></li>\n <li><a href=\"#building-locally\" id=\"markdown-toc-building-locally\">Building locally</a></li>\n <li><a href=\"#customizing-the-build\" id=\"markdown-toc-customizing-the-build\">Customizing the build</a></li>\n <li><a href=\"#testing\" id=\"markdown-toc-testing\">Testing</a></li>\n </ol>\n </li>\n <li><a href=\"#running-locally\" id=\"markdown-toc-running-locally\">Running locally</a> <ol>\n <li><a href=\"#nfd-master\" id=\"markdown-toc-nfd-master\">NFD-Master</a></li>\n <li><a href=\"#nfd-worker\" id=\"markdown-toc-nfd-worker\">NFD-Worker</a></li>\n <li><a href=\"#nfd-topology-updater\" id=\"markdown-toc-nfd-topology-updater\">NFD-Topology-Updater</a></li>\n </ol>\n </li>\n <li><a href=\"#documentation\" id=\"markdown-toc-documentation\">Documentation</a></li>\n</ol>\n\n<hr />\n\n<h2 id=\"building-from-source\">Building from source</h2>\n\n<h3 id=\"download-the-source-code\">Download the source code</h3>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>git clone https://github.com/kubernetes-sigs/node-feature-discovery\n<span class=\"nb\">cd </span>node-feature-discovery\n</code></pre> </div></div>\n\n<h3 id=\"docker-build\">Docker build</h3>\n\n<h4 id=\"build-the-container-image\">Build the container image</h4>\n\n<p>See <a href=\"#customizing-the-build\">customizing the build</a> below for altering the\ncontainer image registry, for example.</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>make\n</code></pre> </div></div>\n\n<h4 id=\"push-the-container-image\">Push the container image</h4>\n\n<p>Optional, this example with Docker.</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>docker push &lt;IMAGE_TAG&gt;\n</code></pre> </div></div>\n\n<h3 id=\"docker-multi-arch-builds-with-buildx\">Docker multi-arch builds with buildx</h3>\n\n<p>The default set of architectures enabled for mulit-arch builds are <code class=\"language-plaintext highlighter-rouge\">linux/amd64</code>\nand <code class=\"language-plaintext highlighter-rouge\">linux/arm64</code>. If more architectures are needed one can override the\n<code class=\"language-plaintext highlighter-rouge\">IMAGE_ALL_PLATFORMS</code> variable with a comma separated list of <code class=\"language-plaintext highlighter-rouge\">OS/ARCH</code> tuples.</p>\n\n<h4 id=\"build-the-manifest-list-with-a-container-image-per-arch\">Build the manifest-list with a container image per arch</h4>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>make image-all\n</code></pre> </div></div>\n\n<p>Currently <code class=\"language-plaintext highlighter-rouge\">docker</code> does not support loading of manifest-lists meaning the images\nare not shown when executing <code class=\"language-plaintext highlighter-rouge\">docker images</code>, see:\n<a href=\"https://github.com/docker/buildx/issues/59\">buildx issue #59</a>.</p>\n\n<h4 id=\"push-the-manifest-list-with-container-image-per-arch\">Push the manifest-list with container image per arch</h4>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>make push-all\n</code></pre> </div></div>\n\n<p>The resulting container image can be used in the same way on each arch by pulling\ne.g. <code class=\"language-plaintext highlighter-rouge\">node-feature-discovery:v0.11.0</code> without specifying the architecture. The\nmanifest-list will take care of providing the right architecture image.</p>\n\n<h4 id=\"change-the-job-spec-to-use-your-custom-image-optional\">Change the job spec to use your custom image (optional)</h4>\n\n<p>To use your published image from the step above instead of the\n<code class=\"language-plaintext highlighter-rouge\">k8s.gcr.io/nfd/node-feature-discovery</code> image, edit <code class=\"language-plaintext highlighter-rouge\">image</code>\nattribute in the spec template(s) to the new location\n(<code class=\"language-plaintext highlighter-rouge\">&lt;registry-name&gt;/&lt;image-name&gt;[:&lt;version&gt;]</code>).</p>\n\n<h3 id=\"deployment\">Deployment</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">yamls</code> makefile generates a <code class=\"language-plaintext highlighter-rouge\">kustomization.yaml</code> matching your locally\nbuilt image and using the <code class=\"language-plaintext highlighter-rouge\">deploy/overlays/default</code> deployment. See\n<a href=\"#customizing-the-build\">build customization</a> below for configurability, e.g.\nchanging the deployment namespace.</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">K8S_NAMESPACE</span><span class=\"o\">=</span>my-ns make yamls\nkubectl apply <span class=\"nt\">-k</span> <span class=\"nb\">.</span>\n</code></pre> </div></div>\n\n<p>You can use alternative deployment methods by modifying the auto-generated\nkustomization file. For example, deploying worker and master in the same pod by\npointing to <code class=\"language-plaintext highlighter-rouge\">deployment/overlays/default-combined</code>.</p>\n\n<h3 id=\"building-locally\">Building locally</h3>\n\n<p>You can also build the binaries locally</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>make build\n</code></pre> </div></div>\n\n<p>This will compile binaries under <code class=\"language-plaintext highlighter-rouge\">bin/</code></p>\n\n<h3 id=\"customizing-the-build\">Customizing the build</h3>\n\n<p>There are several Makefile variables that control the build process and the\nname of the resulting container image. The following are targeted targeted for\nbuild customization and they can be specified via environment variables or\nmakefile overrides.</p>\n\n<table>\n <thead>\n <tr>\n <th>Variable</th>\n <th>Description</th>\n <th>Default value</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>HOSTMOUNT_PREFIX</td>\n <td>Prefix of system directories for feature discovery (local builds)</td>\n <td>/ (<em>local builds</em>) /host- (<em>container builds</em>)</td>\n </tr>\n <tr>\n <td>IMAGE_BUILD_CMD</td>\n <td>Command to build the image</td>\n <td>docker build</td>\n </tr>\n <tr>\n <td>IMAGE_BUILD_EXTRA_OPTS</td>\n <td>Extra options to pass to build command</td>\n <td><em>empty</em></td>\n </tr>\n <tr>\n <td>IMAGE_BUILDX_CMD</td>\n <td>Command to build and push multi-arch images with buildx</td>\n <td>DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build platform=${IMAGE_ALL_PLATFORMS} progress=auto pull</td>\n </tr>\n <tr>\n <td>IMAGE_ALL_PLATFORMS</td>\n <td>Comma seperated list of OS/ARCH tuples for mulit-arch builds</td>\n <td>linux/amd64,linux/arm64</td>\n </tr>\n <tr>\n <td>IMAGE_PUSH_CMD</td>\n <td>Command to push the image to remote registry</td>\n <td>docker push</td>\n </tr>\n <tr>\n <td>IMAGE_REGISTRY</td>\n <td>Container image registry to use</td>\n <td>k8s.gcr.io/nfd</td>\n </tr>\n <tr>\n <td>IMAGE_TAG_NAME</td>\n <td>Container image tag name</td>\n <td>&lt;nfd version&gt;</td>\n </tr>\n <tr>\n <td>IMAGE_EXTRA_TAG_NAMES</td>\n <td>Additional container image tag(s) to create when building image</td>\n <td><em>empty</em></td>\n </tr>\n <tr>\n <td>K8S_NAMESPACE</td>\n <td>nfd-master and nfd-worker namespace</td>\n <td>node-feature-discovery</td>\n </tr>\n <tr>\n <td>KUBECONFIG</td>\n <td>Kubeconfig for running e2e-tests</td>\n <td><em>empty</em></td>\n </tr>\n <tr>\n <td>E2E_TEST_CONFIG</td>\n <td>Parameterization file of e2e-tests (see <a href=\"https://github.com/kubernetes-sigs/node-feature-discovery/blob/v0.11.3/test/e2e/e2e-test-config.exapmle.yaml\">example</a>)</td>\n <td><em>empty</em></td>\n </tr>\n <tr>\n <td>OPENSHIFT</td>\n <td>Non-empty value enables OpenShift specific support (currently only effective in e2e tests)</td>\n <td><em>empty</em></td>\n </tr>\n <tr>\n <td>BASE_IMAGE_FULL</td>\n <td>Container base image for target image full (target full)</td>\n <td>debian:buster-slim</td>\n </tr>\n <tr>\n <td>BASE_IMAGE_MINIMAL</td>\n <td>Container base image for target image minimal (target minimal)</td>\n <td>gcr.io/distroless/base</td>\n </tr>\n </tbody>\n</table>\n\n<p>For example, to use a custom registry:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>make <span class=\"nv\">IMAGE_REGISTRY</span><span class=\"o\">=</span>&lt;my custom registry uri&gt;\n</code></pre> </div></div>\n\n<p>Or to specify a build tool different from Docker, It can be done in 2 ways:</p>\n\n<ol>\n <li>\n <p>via environment</p>\n\n <div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code> <span class=\"nv\">IMAGE_BUILD_CMD</span><span class=\"o\">=</span><span class=\"s2\">\"buildah bud\"</span> make\n</code></pre> </div> </div>\n </li>\n <li>\n <p>by overriding the variable value</p>\n\n <div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code> make <span class=\"nv\">IMAGE_BUILD_CMD</span><span class=\"o\">=</span><span class=\"s2\">\"buildah bud\"</span>\n</code></pre> </div> </div>\n </li>\n</ol>\n\n<h3 id=\"testing\">Testing</h3>\n\n<p>Unit tests are automatically run as part of the container image build. You can\nalso run them manually in the source code tree by simply running:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>make <span class=\"nb\">test</span>\n</code></pre> </div></div>\n\n<p>End-to-end tests are built on top of the e2e test framework of Kubernetes, and,\nthey required a cluster to run them on. For running the tests on your test\ncluster you need to specify the kubeconfig to be used:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>make e2e-test <span class=\"nv\">KUBECONFIG</span><span class=\"o\">=</span><span class=\"nv\">$HOME</span>/.kube/config\n</code></pre> </div></div>\n\n<h2 id=\"running-locally\">Running locally</h2>\n\n<p>You can run NFD locally, either directly on your host OS or in containers for\ntesting and development purposes. This may be useful e.g. for checking\nfeatures-detection.</p>\n\n<h3 id=\"nfd-master\">NFD-Master</h3>\n\n<p>When running as a standalone container labeling is expected to fail because\nKubernetes API is not available. Thus, it is recommended to use <code class=\"language-plaintext highlighter-rouge\">-no-publish</code>\ncommand line flag. E.g.</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">$ </span><span class=\"nb\">export </span><span class=\"nv\">NFD_CONTAINER_IMAGE</span><span class=\"o\">=</span>k8s.gcr.io/nfd/node-feature-discovery:v0.11.3\n<span class=\"nv\">$ </span>docker run <span class=\"nt\">--rm</span> <span class=\"nt\">--name</span><span class=\"o\">=</span>nfd-test <span class=\"k\">${</span><span class=\"nv\">NFD_CONTAINER_IMAGE</span><span class=\"k\">}</span> nfd-master <span class=\"nt\">-no-publish</span>\n2019/02/01 14:48:21 Node Feature Discovery Master &lt;NFD_VERSION&gt;\n2019/02/01 14:48:21 gRPC server serving on port: 8080\n</code></pre> </div></div>\n\n<h3 id=\"nfd-worker\">NFD-Worker</h3>\n\n<p>In order to run nfd-worker as a “stand-alone” container against your\nstandalone nfd-master you need to run them in the same network namespace:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">$ </span>docker run <span class=\"nt\">--rm</span> <span class=\"nt\">--network</span><span class=\"o\">=</span>container:nfd-test <span class=\"k\">${</span><span class=\"nv\">NFD_CONTAINER_IMAGE</span><span class=\"k\">}</span> nfd-worker\n2019/02/01 14:48:56 Node Feature Discovery Worker &lt;NFD_VERSION&gt;\n...\n</code></pre> </div></div>\n\n<p>If you just want to try out feature discovery without connecting to nfd-master,\npass the <code class=\"language-plaintext highlighter-rouge\">-no-publish</code> flag to nfd-worker.</p>\n\n<p><strong>NOTE</strong> Some feature sources need certain directories and/or files from the\nhost mounted inside the NFD container. Thus, you need to provide Docker with the\ncorrect <code class=\"language-plaintext highlighter-rouge\">--volume</code> options in order for them to work correctly when run\nstand-alone directly with <code class=\"language-plaintext highlighter-rouge\">docker run</code>. See the\n<a href=\"https://github.com/kubernetes-sigs/node-feature-discovery/blob/v0.11.3/deployment/components/common/worker-mounts.yaml\">default deployment</a>\nfor up-to-date information about the required volume mounts.</p>\n\n<h3 id=\"nfd-topology-updater\">NFD-Topology-Updater</h3>\n\n<p>In order to run nfd-topology-updater as a “stand-alone” container against your\nstandalone nfd-master you need to run them in the same network namespace:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">$ </span>docker run <span class=\"nt\">--rm</span> <span class=\"nt\">--network</span><span class=\"o\">=</span>container:nfd-test <span class=\"k\">${</span><span class=\"nv\">NFD_CONTAINER_IMAGE</span><span class=\"k\">}</span> nfd-topology-updater\n2019/02/01 14:48:56 Node Feature Discovery Topology Updater &lt;NFD_VERSION&gt;\n...\n</code></pre> </div></div>\n\n<p>If you just want to try out feature discovery without connecting to nfd-master,\npass the <code class=\"language-plaintext highlighter-rouge\">-no-publish</code> flag to nfd-topology-updater.</p>\n\n<p>NOTE:</p>\n\n<p>NFD topology updater needs certain directories and/or files from the\nhost mounted inside the NFD container. Thus, you need to provide Docker with the\ncorrect <code class=\"language-plaintext highlighter-rouge\">--volume</code> options in order for them to work correctly when run\nstand-alone directly with <code class=\"language-plaintext highlighter-rouge\">docker run</code>. See the\n<a href=\"https://github.com/kubernetes-sigs/node-feature-discovery/blob/v0.11.3/deployment/components/topology-updater/topologyupdater-mounts.yaml\">template spec</a>\nfor up-to-date information about the required volume mounts.</p>\n\n<p><a href=\"https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/#monitoring-device-plugin-resources\">PodResource API</a> is a prerequisite for nfd-topology-updater.\nPreceding Kubernetes v1.23, the <code class=\"language-plaintext highlighter-rouge\">kubelet</code> must be started with the following flag:\n<code class=\"language-plaintext highlighter-rouge\">--feature-gates=KubeletPodResourcesGetAllocatable=true</code>.\nStarting Kubernetes v1.23, the <code class=\"language-plaintext highlighter-rouge\">GetAllocatableResources</code> is enabled by default\nthrough <code class=\"language-plaintext highlighter-rouge\">KubeletPodResourcesGetAllocatable</code> <a href=\"https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates\">feature gate</a>.</p>\n\n<h2 id=\"documentation\">Documentation</h2>\n\n<p>All documentation resides under the\n<a href=\"https://github.com/kubernetes-sigs/node-feature-discovery/tree/v0.11.3/docs\">docs</a>\ndirectory in the source tree. It is designed to be served as a html site by\n<a href=\"https://pages.github.com/\">GitHub Pages</a>.</p>\n\n<p>Building the documentation is containerized in order to fix the build\nenvironment. The recommended way for developing documentation is to run:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>make site-serve\n</code></pre> </div></div>\n\n<p>This will build the documentation in a container and serve it under\n<a href=\"http://localhost:4000/\">localhost:4000/</a> making it easy to verify the results.\nAny changes made to the <code class=\"language-plaintext highlighter-rouge\">docs/</code> will automatically re-trigger a rebuild and are\nreflected in the served content and can be inspected with a simple browser\nrefresh.</p>\n\n<p>In order to just build the html documentation run:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>make site-build\n</code></pre> </div></div>\n\n<p>This will generate html documentation under <code class=\"language-plaintext highlighter-rouge\">docs/_site/</code>.</p>\n\n<!-- Links -->\n","dir":"/advanced/","name":"developer-guide.md","path":"advanced/developer-guide.md","url":"/advanced/developer-guide.html"},{"title":"Get started","layout":"default","sort":1,"content":"<h1 id=\"node-feature-discovery\">Node Feature Discovery</h1>\n\n<p>Welcome to Node Feature Discovery a Kubernetes add-on for detecting hardware\nfeatures and system configuration!</p>\n\n<p>Continue to:</p>\n\n<ul>\n <li>\n <p><strong><a href=\"/node-feature-discovery/v0.11/get-started/introduction.html\">Introduction</a></strong> for more details on the\nproject.</p>\n </li>\n <li>\n <p><strong><a href=\"/node-feature-discovery/v0.11/get-started/quick-start.html\">Quick start</a></strong> for quick step-by-step\ninstructions on how to get NFD running on your cluster.</p>\n </li>\n</ul>\n\n<h2 id=\"quick-start--the-short-short-version\">Quick-start the short-short version</h2>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">$ </span>kubectl apply <span class=\"nt\">-k</span> https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref<span class=\"o\">=</span>v0.11.3\n namespace/node-feature-discovery created\n serviceaccount/nfd-master created\n clusterrole.rbac.authorization.k8s.io/nfd-master created\n clusterrolebinding.rbac.authorization.k8s.io/nfd-master created\n configmap/nfd-worker-conf created\n service/nfd-master created\n deployment.apps/nfd-master created\n daemonset.apps/nfd-worker created\n\n<span class=\"nv\">$ </span>kubectl <span class=\"nt\">-n</span> node-feature-discovery get all\n NAME READY STATUS RESTARTS AGE\n pod/nfd-master-555458dbbc-sxg6w 1/1 Running 0 56s\n pod/nfd-worker-mjg9f 1/1 Running 0 17s\n...\n\n<span class=\"nv\">$ </span>kubectl get nodes <span class=\"nt\">-o</span> json | jq .items[].metadata.labels\n <span class=\"o\">{</span>\n <span class=\"s2\">\"beta.kubernetes.io/arch\"</span>: <span class=\"s2\">\"amd64\"</span>,\n <span class=\"s2\">\"beta.kubernetes.io/os\"</span>: <span class=\"s2\">\"linux\"</span>,\n <span class=\"s2\">\"feature.node.kubernetes.io/cpu-cpuid.ADX\"</span>: <span class=\"s2\">\"true\"</span>,\n <span class=\"s2\">\"feature.node.kubernetes.io/cpu-cpuid.AESNI\"</span>: <span class=\"s2\">\"true\"</span>,\n...\n\n</code></pre> </div></div>\n","dir":"/get-started/","name":"index.md","path":"get-started/index.md","url":"/get-started/"},{"title":"Introduction","layout":"default","sort":1,"content":"<h1 class=\"no_toc\" id=\"introduction\">Introduction</h1>\n\n<h2 class=\"no_toc text-delta\" id=\"table-of-contents\">Table of contents</h2>\n\n<ol id=\"markdown-toc\">\n <li><a href=\"#nfd-master\" id=\"markdown-toc-nfd-master\">NFD-Master</a></li>\n <li><a href=\"#nfd-worker\" id=\"markdown-toc-nfd-worker\">NFD-Worker</a></li>\n <li><a href=\"#nfd-topology-updater\" id=\"markdown-toc-nfd-topology-updater\">NFD-Topology-Updater</a></li>\n <li><a href=\"#feature-discovery\" id=\"markdown-toc-feature-discovery\">Feature Discovery</a></li>\n <li><a href=\"#node-annotations\" id=\"markdown-toc-node-annotations\">Node annotations</a></li>\n <li><a href=\"#noderesourcetopology-cr\" id=\"markdown-toc-noderesourcetopology-cr\">NodeResourceTopology CR</a></li>\n</ol>\n\n<hr />\n\n<p>This software enables node feature discovery for Kubernetes. It detects\nhardware features available on each node in a Kubernetes cluster, and\nadvertises those features using node labels.</p>\n\n<p>NFD consists of three software components:</p>\n\n<ol>\n <li>nfd-master</li>\n <li>nfd-worker</li>\n <li>nfd-topology-updater</li>\n</ol>\n\n<h2 id=\"nfd-master\">NFD-Master</h2>\n\n<p>NFD-Master is the daemon responsible for communication towards the Kubernetes\nAPI. That is, it receives labeling requests from the worker and modifies node\nobjects accordingly.</p>\n\n<h2 id=\"nfd-worker\">NFD-Worker</h2>\n\n<p>NFD-Worker is a daemon responsible for feature detection. It then communicates\nthe information to nfd-master which does the actual node labeling. One\ninstance of nfd-worker is supposed to be running on each node of the cluster,</p>\n\n<h2 id=\"nfd-topology-updater\">NFD-Topology-Updater</h2>\n\n<p>NFD-Topology-Updater is a daemon responsible for examining allocated\nresources on a worker node to account for resources available to be allocated\nto new pod on a per-zone basis (where a zone can be a NUMA node). It then\ncommunicates the information to nfd-master which does the\n<a href=\"#noderesourcetopology-cr\">NodeResourceTopology CR</a> creation corresponding\nto all the nodes in the cluster. One instance of nfd-topology-updater is\nsupposed to be running on each node of the cluster.</p>\n\n<h2 id=\"feature-discovery\">Feature Discovery</h2>\n\n<p>Feature discovery is divided into domain-specific feature sources:</p>\n\n<ul>\n <li>CPU</li>\n <li>Kernel</li>\n <li>Memory</li>\n <li>Network</li>\n <li>PCI</li>\n <li>Storage</li>\n <li>System</li>\n <li>USB</li>\n <li>Custom (rule-based custom features)</li>\n <li>Local (hooks for user-specific features)</li>\n <li>IOMMU (<em>deprecated</em>)</li>\n</ul>\n\n<p>Each feature source is responsible for detecting a set of features which. in\nturn, are turned into node feature labels. Feature labels are prefixed with\n<code class=\"language-plaintext highlighter-rouge\">feature.node.kubernetes.io/</code> and also contain the name of the feature source.\nNon-standard user-specific feature labels can be created with the local and\ncustom feature sources.</p>\n\n<p>An overview of the default feature labels:</p>\n\n<div class=\"language-json highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"p\">{</span><span class=\"w\">\n </span><span class=\"nl\">\"feature.node.kubernetes.io/cpu-&lt;feature-name&gt;\"</span><span class=\"p\">:</span><span class=\"w\"> </span><span class=\"s2\">\"true\"</span><span class=\"p\">,</span><span class=\"w\">\n </span><span class=\"nl\">\"feature.node.kubernetes.io/custom-&lt;feature-name&gt;\"</span><span class=\"p\">:</span><span class=\"w\"> </span><span class=\"s2\">\"true\"</span><span class=\"p\">,</span><span class=\"w\">\n </span><span class=\"nl\">\"feature.node.kubernetes.io/kernel-&lt;feature name&gt;\"</span><span class=\"p\">:</span><span class=\"w\"> </span><span class=\"s2\">\"&lt;feature value&gt;\"</span><span class=\"p\">,</span><span class=\"w\">\n </span><span class=\"nl\">\"feature.node.kubernetes.io/memory-&lt;feature-name&gt;\"</span><span class=\"p\">:</span><span class=\"w\"> </span><span class=\"s2\">\"true\"</span><span class=\"p\">,</span><span class=\"w\">\n </span><span class=\"nl\">\"feature.node.kubernetes.io/network-&lt;feature-name&gt;\"</span><span class=\"p\">:</span><span class=\"w\"> </span><span class=\"s2\">\"true\"</span><span class=\"p\">,</span><span class=\"w\">\n </span><span class=\"nl\">\"feature.node.kubernetes.io/pci-&lt;device label&gt;.present\"</span><span class=\"p\">:</span><span class=\"w\"> </span><span class=\"s2\">\"true\"</span><span class=\"p\">,</span><span class=\"w\">\n </span><span class=\"nl\">\"feature.node.kubernetes.io/storage-&lt;feature-name&gt;\"</span><span class=\"p\">:</span><span class=\"w\"> </span><span class=\"s2\">\"true\"</span><span class=\"p\">,</span><span class=\"w\">\n </span><span class=\"nl\">\"feature.node.kubernetes.io/system-&lt;feature name&gt;\"</span><span class=\"p\">:</span><span class=\"w\"> </span><span class=\"s2\">\"&lt;feature value&gt;\"</span><span class=\"p\">,</span><span class=\"w\">\n </span><span class=\"nl\">\"feature.node.kubernetes.io/usb-&lt;device label&gt;.present\"</span><span class=\"p\">:</span><span class=\"w\"> </span><span class=\"s2\">\"&lt;feature value&gt;\"</span><span class=\"p\">,</span><span class=\"w\">\n </span><span class=\"nl\">\"feature.node.kubernetes.io/&lt;file name&gt;-&lt;feature name&gt;\"</span><span class=\"p\">:</span><span class=\"w\"> </span><span class=\"s2\">\"&lt;feature value&gt;\"</span><span class=\"w\">\n</span><span class=\"p\">}</span><span class=\"w\">\n</span></code></pre> </div></div>\n\n<h2 id=\"node-annotations\">Node annotations</h2>\n\n<p>NFD also annotates nodes it is running on:</p>\n\n<table>\n <thead>\n <tr>\n <th>Annotation</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>[&lt;instance&gt;.]nfd.node.kubernetes.io/master.version</td>\n <td>Version of the nfd-master instance running on the node. Informative use only.</td>\n </tr>\n <tr>\n <td>[&lt;instance&gt;.]nfd.node.kubernetes.io/worker.version</td>\n <td>Version of the nfd-worker instance running on the node. Informative use only.</td>\n </tr>\n <tr>\n <td>[&lt;instance&gt;.]nfd.node.kubernetes.io/feature-labels</td>\n <td>Comma-separated list of node labels managed by NFD. NFD uses this internally so must not be edited by users.</td>\n </tr>\n <tr>\n <td>[&lt;instance&gt;.]nfd.node.kubernetes.io/extended-resources</td>\n <td>Comma-separated list of node extended resources managed by NFD. NFD uses this internally so must not be edited by users.</td>\n </tr>\n </tbody>\n</table>\n\n<p>NOTE: the <a href=\"/node-feature-discovery/v0.11/advanced/master-commandline-reference.html#instance\"><code class=\"language-plaintext highlighter-rouge\">-instance</code></a>\ncommand line flag affects the annotation names</p>\n\n<p>Unapplicable annotations are not created, i.e. for example master.version is\nonly created on nodes running nfd-master.</p>\n\n<h2 id=\"noderesourcetopology-cr\">NodeResourceTopology CR</h2>\n\n<p>When run with NFD-Topology-Updater, NFD creates CR instances corresponding to\nnode resource hardware topology such as:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">apiVersion</span><span class=\"pi\">:</span> <span class=\"s\">topology.node.k8s.io/v1alpha1</span>\n<span class=\"na\">kind</span><span class=\"pi\">:</span> <span class=\"s\">NodeResourceTopology</span>\n<span class=\"na\">metadata</span><span class=\"pi\">:</span>\n <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s\">node1</span>\n<span class=\"na\">topologyPolicies</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">SingleNUMANodeContainerLevel\"</span><span class=\"pi\">]</span>\n<span class=\"na\">zones</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s\">node-0</span>\n <span class=\"na\">type</span><span class=\"pi\">:</span> <span class=\"s\">Node</span>\n <span class=\"na\">resources</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s\">cpu</span>\n <span class=\"na\">capacity</span><span class=\"pi\">:</span> <span class=\"m\">20</span>\n <span class=\"na\">allocatable</span><span class=\"pi\">:</span> <span class=\"m\">16</span>\n <span class=\"na\">available</span><span class=\"pi\">:</span> <span class=\"m\">10</span>\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s\">vendor/nic1</span>\n <span class=\"na\">capacity</span><span class=\"pi\">:</span> <span class=\"m\">3</span>\n <span class=\"na\">allocatable</span><span class=\"pi\">:</span> <span class=\"m\">3</span>\n <span class=\"na\">available</span><span class=\"pi\">:</span> <span class=\"m\">3</span>\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s\">node-1</span>\n <span class=\"na\">type</span><span class=\"pi\">:</span> <span class=\"s\">Node</span>\n <span class=\"na\">resources</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s\">cpu</span>\n <span class=\"na\">capacity</span><span class=\"pi\">:</span> <span class=\"m\">30</span>\n <span class=\"na\">allocatable</span><span class=\"pi\">:</span> <span class=\"m\">30</span>\n <span class=\"na\">available</span><span class=\"pi\">:</span> <span class=\"m\">15</span>\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s\">vendor/nic2</span>\n <span class=\"na\">capacity</span><span class=\"pi\">:</span> <span class=\"m\">6</span>\n <span class=\"na\">allocatable</span><span class=\"pi\">:</span> <span class=\"m\">6</span>\n <span class=\"na\">available</span><span class=\"pi\">:</span> <span class=\"m\">6</span>\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s\">node-2</span>\n <span class=\"na\">type</span><span class=\"pi\">:</span> <span class=\"s\">Node</span>\n <span class=\"na\">resources</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s\">cpu</span>\n <span class=\"na\">capacity</span><span class=\"pi\">:</span> <span class=\"m\">30</span>\n <span class=\"na\">allocatable</span><span class=\"pi\">:</span> <span class=\"m\">30</span>\n <span class=\"na\">available</span><span class=\"pi\">:</span> <span class=\"m\">15</span>\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s\">vendor/nic1</span>\n <span class=\"na\">capacity</span><span class=\"pi\">:</span> <span class=\"m\">3</span>\n <span class=\"na\">allocatable</span><span class=\"pi\">:</span> <span class=\"m\">3</span>\n <span class=\"na\">available</span><span class=\"pi\">:</span> <span class=\"m\">3</span>\n</code></pre> </div></div>\n","dir":"/get-started/","name":"introduction.md","path":"get-started/introduction.md","url":"/get-started/introduction.html"},{"title":"Master cmdline reference","layout":"default","sort":2,"content":"<h1 class=\"no_toc\" id=\"commandline-flags-of-nfd-master\">Commandline flags of nfd-master</h1>\n\n<h2 class=\"no_toc text-delta\" id=\"table-of-contents\">Table of contents</h2>\n\n<ol id=\"markdown-toc\">\n <li><a href=\"#-h--help\" id=\"markdown-toc--h--help\">-h, -help</a></li>\n <li><a href=\"#-version\" id=\"markdown-toc--version\">-version</a></li>\n <li><a href=\"#-prune\" id=\"markdown-toc--prune\">-prune</a></li>\n <li><a href=\"#-port\" id=\"markdown-toc--port\">-port</a></li>\n <li><a href=\"#-instance\" id=\"markdown-toc--instance\">-instance</a></li>\n <li><a href=\"#-ca-file\" id=\"markdown-toc--ca-file\">-ca-file</a></li>\n <li><a href=\"#-cert-file\" id=\"markdown-toc--cert-file\">-cert-file</a></li>\n <li><a href=\"#-key-file\" id=\"markdown-toc--key-file\">-key-file</a></li>\n <li><a href=\"#-verify-node-name\" id=\"markdown-toc--verify-node-name\">-verify-node-name</a></li>\n <li><a href=\"#-no-publish\" id=\"markdown-toc--no-publish\">-no-publish</a></li>\n <li><a href=\"#-featurerules-controller\" id=\"markdown-toc--featurerules-controller\">-featurerules-controller</a></li>\n <li><a href=\"#-label-whitelist\" id=\"markdown-toc--label-whitelist\">-label-whitelist</a></li>\n <li><a href=\"#-extra-label-ns\" id=\"markdown-toc--extra-label-ns\">-extra-label-ns</a></li>\n <li><a href=\"#-resource-labels\" id=\"markdown-toc--resource-labels\">-resource-labels</a></li>\n <li><a href=\"#logging\" id=\"markdown-toc-logging\">Logging</a></li>\n</ol>\n\n<hr />\n\n<p>To quickly view available command line flags execute <code class=\"language-plaintext highlighter-rouge\">nfd-master -help</code>.\nIn a docker container:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>docker run k8s.gcr.io/nfd/node-feature-discovery:v0.11.3 nfd-master <span class=\"nt\">-help</span>\n</code></pre> </div></div>\n\n<h3 id=\"-h--help\">-h, -help</h3>\n\n<p>Print usage and exit.</p>\n\n<h3 id=\"-version\">-version</h3>\n\n<p>Print version and exit.</p>\n\n<h3 id=\"-prune\">-prune</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-prune</code> flag is a sub-command like option for cleaning up the cluster. It\ncauses nfd-master to remove all NFD related labels, annotations and extended\nresources from all Node objects of the cluster and exit.</p>\n\n<h3 id=\"-port\">-port</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-port</code> flag specifies the TCP port that nfd-master listens for incoming requests.</p>\n\n<p>Default: 8080</p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-master <span class=\"nt\">-port</span><span class=\"o\">=</span>443\n</code></pre> </div></div>\n\n<h3 id=\"-instance\">-instance</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-instance</code> flag makes it possible to run multiple NFD deployments in\nparallel. In practice, it separates the node annotations between deployments so\nthat each of them can store metadata independently. The instance name must\nstart and end with an alphanumeric character and may only contain alphanumeric\ncharacters, <code class=\"language-plaintext highlighter-rouge\">-</code>, <code class=\"language-plaintext highlighter-rouge\">_</code> or <code class=\"language-plaintext highlighter-rouge\">.</code>.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-master <span class=\"nt\">-instance</span><span class=\"o\">=</span>network\n</code></pre> </div></div>\n\n<h3 id=\"-ca-file\">-ca-file</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-ca-file</code> is one of the three flags (together with <code class=\"language-plaintext highlighter-rouge\">-cert-file</code> and\n<code class=\"language-plaintext highlighter-rouge\">-key-file</code>) controlling master-worker mutual TLS authentication on the\nnfd-master side. This flag specifies the TLS root certificate that is used for\nauthenticating incoming connections. NFD-Worker side needs to have matching key\nand cert files configured in order for the incoming requests to be accepted.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Note: Must be specified together with <code class=\"language-plaintext highlighter-rouge\">-cert-file</code> and <code class=\"language-plaintext highlighter-rouge\">-key-file</code></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-master <span class=\"nt\">-ca-file</span><span class=\"o\">=</span>/opt/nfd/ca.crt <span class=\"nt\">-cert-file</span><span class=\"o\">=</span>/opt/nfd/master.crt <span class=\"nt\">-key-file</span><span class=\"o\">=</span>/opt/nfd/master.key\n</code></pre> </div></div>\n\n<h3 id=\"-cert-file\">-cert-file</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-cert-file</code> is one of the three flags (together with <code class=\"language-plaintext highlighter-rouge\">-ca-file</code> and\n<code class=\"language-plaintext highlighter-rouge\">-key-file</code>) controlling master-worker mutual TLS authentication on the\nnfd-master side. This flag specifies the TLS certificate presented for\nauthenticating outgoing traffic towards nfd-worker.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Note: Must be specified together with <code class=\"language-plaintext highlighter-rouge\">-ca-file</code> and <code class=\"language-plaintext highlighter-rouge\">-key-file</code></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-master <span class=\"nt\">-cert-file</span><span class=\"o\">=</span>/opt/nfd/master.crt <span class=\"nt\">-key-file</span><span class=\"o\">=</span>/opt/nfd/master.key <span class=\"nt\">-ca-file</span><span class=\"o\">=</span>/opt/nfd/ca.crt\n</code></pre> </div></div>\n\n<h3 id=\"-key-file\">-key-file</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-key-file</code> is one of the three flags (together with <code class=\"language-plaintext highlighter-rouge\">-ca-file</code> and\n<code class=\"language-plaintext highlighter-rouge\">-cert-file</code>) controlling master-worker mutual TLS authentication on the\nnfd-master side. This flag specifies the private key corresponding the given\ncertificate file (<code class=\"language-plaintext highlighter-rouge\">-cert-file</code>) that is used for authenticating outgoing\ntraffic.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Note: Must be specified together with <code class=\"language-plaintext highlighter-rouge\">-cert-file</code> and <code class=\"language-plaintext highlighter-rouge\">-ca-file</code></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-master <span class=\"nt\">-key-file</span><span class=\"o\">=</span>/opt/nfd/master.key <span class=\"nt\">-cert-file</span><span class=\"o\">=</span>/opt/nfd/master.crt <span class=\"nt\">-ca-file</span><span class=\"o\">=</span>/opt/nfd/ca.crt\n</code></pre> </div></div>\n\n<h3 id=\"-verify-node-name\">-verify-node-name</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-verify-node-name</code> flag controls the NodeName based authorization of\nincoming requests and only has effect when mTLS authentication has been enabled\n(with <code class=\"language-plaintext highlighter-rouge\">-ca-file</code>, <code class=\"language-plaintext highlighter-rouge\">-cert-file</code> and <code class=\"language-plaintext highlighter-rouge\">-key-file</code>). If enabled, the worker node\nname of the incoming must match with the CN or a SAN in its TLS certificate. Thus,\nworkers are only able to label the node they are running on (or the node whose\ncertificate they present).</p>\n\n<p>Node Name based authorization is disabled by default.</p>\n\n<p>Default: <em>false</em></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-master <span class=\"nt\">-verify-node-name</span> <span class=\"nt\">-ca-file</span><span class=\"o\">=</span>/opt/nfd/ca.crt <span class=\"se\">\\</span>\n <span class=\"nt\">-cert-file</span><span class=\"o\">=</span>/opt/nfd/master.crt <span class=\"nt\">-key-file</span><span class=\"o\">=</span>/opt/nfd/master.key\n</code></pre> </div></div>\n\n<h3 id=\"-no-publish\">-no-publish</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-no-publish</code> flag disables updates to the Node objects in the Kubernetes\nAPI server, making a “dry-run” flag for nfd-master. No Labels, Annotations or\nExtendedResources of nodes are updated.</p>\n\n<p>Default: <em>false</em></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-master <span class=\"nt\">-no-publish</span>\n</code></pre> </div></div>\n\n<h3 id=\"-featurerules-controller\">-featurerules-controller</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-featurerules-controller</code> flag controlers the processing of\nNodeFeatureRule objects, effectively enabling/disabling labels from these\ncustom labeling rules.</p>\n\n<p>Default: <em>true</em></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-master <span class=\"nt\">-featurerules-controller</span><span class=\"o\">=</span><span class=\"nb\">false</span>\n</code></pre> </div></div>\n\n<h3 id=\"-label-whitelist\">-label-whitelist</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-label-whitelist</code> specifies a regular expression for filtering feature\nlabels based on their name. Each label must match against the given reqular\nexpression in order to be published.</p>\n\n<p>Note: The regular expression is only matches against the “basename” part of the\nlabel, i.e. to the part of the name after /. The label namespace is omitted.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-master <span class=\"nt\">-label-whitelist</span><span class=\"o\">=</span><span class=\"s1\">'.*cpuid\\.'</span>\n</code></pre> </div></div>\n\n<h3 id=\"-extra-label-ns\">-extra-label-ns</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-extra-label-ns</code> flag specifies a comma-separated list of allowed feature\nlabel namespaces. By default, nfd-master only allows creating labels in the\ndefault <code class=\"language-plaintext highlighter-rouge\">feature.node.kubernetes.io</code> and <code class=\"language-plaintext highlighter-rouge\">profile.node.kubernetes.io</code> label\nnamespaces and their sub-namespaces (e.g. <code class=\"language-plaintext highlighter-rouge\">vendor.feature.node.kubernetes.io</code>\nand <code class=\"language-plaintext highlighter-rouge\">sub.ns.profile.node.kubernetes.io</code>). This option can be used to allow\nother vendor or application specific namespaces for custom labels from the\nlocal and custom feature sources.</p>\n\n<p>The same namespace control and this flag applies Extended Resources (created\nwith <code class=\"language-plaintext highlighter-rouge\">-resource-labels</code>), too.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-master <span class=\"nt\">-extra-label-ns</span><span class=\"o\">=</span>vendor-1.com,vendor-2.io\n</code></pre> </div></div>\n\n<h3 id=\"-resource-labels\">-resource-labels</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-resource-labels</code> flag specifies a comma-separated list of features to be\nadvertised as extended resources instead of labels. Features that have integer\nvalues can be published as Extended Resources by listing them in this flag.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-master <span class=\"nt\">-resource-labels</span><span class=\"o\">=</span>vendor-1.com/feature-1,vendor-2.io/feature-2\n</code></pre> </div></div>\n\n<h3 id=\"logging\">Logging</h3>\n\n<p>The following logging-related flags are inherited from the\n<a href=\"https://pkg.go.dev/k8s.io/klog/v2\">klog</a> package.</p>\n\n<h4 id=\"-add_dir_header\">-add_dir_header</h4>\n\n<p>If true, adds the file directory to the header of the log messages.</p>\n\n<p>Default: false</p>\n\n<h4 id=\"-alsologtostderr\">-alsologtostderr</h4>\n\n<p>Log to standard error as well as files.</p>\n\n<p>Default: false</p>\n\n<h4 id=\"-log_backtrace_at\">-log_backtrace_at</h4>\n\n<p>When logging hits line file:N, emit a stack trace.</p>\n\n<p>Default: <em>empty</em></p>\n\n<h4 id=\"-log_dir\">-log_dir</h4>\n\n<p>If non-empty, write log files in this directory.</p>\n\n<p>Default: <em>empty</em></p>\n\n<h4 id=\"-log_file\">-log_file</h4>\n\n<p>If non-empty, use this log file.</p>\n\n<p>Default: <em>empty</em></p>\n\n<h4 id=\"-log_file_max_size\">-log_file_max_size</h4>\n\n<p>Defines the maximum size a log file can grow to. Unit is megabytes. If the\nvalue is 0, the maximum file size is unlimited.</p>\n\n<p>Default: 1800</p>\n\n<h4 id=\"-logtostderr\">-logtostderr</h4>\n\n<p>Log to standard error instead of files</p>\n\n<p>Default: true</p>\n\n<h4 id=\"-skip_headers\">-skip_headers</h4>\n\n<p>If true, avoid header prefixes in the log messages.</p>\n\n<p>Default: false</p>\n\n<h4 id=\"-skip_log_headers\">-skip_log_headers</h4>\n\n<p>If true, avoid headers when opening log files.</p>\n\n<p>Default: false</p>\n\n<h4 id=\"-stderrthreshold\">-stderrthreshold</h4>\n\n<p>Logs at or above this threshold go to stderr.</p>\n\n<p>Default: 2</p>\n\n<h4 id=\"-v\">-v</h4>\n\n<p>Number for the log level verbosity.</p>\n\n<p>Default: 0</p>\n\n<h4 id=\"-vmodule\">-vmodule</h4>\n\n<p>Comma-separated list of <code class=\"language-plaintext highlighter-rouge\">pattern=N</code> settings for file-filtered logging.</p>\n\n<p>Default: <em>empty</em></p>\n","dir":"/advanced/","name":"master-commandline-reference.md","path":"advanced/master-commandline-reference.md","url":"/advanced/master-commandline-reference.html"},{"title":"Advanced","layout":"default","sort":2,"content":"<h1 id=\"advanced\">Advanced</h1>\n\n<p>Advanced topics and reference.</p>\n","dir":"/advanced/","name":"index.md","path":"advanced/index.md","url":"/advanced/"},{"title":"Quick start","layout":"default","sort":2,"content":"<h1 id=\"quick-start\">Quick start</h1>\n\n<p>Minimal steps to deploy latest released version of NFD in your cluster.</p>\n\n<h2 id=\"installation\">Installation</h2>\n\n<p>Deploy with kustomize creates a new namespace, service and required RBAC\nrules and deploys nfd-master and nfd-worker daemons.</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>kubectl apply <span class=\"nt\">-k</span> https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref<span class=\"o\">=</span>v0.11.3\n</code></pre> </div></div>\n\n<h2 id=\"verify\">Verify</h2>\n\n<p>Wait until NFD master and NFD worker are running.</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">$ </span>kubectl <span class=\"nt\">-n</span> node-feature-discovery get ds,deploy\nNAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE\ndaemonset.apps/nfd-worker 2 2 2 2 2 &lt;none&gt; 10s\n\nNAME READY UP-TO-DATE AVAILABLE AGE\ndeployment.apps/nfd-master 1/1 1 1 17s\n\n</code></pre> </div></div>\n\n<p>Check that NFD feature labels have been created</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">$ </span>kubectl get no <span class=\"nt\">-o</span> json | jq .items[].metadata.labels\n<span class=\"o\">{</span>\n <span class=\"s2\">\"beta.kubernetes.io/arch\"</span>: <span class=\"s2\">\"amd64\"</span>,\n <span class=\"s2\">\"beta.kubernetes.io/os\"</span>: <span class=\"s2\">\"linux\"</span>,\n <span class=\"s2\">\"feature.node.kubernetes.io/cpu-cpuid.ADX\"</span>: <span class=\"s2\">\"true\"</span>,\n <span class=\"s2\">\"feature.node.kubernetes.io/cpu-cpuid.AESNI\"</span>: <span class=\"s2\">\"true\"</span>,\n <span class=\"s2\">\"feature.node.kubernetes.io/cpu-cpuid.AVX\"</span>: <span class=\"s2\">\"true\"</span>,\n...\n</code></pre> </div></div>\n\n<h2 id=\"use-node-labels\">Use node labels</h2>\n\n<p>Create a pod targeting a distinguishing feature (select a valid feature from\nthe list printed on the previous step)</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">$ </span><span class=\"nb\">cat</span> <span class=\"o\">&lt;&lt;</span> <span class=\"no\">EOF</span><span class=\"sh\"> | kubectl apply -f -\napiVersion: v1\nkind: Pod\nmetadata:\n name: feature-dependent-pod\nspec:\n containers:\n - image: k8s.gcr.io/pause\n name: pause\n nodeSelector:\n # Select a valid feature\n feature.node.kubernetes.io/cpu-cpuid.AESNI: 'true'\n</span><span class=\"no\">EOF\n</span>pod/feature-dependent-pod created\n</code></pre> </div></div>\n\n<p>See that the pod is running on a desired node</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">$ </span>kubectl get po feature-dependent-pod <span class=\"nt\">-o</span> wide\nNAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES\nfeature-dependent-pod 1/1 Running 0 23s 10.36.0.4 node-2 &lt;none&gt; &lt;none&gt;\n</code></pre> </div></div>\n\n<h2 id=\"additional-optional-installation-steps\">Additional Optional Installation Steps</h2>\n\n<p>In order to deploy nfd-master and nfd-topology-updater daemons\nuse <code class=\"language-plaintext highlighter-rouge\">topologyupdater</code> overlay.</p>\n\n<p>Deploy with kustomize creates a new namespace, service and required RBAC\nrules and nfd-master and nfd-topology-updater daemons.</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>kubectl apply <span class=\"nt\">-k</span> https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/topologyupdater?ref<span class=\"o\">=</span>v0.11.3\n</code></pre> </div></div>\n\n<p><strong>NOTE:</strong></p>\n\n<p><a href=\"https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/#monitoring-device-plugin-resources\">PodResource API</a> is a prerequisite for nfd-topology-updater.</p>\n\n<p>Preceding Kubernetes v1.23, the <code class=\"language-plaintext highlighter-rouge\">kubelet</code> must be started with the following flag:</p>\n\n<p><code class=\"language-plaintext highlighter-rouge\">--feature-gates=KubeletPodResourcesGetAllocatable=true</code></p>\n\n<p>Starting Kubernetes v1.23, the <code class=\"language-plaintext highlighter-rouge\">GetAllocatableResources</code> is enabled by default\nthrough <code class=\"language-plaintext highlighter-rouge\">KubeletPodResourcesGetAllocatable</code> <a href=\"https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates\">feature gate</a>.</p>\n\n<h2 id=\"verify-1\">Verify</h2>\n\n<p>Wait until NFD master and NFD topologyupdater are running.</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">$ </span>kubectl <span class=\"nt\">-n</span> node-feature-discovery get ds,deploy\nNAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE\ndaemonset.apps/nfd-topology-updater 2 2 2 2 2 &lt;none&gt; 5s\n\nNAME READY UP-TO-DATE AVAILABLE AGE\ndeployment.apps/nfd-master 1/1 1 1 17s\n\n</code></pre> </div></div>\n\n<p>Check that the NodeResourceTopology CR instances are created</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">$ </span>kubectl get noderesourcetopologies.topology.node.k8s.io\nNAME AGE\nkind-control-plane 23s\nkind-worker 23s\n</code></pre> </div></div>\n\n<h2 id=\"show-the-cr-instances\">Show the CR instances</h2>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">$ </span>kubectl describe noderesourcetopologies.topology.node.k8s.io kind-control-plane\nName: kind-control-plane\nNamespace: default\nLabels: &lt;none&gt;\nAnnotations: &lt;none&gt;\nAPI Version: topology.node.k8s.io/v1alpha1\nKind: NodeResourceTopology\n...\nTopology Policies:\n SingleNUMANodeContainerLevel\nZones:\n Name: node-0\n Costs:\n node-0: 10\n node-1: 20\n Resources:\n Name: Cpu\n Allocatable: 3\n Capacity: 3\n Available: 3\n Name: vendor/nic1\n Allocatable: 2\n Capacity: 2\n Available: 2\n Name: vendor/nic2\n Allocatable: 2\n Capacity: 2\n Available: 2\n Type: Node\n Name: node-1\n Costs:\n node-0: 20\n node-1: 10\n Resources:\n Name: Cpu\n Allocatable: 4\n Capacity: 4\n Available: 4\n Name: vendor/nic1\n Allocatable: 2\n Capacity: 2\n Available: 2\n Name: vendor/nic2\n Allocatable: 2\n Capacity: 2\n Available: 2\n Type: Node\nEvents: &lt;none&gt;\n</code></pre> </div></div>\n\n<p>The CR instances created can be used to gain insight into the allocatable\nresources along with the granularity of those resources at a per-zone level\n(represented by node-0 and node-1 in the above example) or can be used by an\nexternal entity (e.g. topology-aware scheduler plugin) to take an action based\non the gathered information.</p>\n\n<!-- Links -->\n","dir":"/get-started/","name":"quick-start.md","path":"get-started/quick-start.md","url":"/get-started/quick-start.html"},{"title":"Contributing","layout":"default","sort":3,"content":"<h1 id=\"contributing\">Contributing</h1>\n\n<hr />\n\n<h2 id=\"community\">Community</h2>\n\n<p>You can reach us via the following channels:</p>\n\n<ul>\n <li><a href=\"https://kubernetes.slack.com/messages/node-feature-discovery\">#node-feature-discovery</a>\nchannel in <a href=\"https://slack.k8s.io/\">Kubernetes Slack</a></li>\n <li><a href=\"https://groups.google.com/g/kubernetes-sig-node\">SIG-Node</a> mailing list</li>\n <li>File an\n<a href=\"https://github.com/kubernetes-sigs/node-feature-discovery/issues/new\">issue</a>\nin this repository</li>\n</ul>\n\n<h2 id=\"governance\">Governance</h2>\n\n<p>This is a\n<a href=\"https://github.com/kubernetes/community/blob/master/sig-node/README.md\">SIG-node</a>\nsubproject, hosted under the\n<a href=\"https://github.com/kubernetes-sigs\">Kubernetes SIGs</a> organization in Github.\nThe project was established in 2016 and was migrated to Kubernetes SIGs in 2018.</p>\n\n<h2 id=\"license\">License</h2>\n\n<p>This is open source software released under the <a href=\"LICENSE\">Apache 2.0 License</a>.</p>\n","dir":"/contributing/","name":"index.md","path":"contributing/index.md","url":"/contributing/"},{"title":"Worker cmdline reference","layout":"default","sort":3,"content":"<h1 class=\"no_toc\" id=\"commandline-flags-of-nfd-worker\">Commandline flags of nfd-worker</h1>\n\n<h2 class=\"no_toc text-delta\" id=\"table-of-contents\">Table of contents</h2>\n\n<ol id=\"markdown-toc\">\n <li><a href=\"#-h--help\" id=\"markdown-toc--h--help\">-h, -help</a></li>\n <li><a href=\"#-version\" id=\"markdown-toc--version\">-version</a></li>\n <li><a href=\"#-config\" id=\"markdown-toc--config\">-config</a></li>\n <li><a href=\"#-options\" id=\"markdown-toc--options\">-options</a></li>\n <li><a href=\"#-server\" id=\"markdown-toc--server\">-server</a></li>\n <li><a href=\"#-ca-file\" id=\"markdown-toc--ca-file\">-ca-file</a></li>\n <li><a href=\"#-cert-file\" id=\"markdown-toc--cert-file\">-cert-file</a></li>\n <li><a href=\"#-key-file\" id=\"markdown-toc--key-file\">-key-file</a></li>\n <li><a href=\"#-server-name-override\" id=\"markdown-toc--server-name-override\">-server-name-override</a></li>\n <li><a href=\"#-feature-sources\" id=\"markdown-toc--feature-sources\">-feature-sources</a></li>\n <li><a href=\"#-label-sources\" id=\"markdown-toc--label-sources\">-label-sources</a></li>\n <li><a href=\"#-sources\" id=\"markdown-toc--sources\">-sources</a></li>\n <li><a href=\"#-no-publish\" id=\"markdown-toc--no-publish\">-no-publish</a></li>\n <li><a href=\"#-label-whitelist\" id=\"markdown-toc--label-whitelist\">-label-whitelist</a></li>\n <li><a href=\"#-oneshot\" id=\"markdown-toc--oneshot\">-oneshot</a></li>\n <li><a href=\"#-sleep-interval\" id=\"markdown-toc--sleep-interval\">-sleep-interval</a></li>\n <li><a href=\"#logging\" id=\"markdown-toc-logging\">Logging</a></li>\n</ol>\n\n<hr />\n\n<p>To quickly view available command line flags execute <code class=\"language-plaintext highlighter-rouge\">nfd-worker -help</code>.\nIn a docker container:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>docker run k8s.gcr.io/nfd/node-feature-discovery:v0.11.3 nfd-worker <span class=\"nt\">-help</span>\n</code></pre> </div></div>\n\n<h3 id=\"-h--help\">-h, -help</h3>\n\n<p>Print usage and exit.</p>\n\n<h3 id=\"-version\">-version</h3>\n\n<p>Print version and exit.</p>\n\n<h3 id=\"-config\">-config</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-config</code> flag specifies the path of the nfd-worker configuration file to\nuse.</p>\n\n<p>Default: /etc/kubernetes/node-feature-discovery/nfd-worker.conf</p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-worker <span class=\"nt\">-config</span><span class=\"o\">=</span>/opt/nfd/worker.conf\n</code></pre> </div></div>\n\n<h3 id=\"-options\">-options</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-options</code> flag may be used to specify and override configuration file\noptions directly from the command line. The required format is the same as in\nthe config file i.e. JSON or YAML. Configuration options specified via this\nflag will override those from the configuration file:</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-worker <span class=\"nt\">-options</span><span class=\"o\">=</span><span class=\"s1\">'{\"sources\":{\"cpu\":{\"cpuid\":{\"attributeWhitelist\":[\"AVX\",\"AVX2\"]}}}}'</span>\n</code></pre> </div></div>\n\n<h3 id=\"-server\">-server</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-server</code> flag specifies the address of the nfd-master endpoint where to\nconnect to.</p>\n\n<p>Default: localhost:8080</p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-worker <span class=\"nt\">-server</span><span class=\"o\">=</span>nfd-master.nfd.svc.cluster.local:443\n</code></pre> </div></div>\n\n<h3 id=\"-ca-file\">-ca-file</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-ca-file</code> is one of the three flags (together with <code class=\"language-plaintext highlighter-rouge\">-cert-file</code> and\n<code class=\"language-plaintext highlighter-rouge\">-key-file</code>) controlling the mutual TLS authentication on the worker side.\nThis flag specifies the TLS root certificate that is used for verifying the\nauthenticity of nfd-master.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Note: Must be specified together with <code class=\"language-plaintext highlighter-rouge\">-cert-file</code> and <code class=\"language-plaintext highlighter-rouge\">-key-file</code></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-worker <span class=\"nt\">-ca-file</span><span class=\"o\">=</span>/opt/nfd/ca.crt <span class=\"nt\">-cert-file</span><span class=\"o\">=</span>/opt/nfd/worker.crt <span class=\"nt\">-key-file</span><span class=\"o\">=</span>/opt/nfd/worker.key\n</code></pre> </div></div>\n\n<h3 id=\"-cert-file\">-cert-file</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-cert-file</code> is one of the three flags (together with <code class=\"language-plaintext highlighter-rouge\">-ca-file</code> and\n<code class=\"language-plaintext highlighter-rouge\">-key-file</code>) controlling mutual TLS authentication on the worker side. This\nflag specifies the TLS certificate presented for authenticating outgoing\nrequests.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Note: Must be specified together with <code class=\"language-plaintext highlighter-rouge\">-ca-file</code> and <code class=\"language-plaintext highlighter-rouge\">-key-file</code></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-workerr <span class=\"nt\">-cert-file</span><span class=\"o\">=</span>/opt/nfd/worker.crt <span class=\"nt\">-key-file</span><span class=\"o\">=</span>/opt/nfd/worker.key <span class=\"nt\">-ca-file</span><span class=\"o\">=</span>/opt/nfd/ca.crt\n</code></pre> </div></div>\n\n<h3 id=\"-key-file\">-key-file</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-key-file</code> is one of the three flags (together with <code class=\"language-plaintext highlighter-rouge\">-ca-file</code> and\n<code class=\"language-plaintext highlighter-rouge\">-cert-file</code>) controlling the mutual TLS authentication on the worker side.\nThis flag specifies the private key corresponding the given certificate file\n(<code class=\"language-plaintext highlighter-rouge\">-cert-file</code>) that is used for authenticating outgoing requests.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Note: Must be specified together with <code class=\"language-plaintext highlighter-rouge\">-cert-file</code> and <code class=\"language-plaintext highlighter-rouge\">-ca-file</code></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-worker <span class=\"nt\">-key-file</span><span class=\"o\">=</span>/opt/nfd/worker.key <span class=\"nt\">-cert-file</span><span class=\"o\">=</span>/opt/nfd/worker.crt <span class=\"nt\">-ca-file</span><span class=\"o\">=</span>/opt/nfd/ca.crt\n</code></pre> </div></div>\n\n<h3 id=\"-server-name-override\">-server-name-override</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-server-name-override</code> flag specifies the common name (CN) which to\nexpect from the nfd-master TLS certificate. This flag is mostly intended for\ndevelopment and debugging purposes.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-worker <span class=\"nt\">-server-name-override</span><span class=\"o\">=</span>localhost\n</code></pre> </div></div>\n\n<h3 id=\"-feature-sources\">-feature-sources</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-feature-sources</code> flag specifies a comma-separated list of enabled feature\nsources. A special value <code class=\"language-plaintext highlighter-rouge\">all</code> enables all sources. Prefixing a source name\nwith <code class=\"language-plaintext highlighter-rouge\">-</code> indicates that the source will be disabled instead - this is only\nmeaningful when used in conjunction with <code class=\"language-plaintext highlighter-rouge\">all</code>. This command line flag allows\ncompletely disabling the feature detection so that neither standard feature\nlabels are generated nor the raw feature data is available for custom rule\nprocessing. Consider using the <code class=\"language-plaintext highlighter-rouge\">core.featureSources</code> config file option,\ninstead, allowing dynamic configurability.</p>\n\n<p>Note: This flag takes precedence over the <code class=\"language-plaintext highlighter-rouge\">core.featureSources</code> configuration\nfile option.</p>\n\n<p>Default: all</p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-worker <span class=\"nt\">-feature-sources</span><span class=\"o\">=</span>all,-pci\n</code></pre> </div></div>\n\n<h3 id=\"-label-sources\">-label-sources</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-label-sources</code> flag specifies a comma-separated list of enabled label\nsources. A special value <code class=\"language-plaintext highlighter-rouge\">all</code> enables all sources. Prefixing a source name\nwith <code class=\"language-plaintext highlighter-rouge\">-</code> indicates that the source will be disabled instead - this is only\nmeaningful when used in conjunction with <code class=\"language-plaintext highlighter-rouge\">all</code>. Consider using the\n<code class=\"language-plaintext highlighter-rouge\">core.labelSources</code> config file option, instead, allowing dynamic\nconfigurability.</p>\n\n<p>Note: This flag takes precedence over the <code class=\"language-plaintext highlighter-rouge\">core.labelSources</code> configuration\nfile option.</p>\n\n<p>Default: all</p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-worker <span class=\"nt\">-label-sources</span><span class=\"o\">=</span>kernel,system,local\n</code></pre> </div></div>\n\n<h3 id=\"-sources\">-sources</h3>\n\n<p><strong>DEPRECATED</strong>: use <a href=\"#-label-sources\"><code class=\"language-plaintext highlighter-rouge\">-label-sources</code></a> instead.</p>\n\n<h3 id=\"-no-publish\">-no-publish</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-no-publish</code> flag disables all communication with the nfd-master, making\nit a “dry-run” flag for nfd-worker. NFD-Worker runs feature detection normally,\nbut no labeling requests are sent to nfd-master.</p>\n\n<p>Default: <em>false</em></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-worker <span class=\"nt\">-no-publish</span>\n</code></pre> </div></div>\n\n<h3 id=\"-label-whitelist\">-label-whitelist</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-label-whitelist</code> specifies a regular expression for filtering feature\nlabels based on their name. Each label must match against the given reqular\nexpression in order to be published.</p>\n\n<p>Note: The regular expression is only matches against the “basename” part of the\nlabel, i.e. to the part of the name after /. The label namespace is omitted.</p>\n\n<p>Note: This flag takes precedence over the <code class=\"language-plaintext highlighter-rouge\">core.labelWhiteList</code> configuration\nfile option.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-worker <span class=\"nt\">-label-whitelist</span><span class=\"o\">=</span><span class=\"s1\">'.*cpuid\\.'</span>\n</code></pre> </div></div>\n\n<p><strong>DEPRECATED</strong>: you should use the <code class=\"language-plaintext highlighter-rouge\">core.labelWhiteList</code> option in the\nconfiguration file, instead.</p>\n\n<h3 id=\"-oneshot\">-oneshot</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-oneshot</code> flag causes nfd-worker to exit after one pass of feature\ndetection.</p>\n\n<p>Default: <em>false</em></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-worker <span class=\"nt\">-oneshot</span> <span class=\"nt\">-no-publish</span>\n</code></pre> </div></div>\n\n<h3 id=\"-sleep-interval\">-sleep-interval</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-sleep-interval</code> specifies the interval between feature re-detection (and\nnode re-labeling). A non-positive value implies infinite sleep interval, i.e.\nno re-detection or re-labeling is done.</p>\n\n<p>Note: This flag takes precedence over the <code class=\"language-plaintext highlighter-rouge\">core.sleepInterval</code> configuration\nfile option.</p>\n\n<p>Default: 60s</p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-worker <span class=\"nt\">-sleep-interval</span><span class=\"o\">=</span>1h\n</code></pre> </div></div>\n\n<p><strong>DEPRECATED</strong>: you should use the <code class=\"language-plaintext highlighter-rouge\">core.sleepInterval</code> option in the\nconfiguration file, instead.</p>\n\n<h3 id=\"logging\">Logging</h3>\n\n<p>The following logging-related flags are inherited from the\n<a href=\"https://pkg.go.dev/k8s.io/klog/v2\">klog</a> package.</p>\n\n<p>Note: The logger setup can also be specified via the <code class=\"language-plaintext highlighter-rouge\">core.klog</code> configuration\nfile options. However, the command line flags take precedence over any\ncorresponding config file options specified.</p>\n\n<h4 id=\"-add_dir_header\">-add_dir_header</h4>\n\n<p>If true, adds the file directory to the header of the log messages.</p>\n\n<p>Default: false</p>\n\n<h4 id=\"-alsologtostderr\">-alsologtostderr</h4>\n\n<p>Log to standard error as well as files.</p>\n\n<p>Default: false</p>\n\n<h4 id=\"-log_backtrace_at\">-log_backtrace_at</h4>\n\n<p>When logging hits line file:N, emit a stack trace.</p>\n\n<p>Default: <em>empty</em></p>\n\n<h4 id=\"-log_dir\">-log_dir</h4>\n\n<p>If non-empty, write log files in this directory.</p>\n\n<p>Default: <em>empty</em></p>\n\n<h4 id=\"-log_file\">-log_file</h4>\n\n<p>If non-empty, use this log file.</p>\n\n<p>Default: <em>empty</em></p>\n\n<h4 id=\"-log_file_max_size\">-log_file_max_size</h4>\n\n<p>Defines the maximum size a log file can grow to. Unit is megabytes. If the\nvalue is 0, the maximum file size is unlimited.</p>\n\n<p>Default: 1800</p>\n\n<h4 id=\"-logtostderr\">-logtostderr</h4>\n\n<p>Log to standard error instead of files</p>\n\n<p>Default: true</p>\n\n<h4 id=\"-skip_headers\">-skip_headers</h4>\n\n<p>If true, avoid header prefixes in the log messages.</p>\n\n<p>Default: false</p>\n\n<h4 id=\"-skip_log_headers\">-skip_log_headers</h4>\n\n<p>If true, avoid headers when opening log files.</p>\n\n<p>Default: false</p>\n\n<h4 id=\"-stderrthreshold\">-stderrthreshold</h4>\n\n<p>Logs at or above this threshold go to stderr.</p>\n\n<p>Default: 2</p>\n\n<h4 id=\"-v\">-v</h4>\n\n<p>Number for the log level verbosity.</p>\n\n<p>Default: 0</p>\n\n<h4 id=\"-vmodule\">-vmodule</h4>\n\n<p>Comma-separated list of <code class=\"language-plaintext highlighter-rouge\">pattern=N</code> settings for file-filtered logging.</p>\n\n<p>Default: <em>empty</em></p>\n","dir":"/advanced/","name":"worker-commandline-reference.md","path":"advanced/worker-commandline-reference.md","url":"/advanced/worker-commandline-reference.html"},{"title":"Deployment and usage","layout":"default","sort":3,"content":"<h1 class=\"no_toc\" id=\"deployment-and-usage\">Deployment and usage</h1>\n\n<h2 class=\"no_toc text-delta\" id=\"table-of-contents\">Table of contents</h2>\n\n<ol id=\"markdown-toc\">\n <li><a href=\"#image-variants\" id=\"markdown-toc-image-variants\">Image variants</a> <ol>\n <li><a href=\"#full\" id=\"markdown-toc-full\">Full</a></li>\n <li><a href=\"#minimal\" id=\"markdown-toc-minimal\">Minimal</a></li>\n </ol>\n </li>\n <li><a href=\"#deployment-options\" id=\"markdown-toc-deployment-options\">Deployment options</a> <ol>\n <li><a href=\"#operator\" id=\"markdown-toc-operator\">Operator</a></li>\n <li><a href=\"#deployment-with-kustomize\" id=\"markdown-toc-deployment-with-kustomize\">Deployment with kustomize</a></li>\n <li><a href=\"#deployment-with-helm\" id=\"markdown-toc-deployment-with-helm\">Deployment with Helm</a></li>\n <li><a href=\"#build-your-own\" id=\"markdown-toc-build-your-own\">Build your own</a></li>\n </ol>\n </li>\n <li><a href=\"#usage\" id=\"markdown-toc-usage\">Usage</a> <ol>\n <li><a href=\"#nfd-master\" id=\"markdown-toc-nfd-master\">NFD-Master</a></li>\n <li><a href=\"#nfd-worker\" id=\"markdown-toc-nfd-worker\">NFD-Worker</a></li>\n <li><a href=\"#nfd-topology-updater\" id=\"markdown-toc-nfd-topology-updater\">NFD-Topology-Updater</a></li>\n <li><a href=\"#communication-security-with-tls\" id=\"markdown-toc-communication-security-with-tls\">Communication security with TLS</a></li>\n </ol>\n </li>\n <li><a href=\"#worker-configuration\" id=\"markdown-toc-worker-configuration\">Worker configuration</a></li>\n <li><a href=\"#using-node-labels\" id=\"markdown-toc-using-node-labels\">Using node labels</a></li>\n <li><a href=\"#uninstallation\" id=\"markdown-toc-uninstallation\">Uninstallation</a> <ol>\n <li><a href=\"#operator-was-used-for-deployment\" id=\"markdown-toc-operator-was-used-for-deployment\">Operator was used for deployment</a></li>\n <li><a href=\"#manual\" id=\"markdown-toc-manual\">Manual</a></li>\n <li><a href=\"#removing-feature-labels\" id=\"markdown-toc-removing-feature-labels\">Removing feature labels</a></li>\n </ol>\n </li>\n</ol>\n\n<hr />\n\n<h2 id=\"image-variants\">Image variants</h2>\n\n<p>NFD currently offers two variants of the container image. The “full” variant is\ncurrently deployed by default. Released container images are available for\nx86_64 and Arm64 architectures.</p>\n\n<h3 id=\"full\">Full</h3>\n\n<p>This image is based on\n<a href=\"https://hub.docker.com/_/debian\">debian:buster-slim</a> and contains a full Linux\nsystem for running shell-based nfd-worker hooks and doing live debugging and\ndiagnosis of the NFD images.</p>\n\n<h3 id=\"minimal\">Minimal</h3>\n\n<p>This is a minimal image based on\n<a href=\"https://github.com/GoogleContainerTools/distroless/blob/master/base/README.md\">gcr.io/distroless/base</a>\nand only supports running statically linked binaries.</p>\n\n<p>The container image tag has suffix <code class=\"language-plaintext highlighter-rouge\">-minimal</code>\n(e.g. <code class=\"language-plaintext highlighter-rouge\">k8s.gcr.io/nfd/node-feature-discovery:v0.11.3-minimal</code>)</p>\n\n<h2 id=\"deployment-options\">Deployment options</h2>\n\n<h3 id=\"operator\">Operator</h3>\n\n<p>Deployment using the\n<a href=\"https://github.com/kubernetes-sigs/node-feature-discovery-operator\">Node Feature Discovery Operator</a>\nis recommended to be done via\n<a href=\"https://operatorhub.io/operator/nfd-operator\">operatorhub.io</a>.</p>\n\n<ol>\n <li>You need to have\n<a href=\"https://github.com/operator-framework/operator-lifecycle-manager\">OLM</a>\ninstalled. If you dont, take a look at the\n<a href=\"https://github.com/operator-framework/operator-lifecycle-manager/releases/latest\">latest release</a>\nfor detailed instructions.</li>\n <li>\n <p>Install the operator:</p>\n\n <div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>kubectl create <span class=\"nt\">-f</span> https://operatorhub.io/install/nfd-operator.yaml\n</code></pre> </div> </div>\n </li>\n <li>\n <p>Create <code class=\"language-plaintext highlighter-rouge\">NodeFeatureDiscovery</code> object (in <code class=\"language-plaintext highlighter-rouge\">nfd</code> namespace here):</p>\n\n <div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nb\">cat</span> <span class=\"o\">&lt;&lt;</span> <span class=\"no\">EOF</span><span class=\"sh\"> | kubectl apply -f -\napiVersion: v1\nkind: Namespace\nmetadata:\n name: nfd\n---\napiVersion: nfd.kubernetes.io/v1\nkind: NodeFeatureDiscovery\nmetadata:\n name: my-nfd-deployment\n namespace: nfd\nspec:\n operand:\n image: k8s.gcr.io/nfd/node-feature-discovery:v0.11.3\n imagePullPolicy: IfNotPresent\n</span><span class=\"no\">EOF\n</span></code></pre> </div> </div>\n </li>\n</ol>\n\n<p>In order to deploy the <a href=\"#minimal\">minimal</a> image you need to use</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code> <span class=\"na\">image</span><span class=\"pi\">:</span> <span class=\"s\">k8s.gcr.io/nfd/node-feature-discovery:v0.11.3-minimal</span>\n</code></pre> </div></div>\n\n<p>in the <code class=\"language-plaintext highlighter-rouge\">NodeFeatureDiscovery</code> object above.</p>\n\n<h3 id=\"deployment-with-kustomize\">Deployment with kustomize</h3>\n\n<p>This requires <a href=\"https://kubernetes.io/docs/tasks/tools/install-kubectl\">kubectl</a>\nv1.21 or later. The kustomize overlays provided in the repo can be used\ndirectly:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>kubectl apply <span class=\"nt\">-k</span> https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref<span class=\"o\">=</span>v0.11.3\n</code></pre> </div></div>\n\n<p>This will required RBAC rules and deploy nfd-master (as a deployment) and\nnfd-worker (as daemonset) in the <code class=\"language-plaintext highlighter-rouge\">node-feature-discovery</code> namespace.</p>\n\n<p><strong>NOTE:</strong> nfd-topology-updater is not deployed as part of the <code class=\"language-plaintext highlighter-rouge\">default</code> overlay.\nPlease refer to the <a href=\"#master-worker-topologyupdater\">Master Worker Topologyupdater</a>\nand <a href=\"#topology-updater\">Topologyupdater</a> below.</p>\n\n<p>Alternatively you can clone the repository and customize the deployment by\ncreating your own overlays. For example, to deploy the <a href=\"#minimal\">minimal</a>\nimage. See <a href=\"https://github.com/kubernetes-sigs/kustomize\">kustomize</a> for more information about managing\ndeployment configurations.</p>\n\n<h4 id=\"default-overlays\">Default overlays</h4>\n\n<p>The NFD repository hosts a set of overlays for different usages and deployment\nscenarios under\n<a href=\"https://github.com/kubernetes-sigs/node-feature-discovery/blob/v0.11.3/deployment/overlays\"><code class=\"language-plaintext highlighter-rouge\">deployment/overlays</code></a></p>\n\n<ul>\n <li><a href=\"https://github.com/kubernetes-sigs/node-feature-discovery/blob/v0.11.3/deployment/overlays/default\"><code class=\"language-plaintext highlighter-rouge\">default</code></a>:\ndefault deployment of nfd-worker as a daemonset, described above</li>\n <li><a href=\"https://github.com/kubernetes-sigs/node-feature-discovery/blob/v0.11.3/deployment/overlays/default-combined\"><code class=\"language-plaintext highlighter-rouge\">default-combined</code></a>\nsee <a href=\"#master-worker-pod\">Master-worker pod</a> below</li>\n <li><a href=\"https://github.com/kubernetes-sigs/node-feature-discovery/blob/v0.11.3/deployment/overlays/default-job\"><code class=\"language-plaintext highlighter-rouge\">default-job</code></a>:\nsee <a href=\"#worker-one-shot\">Worker one-shot</a> below</li>\n <li><a href=\"https://github.com/kubernetes-sigs/node-feature-discovery/blob/v0.11.3/deployment/overlays/master-worker-topologyupdater\"><code class=\"language-plaintext highlighter-rouge\">master-worker-topologyupdater</code></a>:\nsee <a href=\"#master-worker-topologyupdater\">Master Worker Topologyupdater</a> below</li>\n <li><a href=\"https://github.com/kubernetes-sigs/node-feature-discovery/blob/v0.11.3/deployment/overlays/topologyupdater\"><code class=\"language-plaintext highlighter-rouge\">topologyupdater</code></a>:\nsee <a href=\"#topology-updater\">Topology Updater</a> below</li>\n <li><a href=\"https://github.com/kubernetes-sigs/node-feature-discovery/blob/v0.11.3/deployment/overlays/prune\"><code class=\"language-plaintext highlighter-rouge\">prune</code></a>:\nclean up the cluster after uninstallation, see\n<a href=\"#removing-feature-labels\">Removing feature labels</a></li>\n <li><a href=\"https://github.com/kubernetes-sigs/node-feature-discovery/blob/v0.11.3/deployment/overlays/samples/cert-manager\"><code class=\"language-plaintext highlighter-rouge\">samples/cert-manager</code></a>:\nan example for supplementing the default deployment with cert-manager for TLS\nauthentication, see\n<a href=\"#automated-tls-certificate-management-using-cert-manager\">Automated TLS certificate management using cert-manager</a>\nfor details</li>\n <li><a href=\"https://github.com/kubernetes-sigs/node-feature-discovery/blob/v0.11.3/deployment/overlays/samples/custom-rules\"><code class=\"language-plaintext highlighter-rouge\">samples/custom-rules</code></a>:\nan example for spicing up the default deployment with a separately managed\nconfigmap of custom labeling rules, see\n<a href=\"#features.md#custom\">Custom feature source</a> for more information about\ncustom node labels</li>\n</ul>\n\n<h4 id=\"master-worker-pod\">Master-worker pod</h4>\n\n<p>You can also run nfd-master and nfd-worker inside the same pod</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>kubectl apply <span class=\"nt\">-k</span> https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default-combined?ref<span class=\"o\">=</span>v0.11.3\n\n</code></pre> </div></div>\n\n<p>This creates a DaemonSet that runs nfd-worker and nfd-master in the same Pod.\nIn this case no nfd-master is run on the master node(s), but, the worker nodes\nare able to label themselves which may be desirable e.g. in single-node setups.</p>\n\n<p><strong>NOTE:</strong> nfd-topology-updater is not deployed by the default-combined overlay.\nTo enable nfd-topology-updater in this scenario,the users must customize the\ndeployment themselves.</p>\n\n<h4 id=\"worker-one-shot\">Worker one-shot</h4>\n\n<p>Feature discovery can alternatively be configured as a one-shot job.\nThe <code class=\"language-plaintext highlighter-rouge\">default-job</code> overlay may be used to achieve this:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">NUM_NODES</span><span class=\"o\">=</span><span class=\"si\">$(</span>kubectl get no <span class=\"nt\">-o</span> <span class=\"nv\">jsonpath</span><span class=\"o\">=</span><span class=\"s1\">'{.items[*].metadata.name}'</span> | <span class=\"nb\">wc</span> <span class=\"nt\">-w</span><span class=\"si\">)</span>\nkubectl kustomize https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default-job?ref<span class=\"o\">=</span>v0.11.3 | <span class=\"se\">\\</span>\n <span class=\"nb\">sed </span>s<span class=\"s2\">\"/NUM_NODES/</span><span class=\"nv\">$NUM_NODES</span><span class=\"s2\">/\"</span> | <span class=\"se\">\\</span>\n kubectl apply <span class=\"nt\">-f</span> -\n</code></pre> </div></div>\n\n<p>The example above launches as many jobs as there are non-master nodes. Note that\nthis approach does not guarantee running once on every node. For example,\ntainted, non-ready nodes or some other reasons in Job scheduling may cause some\nnode(s) will run extra job instance(s) to satisfy the request.</p>\n\n<h4 id=\"master-worker-topologyupdater\">Master Worker Topologyupdater</h4>\n\n<p>NFD Master, NFD worker and NFD Topologyupdater can be configured to be deployed\nas separate pods. The <code class=\"language-plaintext highlighter-rouge\">master-worker-topologyupdater</code> overlay may be used to\nachieve this:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>kubectl apply <span class=\"nt\">-k</span> https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/master-worker-topologyupdater?ref<span class=\"o\">=</span>v0.11.3\n\n</code></pre> </div></div>\n\n<h4 id=\"topologyupdater\">Topologyupdater</h4>\n\n<p>In order to deploy just NFD master and NFD Topologyupdater (without nfd-worker)\nuse the <code class=\"language-plaintext highlighter-rouge\">topologyupdater</code> overlay:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>kubectl apply <span class=\"nt\">-k</span> https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/topologyupdater?ref<span class=\"o\">=</span>v0.11.3\n\n</code></pre> </div></div>\n\n<p>NFD Topologyupdater can be configured along with the <code class=\"language-plaintext highlighter-rouge\">default</code> overlay\n(which deploys NFD worker and NFD master) where all the software components\nare deployed as separate pods. The <code class=\"language-plaintext highlighter-rouge\">topologyupdater</code> overlay may be used\nalong with <code class=\"language-plaintext highlighter-rouge\">default</code> overlay to achieve this:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>\nkubectl apply <span class=\"nt\">-k</span> https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref<span class=\"o\">=</span>v0.11.3\nkubectl apply <span class=\"nt\">-k</span> https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/topologyupdater?ref<span class=\"o\">=</span>v0.11.3\n\n</code></pre> </div></div>\n\n<h3 id=\"deployment-with-helm\">Deployment with Helm</h3>\n\n<p>Node Feature Discovery Helm chart allow to easily deploy and manage NFD.</p>\n\n<h4 id=\"prerequisites\">Prerequisites</h4>\n\n<p><a href=\"https://helm.sh/\">Helm package manager</a> should be installed.</p>\n\n<h4 id=\"deployment\">Deployment</h4>\n\n<p>To install the latest stable version:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nb\">export </span><span class=\"nv\">NFD_NS</span><span class=\"o\">=</span>node-feature-discovery\nhelm repo add nfd https://kubernetes-sigs.github.io/node-feature-discovery/charts\nhelm repo update\nhelm <span class=\"nb\">install </span>nfd/node-feature-discovery <span class=\"nt\">--namespace</span> <span class=\"nv\">$NFD_NS</span> <span class=\"nt\">--create-namespace</span> <span class=\"nt\">--generate-name</span>\n</code></pre> </div></div>\n\n<p>To install the latest development version you need to clone the NFD Git\nrepository and install from there.</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>git clone https://github.com/kubernetes-sigs/node-feature-discovery/\n<span class=\"nb\">cd </span>node-feature-discovery/deployment/helm\n<span class=\"nb\">export </span><span class=\"nv\">NFD_NS</span><span class=\"o\">=</span>node-feature-discovery\nhelm <span class=\"nb\">install </span>node-feature-discovery ./node-feature-discovery/ <span class=\"nt\">--namespace</span> <span class=\"nv\">$NFD_NS</span> <span class=\"nt\">--create-namespace</span>\n</code></pre> </div></div>\n\n<p>See the <a href=\"#configuration\">configuration</a> section below for instructions how to\nalter the deployment parameters.</p>\n\n<p>In order to deploy the <a href=\"#minimal\">minimal</a> image you need to override the image\ntag:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>helm <span class=\"nb\">install </span>node-feature-discovery ./node-feature-discovery/ <span class=\"nt\">--set</span> image.tag<span class=\"o\">=</span>v0.11.3-minimal <span class=\"nt\">--namespace</span> <span class=\"nv\">$NFD_NS</span> <span class=\"nt\">--create-namespace</span>\n</code></pre> </div></div>\n\n<h4 id=\"configuration\">Configuration</h4>\n\n<p>You can override values from <code class=\"language-plaintext highlighter-rouge\">values.yaml</code> and provide a file with custom values:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nb\">export </span><span class=\"nv\">NFD_NS</span><span class=\"o\">=</span>node-feature-discovery\nhelm <span class=\"nb\">install </span>nfd/node-feature-discovery <span class=\"nt\">-f</span> &lt;path/to/custom/values.yaml&gt; <span class=\"nt\">--namespace</span> <span class=\"nv\">$NFD_NS</span> <span class=\"nt\">--create-namespace</span>\n</code></pre> </div></div>\n\n<p>To specify each parameter separately you can provide them to helm install command:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nb\">export </span><span class=\"nv\">NFD_NS</span><span class=\"o\">=</span>node-feature-discovery\nhelm <span class=\"nb\">install </span>nfd/node-feature-discovery <span class=\"nt\">--set</span> <span class=\"nv\">nameOverride</span><span class=\"o\">=</span>NFDinstance <span class=\"nt\">--set</span> master.replicaCount<span class=\"o\">=</span>2 <span class=\"nt\">--namespace</span> <span class=\"nv\">$NFD_NS</span> <span class=\"nt\">--create-namespace</span>\n</code></pre> </div></div>\n\n<h4 id=\"uninstalling-the-chart\">Uninstalling the chart</h4>\n\n<p>To uninstall the <code class=\"language-plaintext highlighter-rouge\">node-feature-discovery</code> deployment:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nb\">export </span><span class=\"nv\">NFD_NS</span><span class=\"o\">=</span>node-feature-discovery\nhelm uninstall node-feature-discovery <span class=\"nt\">--namespace</span> <span class=\"nv\">$NFD_NS</span>\n</code></pre> </div></div>\n\n<p>The command removes all the Kubernetes components associated with the chart and\ndeletes the release.</p>\n\n<h4 id=\"chart-parameters\">Chart parameters</h4>\n\n<p>In order to tailor the deployment of the Node Feature Discovery to your cluster needs\nWe have introduced the following Chart parameters.</p>\n\n<h5 id=\"general-parameters\">General parameters</h5>\n\n<table>\n <thead>\n <tr>\n <th>Name</th>\n <th>Type</th>\n <th>Default</th>\n <th>description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">image.repository</code></td>\n <td>string</td>\n <td><code class=\"language-plaintext highlighter-rouge\">k8s.gcr.io/nfd/node-feature-discovery</code></td>\n <td>NFD image repository</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">image.tag</code></td>\n <td>string</td>\n <td><code class=\"language-plaintext highlighter-rouge\">v0.11.3</code></td>\n <td>NFD image tag</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">image.pullPolicy</code></td>\n <td>string</td>\n <td><code class=\"language-plaintext highlighter-rouge\">Always</code></td>\n <td>Image pull policy</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">imagePullSecrets</code></td>\n <td>list</td>\n <td>[]</td>\n <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. <a href=\"https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod\">More info</a></td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">nameOverride</code></td>\n <td>string</td>\n <td> </td>\n <td>Override the name of the chart</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">fullnameOverride</code></td>\n <td>string</td>\n <td> </td>\n <td>Override a default fully qualified app name</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">nodeFeatureRule.createCRD</code></td>\n <td>bool</td>\n <td>true</td>\n <td>Specifies whether to create the NodeFeatureRule CRD</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">tls.enable</code></td>\n <td>bool</td>\n <td>false</td>\n <td>Specifies whether to use TLS for communications between components</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">tls.certManager</code></td>\n <td>bool</td>\n <td>false</td>\n <td>If enabled, requires <a href=\"https://cert-manager.io/docs/\">cert-manager</a> to be installed and will automatically create the required TLS certificates</td>\n </tr>\n </tbody>\n</table>\n\n<h5 id=\"master-pod-parameters\">Master pod parameters</h5>\n\n<table>\n <thead>\n <tr>\n <th>Name</th>\n <th>Type</th>\n <th>Default</th>\n <th>description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">master.*</code></td>\n <td>dict</td>\n <td> </td>\n <td>NFD master deployment configuration</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">master.instance</code></td>\n <td>string</td>\n <td> </td>\n <td>Instance name. Used to separate annotation namespaces for multiple parallel deployments</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">master.extraLabelNs</code></td>\n <td>array</td>\n <td>[]</td>\n <td>List of allowed extra label namespaces</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">master.resourceLabels</code></td>\n <td>array</td>\n <td>[]</td>\n <td>List of labels to be registered as extended resources</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">master.featureRulesController</code></td>\n <td>bool</td>\n <td>null</td>\n <td>Specifies whether the controller for processing of NodeFeatureRule objects is enabled. If not set, controller will be enabled if <code class=\"language-plaintext highlighter-rouge\">master.instance</code> is empty.</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">master.replicaCount</code></td>\n <td>integer</td>\n <td>1</td>\n <td>Number of desired pods. This is a pointer to distinguish between explicit zero and not specified</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">master.podSecurityContext</code></td>\n <td>dict</td>\n <td>{}</td>\n <td><a href=\"https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod\">PodSecurityContext</a> holds pod-level security attributes and common container settings</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">master.securityContext</code></td>\n <td>dict</td>\n <td>{}</td>\n <td>Container <a href=\"https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container\">security settings</a></td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">master.serviceAccount.create</code></td>\n <td>bool</td>\n <td>true</td>\n <td>Specifies whether a service account should be created</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">master.serviceAccount.annotations</code></td>\n <td>dict</td>\n <td>{}</td>\n <td>Annotations to add to the service account</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">master.serviceAccount.name</code></td>\n <td>string</td>\n <td> </td>\n <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>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">master.rbac.create</code></td>\n <td>bool</td>\n <td>true</td>\n <td>Specifies whether to create <a href=\"https://kubernetes.io/docs/reference/access-authn-authz/rbac/\">RBAC</a> configuration for nfd-master</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">master.service.type</code></td>\n <td>string</td>\n <td>ClusterIP</td>\n <td>NFD master service type</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">master.service.port</code></td>\n <td>integer</td>\n <td>8080</td>\n <td>NFD master service port</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">master.resources</code></td>\n <td>dict</td>\n <td>{}</td>\n <td>NFD master pod <a href=\"https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/\">resources management</a></td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">master.nodeSelector</code></td>\n <td>dict</td>\n <td>{}</td>\n <td>NFD master pod <a href=\"https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector\">node selector</a></td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">master.tolerations</code></td>\n <td>dict</td>\n <td><em>Scheduling to master node is disabled</em></td>\n <td>NFD master pod <a href=\"https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/\">tolerations</a></td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">master.annotations</code></td>\n <td>dict</td>\n <td>{}</td>\n <td>NFD master pod <a href=\"https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/\">annotations</a></td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">master.affinity</code></td>\n <td>dict</td>\n <td> </td>\n <td>NFD master pod required <a href=\"https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/\">node affinity</a></td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">master.deploymentAnnotations</code></td>\n <td>dict</td>\n <td>{}</td>\n <td>NFD master deployment <a href=\"https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/\">annotations</a></td>\n </tr>\n </tbody>\n</table>\n\n<h5 id=\"worker-pod-parameters\">Worker pod parameters</h5>\n\n<table>\n <thead>\n <tr>\n <th>Name</th>\n <th>Type</th>\n <th>Default</th>\n <th>description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">worker.*</code></td>\n <td>dict</td>\n <td> </td>\n <td>NFD worker daemonset configuration</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">worker.config</code></td>\n <td>dict</td>\n <td> </td>\n <td>NFD worker <a href=\"/node-feature-discovery/v0.11/advanced/worker-configuration-reference.html\">configuration</a></td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">worker.podSecurityContext</code></td>\n <td>dict</td>\n <td>{}</td>\n <td><a href=\"https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod\">PodSecurityContext</a> holds pod-level security attributes and common container settings</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">worker.securityContext</code></td>\n <td>dict</td>\n <td>{}</td>\n <td>Container <a href=\"https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container\">security settings</a></td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">worker.mountUsrSrc</code></td>\n <td>bool</td>\n <td>false</td>\n <td>Specifies whether to allow users to mount the hostpath /user/src. Does not work on systems without /usr/src AND a read-only /usr</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">worker.resources</code></td>\n <td>dict</td>\n <td>{}</td>\n <td>NFD worker pod <a href=\"https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/\">resources management</a></td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">worker.nodeSelector</code></td>\n <td>dict</td>\n <td>{}</td>\n <td>NFD worker pod <a href=\"https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector\">node selector</a></td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">worker.tolerations</code></td>\n <td>dict</td>\n <td>{}</td>\n <td>NFD worker pod <a href=\"https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/\">node tolerations</a></td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">worker.annotations</code></td>\n <td>dict</td>\n <td>{}</td>\n <td>NFD worker pod <a href=\"https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/\">annotations</a></td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">worker.daemonsetAnnotations</code></td>\n <td>dict</td>\n <td>{}</td>\n <td>NFD worker daemonset <a href=\"https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/\">annotations</a></td>\n </tr>\n </tbody>\n</table>\n\n<h5 id=\"topology-updater-parameters\">Topology updater parameters</h5>\n\n<table>\n <thead>\n <tr>\n <th>Name</th>\n <th>Type</th>\n <th>Default</th>\n <th>description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">topologyUpdater.*</code></td>\n <td>dict</td>\n <td> </td>\n <td>NFD Topology Updater configuration</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">topologyUpdater.enable</code></td>\n <td>bool</td>\n <td>false</td>\n <td>Specifies whether the NFD Topology Updater should be created</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">topologyUpdater.createCRDs</code></td>\n <td>bool</td>\n <td>false</td>\n <td>Specifies whether the NFD Topology Updater CRDs should be created</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">topologyUpdater.serviceAccount.create</code></td>\n <td>bool</td>\n <td>true</td>\n <td>Specifies whether the service account for topology updater should be created</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">topologyUpdater.serviceAccount.annotations</code></td>\n <td>dict</td>\n <td>{}</td>\n <td>Annotations to add to the service account for topology updater</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">topologyUpdater.serviceAccount.name</code></td>\n <td>string</td>\n <td> </td>\n <td>The name of the service account for topology updater to use. If not set and create is true, a name is generated using the fullname template and <code class=\"language-plaintext highlighter-rouge\">-topology-updater</code> suffix</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">topologyUpdater.rbac</code></td>\n <td>dict</td>\n <td> </td>\n <td>RBAC <a href=\"https://kubernetes.io/docs/reference/access-authn-authz/rbac/\">parameters</a> for the topology updater</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">topologyUpdater.rbac.create</code></td>\n <td>bool</td>\n <td>false</td>\n <td>Specifies whether the cluster role and binding for topology updater should be created</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">topologyUpdater.kubeletConfigPath</code></td>\n <td>string</td>\n <td>””</td>\n <td>Specifies the kubelet config host path</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">topologyUpdater.kubeletPodResourcesSockPath</code></td>\n <td>string</td>\n <td>””</td>\n <td>Specifies the kubelet sock path to read pod resources</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">topologyUpdater.updateInterval</code></td>\n <td>string</td>\n <td>60s</td>\n <td>Time to sleep between CR updates. Non-positive value implies no CR update.</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">topologyUpdater.watchNamespace</code></td>\n <td>string</td>\n <td><code class=\"language-plaintext highlighter-rouge\">*</code></td>\n <td>Namespace to watch pods, <code class=\"language-plaintext highlighter-rouge\">*</code> for all namespaces</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">topologyUpdater.podSecurityContext</code></td>\n <td>dict</td>\n <td>{}</td>\n <td><a href=\"https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod\">PodSecurityContext</a> holds pod-level security attributes and common container settings</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">topologyUpdater.securityContext</code></td>\n <td>dict</td>\n <td>{}</td>\n <td>Container <a href=\"https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container\">security settings</a></td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">topologyUpdater.resources</code></td>\n <td>dict</td>\n <td>{}</td>\n <td>Topology updater pod <a href=\"https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/\">resources management</a></td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">topologyUpdater.nodeSelector</code></td>\n <td>dict</td>\n <td>{}</td>\n <td>Topology updater pod <a href=\"https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector\">node selector</a></td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">topologyUpdater.tolerations</code></td>\n <td>dict</td>\n <td>{}</td>\n <td>Topology updater pod <a href=\"https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/\">node tolerations</a></td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">topologyUpdater.annotations</code></td>\n <td>dict</td>\n <td>{}</td>\n <td>Topology updater pod <a href=\"https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/\">annotations</a></td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">topologyUpdater.affinity</code></td>\n <td>dict</td>\n <td>{}</td>\n <td>Topology updater pod <a href=\"https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/\">affinity</a></td>\n </tr>\n </tbody>\n</table>\n\n<h3 id=\"build-your-own\">Build your own</h3>\n\n<p>If you want to use the latest development version (master branch) you need to\nbuild your own custom image.\nSee the <a href=\"../advanced/developer-guide\">Developer Guide</a> for instructions how to\nbuild images and deploy them on your cluster.</p>\n\n<h2 id=\"usage\">Usage</h2>\n\n<h3 id=\"nfd-master\">NFD-Master</h3>\n\n<p>NFD-Master runs as a deployment (with a replica count of 1), by default\nit prefers running on the clusters master nodes but will run on worker\nnodes if no master nodes are found.</p>\n\n<p>For High Availability, you should simply increase the replica count of\nthe deployment object. You should also look into adding\n<a href=\"https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity\">inter-pod</a>\naffinity to prevent masters from running on the same node.\nHowever note that inter-pod affinity is costly and is not recommended\nin bigger clusters.</p>\n\n<p>NFD-Master listens for connections from nfd-worker(s) and connects to the\nKubernetes API server to add node labels advertised by them.</p>\n\n<p>If you have RBAC authorization enabled (as is the default e.g. with clusters\ninitialized with kubeadm) you need to configure the appropriate ClusterRoles,\nClusterRoleBindings and a ServiceAccount in order for NFD to create node\nlabels. The provided template will configure these for you.</p>\n\n<h3 id=\"nfd-worker\">NFD-Worker</h3>\n\n<p>NFD-Worker is preferably run as a Kubernetes DaemonSet. This assures\nre-labeling on regular intervals capturing changes in the system configuration\nand makes sure that new nodes are labeled as they are added to the cluster.\nWorker connects to the nfd-master service to advertise hardware features.</p>\n\n<p>When run as a daemonset, nodes are re-labeled at an default interval of 60s.\nThis can be changed by using the\n<a href=\"../advanced/worker-configuration-reference.html#coresleepinterval\"><code class=\"language-plaintext highlighter-rouge\">core.sleepInterval</code></a>\nconfig option (or\n<a href=\"../advanced/worker-commandline-reference.html#-sleep-interval\"><code class=\"language-plaintext highlighter-rouge\">-sleep-interval</code></a>\ncommand line flag).</p>\n\n<p>The worker configuration file is watched and re-read on every change which\nprovides a simple mechanism of dynamic run-time reconfiguration. See\n<a href=\"#worker-configuration\">worker configuration</a> for more details.</p>\n\n<h3 id=\"nfd-topology-updater\">NFD-Topology-Updater</h3>\n\n<p>NFD-Topology-Updater is preferably run as a Kubernetes DaemonSet. This assures\nre-examination (and CR updates) on regular intervals capturing changes in\nthe allocated resources and hence the allocatable resources on a per zone\nbasis. It makes sure that more CR instances are created as new nodes get\nadded to the cluster. Topology-Updater connects to the nfd-master service\nto create CR instances corresponding to nodes.</p>\n\n<p>When run as a daemonset, nodes are re-examined for the allocated resources\n(to determine the information of the allocatable resources on a per zone basis\nwhere a zone can be a NUMA node) at an interval specified using the\n<code class=\"language-plaintext highlighter-rouge\">-sleep-interval</code> option. The default sleep interval is set to 60s which is the\n the value when no -sleep-interval is specified.</p>\n\n<h3 id=\"communication-security-with-tls\">Communication security with TLS</h3>\n\n<p>NFD supports mutual TLS authentication between the nfd-master and nfd-worker\ninstances. That is, nfd-worker and nfd-master both verify that the other end\npresents a valid certificate.</p>\n\n<p>TLS authentication is enabled by specifying <code class=\"language-plaintext highlighter-rouge\">-ca-file</code>, <code class=\"language-plaintext highlighter-rouge\">-key-file</code> and\n<code class=\"language-plaintext highlighter-rouge\">-cert-file</code> args, on both the nfd-master and nfd-worker instances. The\ntemplate specs provided with NFD contain (commented out) example configuration\nfor enabling TLS authentication.</p>\n\n<p>The Common Name (CN) of the nfd-master certificate must match the DNS name of\nthe nfd-master Service of the cluster. By default, nfd-master only check that\nthe nfd-worker has been signed by the specified root certificate (-ca-file).</p>\n\n<p>Additional hardening can be enabled by specifying <code class=\"language-plaintext highlighter-rouge\">-verify-node-name</code> in\nnfd-master args, in which case nfd-master verifies that the NodeName presented\nby nfd-worker matches the Common Name (CN) or a Subject Alternative Name (SAN)\nof its certificate. Note that <code class=\"language-plaintext highlighter-rouge\">-verify-node-name</code> complicates certificate\nmanagement and is not yet supported in the helm or kustomize deployment\nmethods.</p>\n\n<h4 id=\"automated-tls-certificate-management-using-cert-manager\">Automated TLS certificate management using cert-manager</h4>\n\n<p><a href=\"https://cert-manager.io/\">cert-manager</a> can be used to automate certificate\nmanagement between nfd-master and the nfd-worker pods.</p>\n\n<p>The NFD source code repository contains an example kustomize overlay and helm\nchart that can be used to deploy NFD with cert-manager supplied certificates\nenabled.</p>\n\n<p>To install <code class=\"language-plaintext highlighter-rouge\">cert-manager</code> itself can be done as easily as this, below, or you\ncan refer to their documentation for other installation methods such as the\nhelm chart they provide.</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>kubectl apply <span class=\"nt\">-f</span> https://github.com/jetstack/cert-manager/releases/download/v1.6.1/cert-manager.yaml\n</code></pre> </div></div>\n\n<p>To use the kustomize overlay to install node-feature-discovery with TLS enabled,\nyou may use the following:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>kubectl apply <span class=\"nt\">-k</span> deployment/overlays/samples/cert-manager\n</code></pre> </div></div>\n\n<p>To make use of the helm chart, override <code class=\"language-plaintext highlighter-rouge\">values.yaml</code> to enable both the\n<code class=\"language-plaintext highlighter-rouge\">tls.enabled</code> and <code class=\"language-plaintext highlighter-rouge\">tls.certManager</code> options. Note that if you do not enable\n<code class=\"language-plaintext highlighter-rouge\">tls.certManager</code>, helm will successfully install the application, but\ndeployment will wait until certificates are manually created, as demonstrated\nbelow.</p>\n\n<p>See the sample installation commands in the Helm <a href=\"#deployment\">Deployment</a>\nand <a href=\"#configuration\">Configuration</a> sections above for how to either override\nindividual values, or provide a yaml file with which to override default\nvalues.</p>\n\n<h4 id=\"manual-tls-certificate-management\">Manual TLS certificate management</h4>\n\n<p>If you do not with to make use of cert-manager, the certificates can be\nmanually created and stored as secrets within the NFD namespace.</p>\n\n<p>Create a CA certificate</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>openssl req <span class=\"nt\">-x509</span> <span class=\"nt\">-newkey</span> rsa:4096 <span class=\"nt\">-keyout</span> ca.key <span class=\"nt\">-nodes</span> <span class=\"se\">\\</span>\n <span class=\"nt\">-subj</span> <span class=\"s2\">\"/CN=nfd-ca\"</span> <span class=\"nt\">-days</span> 10000 <span class=\"nt\">-out</span> ca.crt\n</code></pre> </div></div>\n\n<p>Create a common openssl config file.</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nb\">cat</span> <span class=\"o\">&lt;&lt;</span><span class=\"no\">EOF</span><span class=\"sh\"> &gt; nfd-common.conf\n[ req ]\ndefault_bits = 4096\nprompt = no\ndefault_md = sha256\nreq_extensions = req_ext\ndistinguished_name = dn\n\n[ dn ]\nC = XX\nST = some-state\nL = some-city\nO = some-company\nOU = node-feature-discovery\n\n[ req_ext ]\nsubjectAltName = @alt_names\n\n[ v3_ext ]\nauthorityKeyIdentifier=keyid,issuer:always\nbasicConstraints=CA:FALSE\nkeyUsage=keyEncipherment,dataEncipherment\nextendedKeyUsage=serverAuth,clientAuth\nsubjectAltName=@alt_names\n</span><span class=\"no\">EOF\n</span></code></pre> </div></div>\n\n<p>Now, create the nfd-master certificate.</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nb\">cat</span> <span class=\"o\">&lt;&lt;</span><span class=\"no\">EOF</span><span class=\"sh\"> &gt; nfd-master.conf\n.include nfd-common.conf\n\n[ dn ]\nCN = nfd-master\n\n[ alt_names ]\nDNS.1 = nfd-master\nDNS.2 = nfd-master.node-feature-discovery.svc.cluster.local\nDNS.3 = localhost\n</span><span class=\"no\">EOF\n\n</span>openssl req <span class=\"nt\">-new</span> <span class=\"nt\">-newkey</span> rsa:4096 <span class=\"nt\">-keyout</span> nfd-master.key <span class=\"nt\">-nodes</span> <span class=\"nt\">-out</span> nfd-master.csr <span class=\"nt\">-config</span> nfd-master.conf\n</code></pre> </div></div>\n\n<p>Create certificates for nfd-worker and nfd-topology-updater</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nb\">cat</span> <span class=\"o\">&lt;&lt;</span><span class=\"no\">EOF</span><span class=\"sh\"> &gt; nfd-worker.conf\n.include nfd-common.conf\n\n[ dn ]\nCN = nfd-worker\n\n[ alt_names ]\nDNS.1 = nfd-worker\nDNS.2 = nfd-worker.node-feature-discovery.svc.cluster.local\n</span><span class=\"no\">EOF\n\n</span><span class=\"c\"># Config for topology updater is identical except for the DN and alt_names</span>\n<span class=\"nb\">sed</span> <span class=\"nt\">-e</span> <span class=\"s1\">'s/worker/topology-updater/g'</span> &lt; nfd-worker.conf <span class=\"o\">&gt;</span> nfd-topology-updater.conf\n\nopenssl req <span class=\"nt\">-new</span> <span class=\"nt\">-newkey</span> rsa:4096 <span class=\"nt\">-keyout</span> nfd-worker.key <span class=\"nt\">-nodes</span> <span class=\"nt\">-out</span> nfd-worker.csr <span class=\"nt\">-config</span> nfd-worker.conf\nopenssl req <span class=\"nt\">-new</span> <span class=\"nt\">-newkey</span> rsa:4096 <span class=\"nt\">-keyout</span> nfd-topology-updater.key <span class=\"nt\">-nodes</span> <span class=\"nt\">-out</span> nfd-topology-updater.csr <span class=\"nt\">-config</span> nfd-topology-updater.conf\n</code></pre> </div></div>\n\n<p>Now, sign the certificates with the CA created earlier.</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"k\">for </span>cert <span class=\"k\">in </span>nfd-master nfd-worker nfd-topology-updater<span class=\"p\">;</span> <span class=\"k\">do\n </span><span class=\"nb\">echo </span>signing <span class=\"nv\">$cert</span>\n openssl x509 <span class=\"nt\">-req</span> <span class=\"nt\">-in</span> <span class=\"nv\">$cert</span>.csr <span class=\"nt\">-CA</span> ca.crt <span class=\"nt\">-CAkey</span> ca.key <span class=\"se\">\\</span>\n <span class=\"nt\">-CAcreateserial</span> <span class=\"nt\">-out</span> <span class=\"nv\">$cert</span>.crt <span class=\"nt\">-days</span> 10000 <span class=\"se\">\\</span>\n <span class=\"nt\">-extensions</span> v3_ext <span class=\"nt\">-extfile</span> <span class=\"nv\">$cert</span>.conf\n<span class=\"k\">done</span>\n</code></pre> </div></div>\n\n<p>Finally, turn these certificates into secrets.</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"k\">for </span>cert <span class=\"k\">in </span>nfd-master nfd-worker nfd-topology-updater<span class=\"p\">;</span> <span class=\"k\">do\n </span><span class=\"nb\">echo </span>creating secret <span class=\"k\">for</span> <span class=\"nv\">$cert</span> <span class=\"k\">in </span>node-feature-discovery namespace\n <span class=\"nb\">cat</span> <span class=\"o\">&lt;&lt;</span><span class=\"no\">EOF</span><span class=\"sh\"> | kubectl create -n node-feature-discovery -f -\n---\napiVersion: v1\nkind: Secret\ntype: kubernetes.io/tls\nmetadata:\n name: </span><span class=\"k\">${</span><span class=\"nv\">cert</span><span class=\"k\">}</span><span class=\"sh\">-cert\ndata:\n ca.crt: </span><span class=\"si\">$(</span> <span class=\"nb\">cat </span>ca.crt | <span class=\"nb\">base64</span> <span class=\"nt\">-w</span> 0 <span class=\"si\">)</span><span class=\"sh\">\n tls.crt: </span><span class=\"si\">$(</span> <span class=\"nb\">cat</span> <span class=\"nv\">$cert</span>.crt | <span class=\"nb\">base64</span> <span class=\"nt\">-w</span> 0 <span class=\"si\">)</span><span class=\"sh\">\n tls.key: </span><span class=\"si\">$(</span> <span class=\"nb\">cat</span> <span class=\"nv\">$cert</span>.key | <span class=\"nb\">base64</span> <span class=\"nt\">-w</span> 0 <span class=\"si\">)</span><span class=\"sh\">\n</span><span class=\"no\">EOF\n\n</span><span class=\"k\">done</span>\n</code></pre> </div></div>\n\n<h2 id=\"worker-configuration\">Worker configuration</h2>\n\n<p>NFD-Worker supports dynamic configuration through a configuration file. The\ndefault location is <code class=\"language-plaintext highlighter-rouge\">/etc/kubernetes/node-feature-discovery/nfd-worker.conf</code>,\nbut, this can be changed by specifying the<code class=\"language-plaintext highlighter-rouge\">-config</code> command line flag.\nConfiguration file is re-read whenever it is modified which makes run-time\nre-configuration of nfd-worker straightforward.</p>\n\n<p>Worker configuration file is read inside the container, and thus, Volumes and\nVolumeMounts are needed to make your configuration available for NFD. The\npreferred method is to use a ConfigMap which provides easy deployment and\nre-configurability.</p>\n\n<p>The provided nfd-worker deployment templates create an empty configmap and\nmount it inside the nfd-worker containers. In kustomize deployments,\nconfiguration can be edited with:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>kubectl <span class=\"nt\">-n</span> <span class=\"k\">${</span><span class=\"nv\">NFD_NS</span><span class=\"k\">}</span> edit configmap nfd-worker-conf\n</code></pre> </div></div>\n\n<p>In Helm deployments, <a href=\"#worker-pod-parameters\">Worker pod parameter</a>\n<code class=\"language-plaintext highlighter-rouge\">worker.config</code> can be used to edit the respective configuration.</p>\n\n<p>See\n<a href=\"/node-feature-discovery/v0.11/advanced/worker-configuration-reference.html\">nfd-worker configuration file reference</a>\nfor more details.\nThe (empty-by-default)\n<a href=\"https://github.com/kubernetes-sigs/node-feature-discovery/blob/v0.11.3/deployment/components/worker-config/nfd-worker.conf.example\">example config</a>\ncontains all available configuration options and can be used as a reference\nfor creating creating a configuration.</p>\n\n<p>Configuration options can also be specified via the <code class=\"language-plaintext highlighter-rouge\">-options</code> command line\nflag, in which case no mounts need to be used. The same format as in the config\nfile must be used, i.e. JSON (or YAML). For example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nt\">-options</span><span class=\"o\">=</span><span class=\"s1\">'{\"sources\": { \"pci\": { \"deviceClassWhitelist\": [\"12\"] } } }'</span>\n</code></pre> </div></div>\n\n<p>Configuration options specified from the command line will override those read\nfrom the config file.</p>\n\n<h2 id=\"using-node-labels\">Using node labels</h2>\n\n<p>Nodes with specific features can be targeted using the <code class=\"language-plaintext highlighter-rouge\">nodeSelector</code> field. The\nfollowing example shows how to target nodes with Intel TurboBoost enabled.</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">apiVersion</span><span class=\"pi\">:</span> <span class=\"s\">v1</span>\n<span class=\"na\">kind</span><span class=\"pi\">:</span> <span class=\"s\">Pod</span>\n<span class=\"na\">metadata</span><span class=\"pi\">:</span>\n <span class=\"na\">labels</span><span class=\"pi\">:</span>\n <span class=\"na\">env</span><span class=\"pi\">:</span> <span class=\"s\">test</span>\n <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s\">golang-test</span>\n<span class=\"na\">spec</span><span class=\"pi\">:</span>\n <span class=\"na\">containers</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">image</span><span class=\"pi\">:</span> <span class=\"s\">golang</span>\n <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s\">go1</span>\n <span class=\"na\">nodeSelector</span><span class=\"pi\">:</span>\n <span class=\"s\">feature.node.kubernetes.io/cpu-pstate.turbo</span><span class=\"pi\">:</span> <span class=\"s1\">'</span><span class=\"s\">true'</span>\n</code></pre> </div></div>\n\n<p>For more details on targeting nodes, see\n<a href=\"https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/\">node selection</a>.</p>\n\n<h2 id=\"uninstallation\">Uninstallation</h2>\n\n<h3 id=\"operator-was-used-for-deployment\">Operator was used for deployment</h3>\n\n<p>If you followed the deployment instructions above you can simply do:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>kubectl <span class=\"nt\">-n</span> nfd delete NodeFeatureDiscovery my-nfd-deployment\n</code></pre> </div></div>\n\n<p>Optionally, you can also remove the namespace:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>kubectl delete ns nfd\n</code></pre> </div></div>\n\n<p>See the <a href=\"https://github.com/kubernetes-sigs/node-feature-discovery-operator\">node-feature-discovery-operator</a> and <a href=\"https://github.com/operator-framework/operator-lifecycle-manager\">OLM</a> project\ndocumentation for instructions for uninstalling the operator and operator\nlifecycle manager, respectively.</p>\n\n<h3 id=\"manual\">Manual</h3>\n\n<p>Simplest way is to invoke <code class=\"language-plaintext highlighter-rouge\">kubectl delete</code> on the deployment files you used.\nBeware that this will also delete the namespace that NFD is running in. For\nexample, in case the default deployment from the repo was used:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>\nkubectl delete <span class=\"nt\">-k</span> https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref<span class=\"o\">=</span>v0.11.3\n</code></pre> </div></div>\n\n<p>Alternatively you can delete create objects one-by-one, depending on the type\nof deployment, for example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">NFD_NS</span><span class=\"o\">=</span>node-feature-discovery\nkubectl <span class=\"nt\">-n</span> <span class=\"nv\">$NFD_NS</span> delete ds nfd-worker\nkubectl <span class=\"nt\">-n</span> <span class=\"nv\">$NFD_NS</span> delete deploy nfd-master\nkubectl <span class=\"nt\">-n</span> <span class=\"nv\">$NFD_NS</span> delete svc nfd-master\nkubectl <span class=\"nt\">-n</span> <span class=\"nv\">$NFD_NS</span> delete sa nfd-master\nkubectl delete clusterrole nfd-master\nkubectl delete clusterrolebinding nfd-master\n</code></pre> </div></div>\n\n<h3 id=\"removing-feature-labels\">Removing feature labels</h3>\n\n<p>NFD-Master has a special <code class=\"language-plaintext highlighter-rouge\">-prune</code> command line flag for removing all\nnfd-related node labels, annotations and extended resources from the cluster.</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>kubectl apply <span class=\"nt\">-k</span> https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/prune?ref<span class=\"o\">=</span>v0.11.3\nkubectl <span class=\"nt\">-n</span> node-feature-discovery <span class=\"nb\">wait </span>job.batch/nfd-master <span class=\"nt\">--for</span><span class=\"o\">=</span><span class=\"nv\">condition</span><span class=\"o\">=</span><span class=\"nb\">complete</span> <span class=\"o\">&amp;&amp;</span> <span class=\"se\">\\</span>\n kubectl delete <span class=\"nt\">-k</span> https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/prune?ref<span class=\"o\">=</span>v0.11.3\n</code></pre> </div></div>\n\n<p><strong>NOTE:</strong> You must run prune before removing the RBAC rules (serviceaccount,\nclusterrole and clusterrolebinding).</p>\n\n<!-- Links -->\n","dir":"/get-started/","name":"deployment-and-usage.md","path":"get-started/deployment-and-usage.md","url":"/get-started/deployment-and-usage.html"},{"title":"Worker config reference","layout":"default","sort":4,"content":"<h1 class=\"no_toc\" id=\"configuration-file-reference-of-nfd-worker\">Configuration file reference of nfd-worker</h1>\n\n<h2 class=\"no_toc text-delta\" id=\"table-of-contents\">Table of contents</h2>\n\n<ol id=\"markdown-toc\">\n <li><a href=\"#core\" id=\"markdown-toc-core\">core</a> <ol>\n <li><a href=\"#coresleepinterval\" id=\"markdown-toc-coresleepinterval\">core.sleepInterval</a></li>\n <li><a href=\"#corefeaturesources\" id=\"markdown-toc-corefeaturesources\">core.featureSources</a></li>\n <li><a href=\"#corelabelsources\" id=\"markdown-toc-corelabelsources\">core.labelSources</a></li>\n <li><a href=\"#coresources\" id=\"markdown-toc-coresources\">core.sources</a></li>\n <li><a href=\"#corelabelwhitelist\" id=\"markdown-toc-corelabelwhitelist\">core.labelWhiteList</a></li>\n <li><a href=\"#corenopublish\" id=\"markdown-toc-corenopublish\">core.noPublish</a></li>\n <li><a href=\"#coreklog\" id=\"markdown-toc-coreklog\">core.klog</a></li>\n </ol>\n </li>\n <li><a href=\"#sources\" id=\"markdown-toc-sources\">sources</a> <ol>\n <li><a href=\"#sourcescpu\" id=\"markdown-toc-sourcescpu\">sources.cpu</a></li>\n <li><a href=\"#sourceskernel\" id=\"markdown-toc-sourceskernel\">sources.kernel</a></li>\n <li><a href=\"#sourespci\" id=\"markdown-toc-sourespci\">soures.pci</a></li>\n <li><a href=\"#sourcesusb\" id=\"markdown-toc-sourcesusb\">sources.usb</a></li>\n <li><a href=\"#sourcescustom\" id=\"markdown-toc-sourcescustom\">sources.custom</a></li>\n </ol>\n </li>\n</ol>\n\n<hr />\n\n<p>See the\n<a href=\"https://github.com/kubernetes-sigs/node-feature-discovery/blob/v0.11.3/deployment/components/worker-config/nfd-worker.conf.example\">sample configuration file</a>\nfor a full example configuration.</p>\n\n<h2 id=\"core\">core</h2>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">core</code> section contains common configuration settings that are not specific\nto any particular feature source.</p>\n\n<h3 id=\"coresleepinterval\">core.sleepInterval</h3>\n\n<p><code class=\"language-plaintext highlighter-rouge\">core.sleepInterval</code> specifies the interval between consecutive passes of\nfeature (re-)detection, and thus also the interval between node re-labeling. A\nnon-positive value implies infinite sleep interval, i.e. no re-detection or\nre-labeling is done.</p>\n\n<p>Note: Overridden by the deprecated <code class=\"language-plaintext highlighter-rouge\">-sleep-interval</code> command line flag (if\nspecified).</p>\n\n<p>Default: <code class=\"language-plaintext highlighter-rouge\">60s</code></p>\n\n<p>Example:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">core</span><span class=\"pi\">:</span>\n <span class=\"na\">sleepInterval</span><span class=\"pi\">:</span> <span class=\"s\">60s</span>\n</code></pre> </div></div>\n\n<h3 id=\"corefeaturesources\">core.featureSources</h3>\n\n<p><code class=\"language-plaintext highlighter-rouge\">core.featureSources</code> specifies the list of enabled feature sources. A special\nvalue <code class=\"language-plaintext highlighter-rouge\">all</code> enables all sources. Prefixing a source name with <code class=\"language-plaintext highlighter-rouge\">-</code> indicates\nthat the source will be disabled instead - this is only meaningful when used in\nconjunction with <code class=\"language-plaintext highlighter-rouge\">all</code>. This option allows completely disabling the feature\ndetection so that neither standard feature labels are generated nor the raw\nfeature data is available for custom rule processing.</p>\n\n<p>Default: <code class=\"language-plaintext highlighter-rouge\">[all]</code></p>\n\n<p>Example:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">core</span><span class=\"pi\">:</span>\n <span class=\"c1\"># Enable all but cpu and local sources</span>\n <span class=\"na\">featureSources</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"s2\">\"</span><span class=\"s\">all\"</span>\n <span class=\"pi\">-</span> <span class=\"s2\">\"</span><span class=\"s\">-cpu\"</span>\n <span class=\"pi\">-</span> <span class=\"s2\">\"</span><span class=\"s\">-local\"</span>\n</code></pre> </div></div>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">core</span><span class=\"pi\">:</span>\n <span class=\"c1\"># Enable only cpu and local sources</span>\n <span class=\"na\">featureSources</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"s2\">\"</span><span class=\"s\">cpu\"</span>\n <span class=\"pi\">-</span> <span class=\"s2\">\"</span><span class=\"s\">local\"</span>\n</code></pre> </div></div>\n\n<h3 id=\"corelabelsources\">core.labelSources</h3>\n\n<p><code class=\"language-plaintext highlighter-rouge\">core.labelSources</code> specifies the list of enabled label sources. A special\nvalue <code class=\"language-plaintext highlighter-rouge\">all</code> enables all sources. Prefixing a source name with <code class=\"language-plaintext highlighter-rouge\">-</code> indicates\nthat the source will be disabled instead - this is only meaningful when used in\nconjunction with <code class=\"language-plaintext highlighter-rouge\">all</code>. This configuration option affects the generation of\nnode labels but not the actual discovery of the underlying feature data that is\nused e.g. in custom/<code class=\"language-plaintext highlighter-rouge\">NodeFeatureRule</code> rules.</p>\n\n<p>Note: Overridden by the <code class=\"language-plaintext highlighter-rouge\">-label-sources</code> and <code class=\"language-plaintext highlighter-rouge\">-sources</code> command line flags and\nthe <code class=\"language-plaintext highlighter-rouge\">core.sources</code> configurations option (if any of them is specified).</p>\n\n<p>Default: <code class=\"language-plaintext highlighter-rouge\">[all]</code></p>\n\n<p>Example:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">core</span><span class=\"pi\">:</span>\n <span class=\"c1\"># Enable all but cpu and system sources</span>\n <span class=\"na\">labelSources</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"s2\">\"</span><span class=\"s\">all\"</span>\n <span class=\"pi\">-</span> <span class=\"s2\">\"</span><span class=\"s\">-cpu\"</span>\n <span class=\"pi\">-</span> <span class=\"s2\">\"</span><span class=\"s\">-system\"</span>\n</code></pre> </div></div>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">core</span><span class=\"pi\">:</span>\n <span class=\"c1\"># Enable only cpu and system sources</span>\n <span class=\"na\">labelSources</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"s2\">\"</span><span class=\"s\">cpu\"</span>\n <span class=\"pi\">-</span> <span class=\"s2\">\"</span><span class=\"s\">system\"</span>\n</code></pre> </div></div>\n\n<h3 id=\"coresources\">core.sources</h3>\n\n<p><strong>DEPRECATED</strong>: use <a href=\"#core.labelSources\"><code class=\"language-plaintext highlighter-rouge\">core.labelSources</code></a> instead.</p>\n\n<p>Note: <code class=\"language-plaintext highlighter-rouge\">core.sources</code> takes precedence over the <code class=\"language-plaintext highlighter-rouge\">core.labelSources</code>\nconfiguration file option.</p>\n\n<h3 id=\"corelabelwhitelist\">core.labelWhiteList</h3>\n\n<p><code class=\"language-plaintext highlighter-rouge\">core.labelWhiteList</code> specifies a regular expression for filtering feature\nlabels based on the label name. Non-matching labels are not published.</p>\n\n<p>Note: The regular expression is only matches against the “basename” part of the\nlabel, i.e. to the part of the name after /. The label prefix (or namespace)\nis omitted.</p>\n\n<p>Note: Overridden by the deprecated <code class=\"language-plaintext highlighter-rouge\">-label-whitelist</code> command line flag (if\nspecified).</p>\n\n<p>Default: <code class=\"language-plaintext highlighter-rouge\">null</code></p>\n\n<p>Example:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">core</span><span class=\"pi\">:</span>\n <span class=\"na\">labelWhiteList</span><span class=\"pi\">:</span> <span class=\"s1\">'</span><span class=\"s\">^cpu-cpuid'</span>\n</code></pre> </div></div>\n\n<h3 id=\"corenopublish\">core.noPublish</h3>\n\n<p>Setting <code class=\"language-plaintext highlighter-rouge\">core.noPublish</code> to <code class=\"language-plaintext highlighter-rouge\">true</code> disables all communication with the\nnfd-master. It is effectively a “dry-run” flag: nfd-worker runs feature\ndetection normally, but no labeling requests are sent to nfd-master.</p>\n\n<p>Note: Overridden by the <code class=\"language-plaintext highlighter-rouge\">-no-publish</code> command line flag (if specified).</p>\n\n<p>Default: <code class=\"language-plaintext highlighter-rouge\">false</code></p>\n\n<p>Example:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">core</span><span class=\"pi\">:</span>\n <span class=\"na\">noPublish</span><span class=\"pi\">:</span> <span class=\"no\">true</span>\n</code></pre> </div></div>\n\n<h3 id=\"coreklog\">core.klog</h3>\n\n<p>The following options specify the logger configuration. Most of which can be\ndynamically adjusted at run-time.</p>\n\n<p>Note: The logger options can also be specified via command line flags which\ntake precedence over any corresponding config file options.</p>\n\n<h4 id=\"coreklogadddirheader\">core.klog.addDirHeader</h4>\n\n<p>If true, adds the file directory to the header of the log messages.</p>\n\n<p>Default: <code class=\"language-plaintext highlighter-rouge\">false</code></p>\n\n<p>Run-time configurable: yes</p>\n\n<h4 id=\"coreklogalsologtostderr\">core.klog.alsologtostderr</h4>\n\n<p>Log to standard error as well as files.</p>\n\n<p>Default: <code class=\"language-plaintext highlighter-rouge\">false</code></p>\n\n<p>Run-time configurable: yes</p>\n\n<h4 id=\"corekloglogbacktraceat\">core.klog.logBacktraceAt</h4>\n\n<p>When logging hits line file:N, emit a stack trace.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Run-time configurable: yes</p>\n\n<h4 id=\"corekloglogdir\">core.klog.logDir</h4>\n\n<p>If non-empty, write log files in this directory.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Run-time configurable: no</p>\n\n<h4 id=\"corekloglogfile\">core.klog.logFile</h4>\n\n<p>If non-empty, use this log file.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Run-time configurable: no</p>\n\n<h4 id=\"corekloglogfilemaxsize\">core.klog.logFileMaxSize</h4>\n\n<p>Defines the maximum size a log file can grow to. Unit is megabytes. If the\nvalue is 0, the maximum file size is unlimited.</p>\n\n<p>Default: <code class=\"language-plaintext highlighter-rouge\">1800</code></p>\n\n<p>Run-time configurable: no</p>\n\n<h4 id=\"corekloglogtostderr\">core.klog.logtostderr</h4>\n\n<p>Log to standard error instead of files</p>\n\n<p>Default: <code class=\"language-plaintext highlighter-rouge\">true</code></p>\n\n<p>Run-time configurable: yes</p>\n\n<h4 id=\"coreklogskipheaders\">core.klog.skipHeaders</h4>\n\n<p>If true, avoid header prefixes in the log messages.</p>\n\n<p>Default: <code class=\"language-plaintext highlighter-rouge\">false</code></p>\n\n<p>Run-time configurable: yes</p>\n\n<h4 id=\"coreklogskiplogheaders\">core.klog.skipLogHeaders</h4>\n\n<p>If true, avoid headers when opening log files.</p>\n\n<p>Default: <code class=\"language-plaintext highlighter-rouge\">false</code></p>\n\n<p>Run-time configurable: no</p>\n\n<h4 id=\"coreklogstderrthreshold\">core.klog.stderrthreshold</h4>\n\n<p>Logs at or above this threshold go to stderr (default 2)</p>\n\n<p>Run-time configurable: yes</p>\n\n<h4 id=\"coreklogv\">core.klog.v</h4>\n\n<p>Number for the log level verbosity.</p>\n\n<p>Default: <code class=\"language-plaintext highlighter-rouge\">0</code></p>\n\n<p>Run-time configurable: yes</p>\n\n<h4 id=\"coreklogvmodule\">core.klog.vmodule</h4>\n\n<p>Comma-separated list of <code class=\"language-plaintext highlighter-rouge\">pattern=N</code> settings for file-filtered logging.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Run-time configurable: yes</p>\n\n<h2 id=\"sources\">sources</h2>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">sources</code> section contains feature source specific configuration parameters.</p>\n\n<h3 id=\"sourcescpu\">sources.cpu</h3>\n\n<h4 id=\"sourcescpucpuid\">sources.cpu.cpuid</h4>\n\n<h5 id=\"sourcescpucpuidattributeblacklist\">sources.cpu.cpuid.attributeBlacklist</h5>\n\n<p>Prevent publishing cpuid features listed in this option.</p>\n\n<p>Note: overridden by <code class=\"language-plaintext highlighter-rouge\">sources.cpu.cpuid.attributeWhitelist</code> (if specified)</p>\n\n<p>Default: <code class=\"language-plaintext highlighter-rouge\">[BMI1, BMI2, CLMUL, CMOV, CX16, ERMS, F16C, HTT, LZCNT, MMX, MMXEXT,\nNX, POPCNT, RDRAND, RDSEED, RDTSCP, SGX, SGXLC, SSE, SSE2, SSE3, SSE4.1,\nSSE4.2, SSSE3]</code></p>\n\n<p>Example:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">sources</span><span class=\"pi\">:</span>\n <span class=\"na\">cpu</span><span class=\"pi\">:</span>\n <span class=\"na\">cpuid</span><span class=\"pi\">:</span>\n <span class=\"na\">attributeBlacklist</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"nv\">MMX</span><span class=\"pi\">,</span> <span class=\"nv\">MMXEXT</span><span class=\"pi\">]</span>\n</code></pre> </div></div>\n\n<h5 id=\"sourcescpucpuidattributewhitelist\">sources.cpu.cpuid.attributeWhitelist</h5>\n\n<p>Only publish the cpuid features listed in this option.</p>\n\n<p>Note: takes precedence over <code class=\"language-plaintext highlighter-rouge\">sources.cpu.cpuid.attributeBlacklist</code></p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Example:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">sources</span><span class=\"pi\">:</span>\n <span class=\"na\">cpu</span><span class=\"pi\">:</span>\n <span class=\"na\">cpuid</span><span class=\"pi\">:</span>\n <span class=\"na\">attributeWhitelist</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"nv\">AVX512BW</span><span class=\"pi\">,</span> <span class=\"nv\">AVX512CD</span><span class=\"pi\">,</span> <span class=\"nv\">AVX512DQ</span><span class=\"pi\">,</span> <span class=\"nv\">AVX512F</span><span class=\"pi\">,</span> <span class=\"nv\">AVX512VL</span><span class=\"pi\">]</span>\n</code></pre> </div></div>\n\n<h3 id=\"sourceskernel\">sources.kernel</h3>\n\n<h4 id=\"sourceskernelkconfigfile\">sources.kernel.kconfigFile</h4>\n\n<p>Path of the kernel config file. If empty, NFD runs a search in the well-known\nstandard locations.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Example:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">sources</span><span class=\"pi\">:</span>\n <span class=\"na\">kernel</span><span class=\"pi\">:</span>\n <span class=\"na\">kconfigFile</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">/path/to/kconfig\"</span>\n</code></pre> </div></div>\n\n<h4 id=\"sourceskernelconfigopts\">sources.kernel.configOpts</h4>\n\n<p>Kernel configuration options to publish as feature labels.</p>\n\n<p>Default: <code class=\"language-plaintext highlighter-rouge\">[NO_HZ, NO_HZ_IDLE, NO_HZ_FULL, PREEMPT]</code></p>\n\n<p>Example:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">sources</span><span class=\"pi\">:</span>\n <span class=\"na\">kernel</span><span class=\"pi\">:</span>\n <span class=\"na\">configOpts</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"nv\">NO_HZ</span><span class=\"pi\">,</span> <span class=\"nv\">X86</span><span class=\"pi\">,</span> <span class=\"nv\">DMI</span><span class=\"pi\">]</span>\n</code></pre> </div></div>\n\n<h3 id=\"sourespci\">soures.pci</h3>\n\n<h4 id=\"sourespcideviceclasswhitelist\">soures.pci.deviceClassWhitelist</h4>\n\n<p>List of PCI <a href=\"https://pci-ids.ucw.cz/read/PD\">device class</a> IDs for which to\npublish a label. Can be specified as a main class only (e.g. <code class=\"language-plaintext highlighter-rouge\">03</code>) or full\nclass-subclass combination (e.g. <code class=\"language-plaintext highlighter-rouge\">0300</code>) - the former implies that all\nsubclasses are accepted. The format of the labels can be further configured\nwith <a href=\"#soures.pci.deviceLabelFields\">deviceLabelFields</a>.</p>\n\n<p>Default: <code class=\"language-plaintext highlighter-rouge\">[\"03\", \"0b40\", \"12\"]</code></p>\n\n<p>Example:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">sources</span><span class=\"pi\">:</span>\n <span class=\"na\">pci</span><span class=\"pi\">:</span>\n <span class=\"na\">deviceClassWhitelist</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">0200\"</span><span class=\"pi\">,</span> <span class=\"s2\">\"</span><span class=\"s\">03\"</span><span class=\"pi\">]</span>\n</code></pre> </div></div>\n\n<h4 id=\"sourespcidevicelabelfields\">soures.pci.deviceLabelFields</h4>\n\n<p>The set of PCI ID fields to use when constructing the name of the feature\nlabel. Valid fields are <code class=\"language-plaintext highlighter-rouge\">class</code>, <code class=\"language-plaintext highlighter-rouge\">vendor</code>, <code class=\"language-plaintext highlighter-rouge\">device</code>, <code class=\"language-plaintext highlighter-rouge\">subsystem_vendor</code> and\n<code class=\"language-plaintext highlighter-rouge\">subsystem_device</code>.</p>\n\n<p>Default: <code class=\"language-plaintext highlighter-rouge\">[class, vendor]</code></p>\n\n<p>Example:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">sources</span><span class=\"pi\">:</span>\n <span class=\"na\">pci</span><span class=\"pi\">:</span>\n <span class=\"na\">deviceLabelFields</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"nv\">class</span><span class=\"pi\">,</span> <span class=\"nv\">vendor</span><span class=\"pi\">,</span> <span class=\"nv\">device</span><span class=\"pi\">]</span>\n</code></pre> </div></div>\n\n<p>With the example config above NFD would publish labels like:\n<code class=\"language-plaintext highlighter-rouge\">feature.node.kubernetes.io/pci-&lt;class-id&gt;_&lt;vendor-id&gt;_&lt;device-id&gt;.present=true</code></p>\n\n<h3 id=\"sourcesusb\">sources.usb</h3>\n\n<h4 id=\"souresusbdeviceclasswhitelist\">soures.usb.deviceClassWhitelist</h4>\n\n<p>List of USB <a href=\"https://www.usb.org/defined-class-codes\">device class</a> IDs for\nwhich to publish a feature label. The format of the labels can be further\nconfigured with <a href=\"#soures.usb.deviceLabelFields\">deviceLabelFields</a>.</p>\n\n<p>Default: <code class=\"language-plaintext highlighter-rouge\">[\"0e\", \"ef\", \"fe\", \"ff\"]</code></p>\n\n<p>Example:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">sources</span><span class=\"pi\">:</span>\n <span class=\"na\">usb</span><span class=\"pi\">:</span>\n <span class=\"na\">deviceClassWhitelist</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">ef\"</span><span class=\"pi\">,</span> <span class=\"s2\">\"</span><span class=\"s\">ff\"</span><span class=\"pi\">]</span>\n</code></pre> </div></div>\n\n<h4 id=\"souresusbdevicelabelfields\">soures.usb.deviceLabelFields</h4>\n\n<p>The set of USB ID fields from which to compose the name of the feature label.\nValid fields are <code class=\"language-plaintext highlighter-rouge\">class</code>, <code class=\"language-plaintext highlighter-rouge\">vendor</code>, <code class=\"language-plaintext highlighter-rouge\">device</code> and <code class=\"language-plaintext highlighter-rouge\">serial</code>.</p>\n\n<p>Default: <code class=\"language-plaintext highlighter-rouge\">[class, vendor, device]</code></p>\n\n<p>Example:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">sources</span><span class=\"pi\">:</span>\n <span class=\"na\">pci</span><span class=\"pi\">:</span>\n <span class=\"na\">deviceLabelFields</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"nv\">class</span><span class=\"pi\">,</span> <span class=\"nv\">vendor</span><span class=\"pi\">]</span>\n</code></pre> </div></div>\n\n<p>With the example config above NFD would publish labels like:\n<code class=\"language-plaintext highlighter-rouge\">feature.node.kubernetes.io/usb-&lt;class-id&gt;_&lt;vendor-id&gt;.present=true</code></p>\n\n<h3 id=\"sourcescustom\">sources.custom</h3>\n\n<p>List of rules to process in the custom feature source to create user-specific\nlabels. Refer to the documentation of the\n<a href=\"customization-guide.html#custom-feature-source\">custom feature source</a> for\ndetails of the available rules and their configuration.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Example:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">sources</span><span class=\"pi\">:</span>\n <span class=\"na\">custom</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">my</span><span class=\"nv\"> </span><span class=\"s\">custom</span><span class=\"nv\"> </span><span class=\"s\">rule\"</span>\n <span class=\"na\">labels</span><span class=\"pi\">:</span>\n <span class=\"na\">my-custom-feature</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">true\"</span>\n <span class=\"na\">matchFeatures</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">kernel.loadedmodule</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">e1000e</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">Exists</span><span class=\"pi\">}</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">pci.device</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">class</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">In</span><span class=\"pi\">,</span> <span class=\"nv\">value</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">0200\"</span><span class=\"pi\">]}</span>\n <span class=\"na\">vendor</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">In</span><span class=\"pi\">,</span> <span class=\"nv\">value</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">8086\"</span><span class=\"pi\">]}</span>\n</code></pre> </div></div>\n","dir":"/advanced/","name":"worker-configuration-reference.md","path":"advanced/worker-configuration-reference.md","url":"/advanced/worker-configuration-reference.html"},{"title":"Feature labels","layout":"default","sort":4,"content":"<h1 class=\"no_toc\" id=\"feature-labels\">Feature labels</h1>\n\n<h2 class=\"no_toc text-delta\" id=\"table-of-contents\">Table of contents</h2>\n\n<ol id=\"markdown-toc\">\n <li><a href=\"#built-in-labels\" id=\"markdown-toc-built-in-labels\">Built-in labels</a> <ol>\n <li><a href=\"#cpu\" id=\"markdown-toc-cpu\">CPU</a></li>\n <li><a href=\"#iommu-deprecated\" id=\"markdown-toc-iommu-deprecated\">IOMMU (deprecated)</a></li>\n <li><a href=\"#kernel\" id=\"markdown-toc-kernel\">Kernel</a></li>\n <li><a href=\"#memory\" id=\"markdown-toc-memory\">Memory</a></li>\n <li><a href=\"#network\" id=\"markdown-toc-network\">Network</a></li>\n <li><a href=\"#pci\" id=\"markdown-toc-pci\">PCI</a></li>\n <li><a href=\"#usb\" id=\"markdown-toc-usb\">USB</a></li>\n <li><a href=\"#storage\" id=\"markdown-toc-storage\">Storage</a></li>\n <li><a href=\"#system\" id=\"markdown-toc-system\">System</a></li>\n <li><a href=\"#custom\" id=\"markdown-toc-custom\">Custom</a></li>\n </ol>\n </li>\n <li><a href=\"#user-defined-labels\" id=\"markdown-toc-user-defined-labels\">User defined labels</a></li>\n <li><a href=\"#extended-resources\" id=\"markdown-toc-extended-resources\">Extended resources</a></li>\n</ol>\n\n<hr />\n\n<p>Features are advertised as labels in the Kubernetes Node object.</p>\n\n<h2 id=\"built-in-labels\">Built-in labels</h2>\n\n<p>Label creation in nfd-worker is performed by a set of separate modules called\nlabel sources. The\n<a href=\"../advanced/worker-configuration-reference#corelabelsources\"><code class=\"language-plaintext highlighter-rouge\">core.labelSources</code></a>\nconfiguration option (or\n<a href=\"../advanced/worker-commandline-reference#-label-sources\"><code class=\"language-plaintext highlighter-rouge\">-label-sources</code></a>\nflag) of nfd-worker controls which sources to enable for label generation.</p>\n\n<p>All built-in labels use the <code class=\"language-plaintext highlighter-rouge\">feature.node.kubernetes.io</code> label namespace and\nhave the following format.</p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>feature.node.kubernetes.io/&lt;feature&gt; = &lt;value&gt;\n</code></pre> </div></div>\n\n<p><em>Note: Consecutive runs of nfd-worker will update the labels on a\ngiven node. If features are not discovered on a consecutive run, the corresponding\nlabel will be removed. This includes any restrictions placed on the consecutive run,\nsuch as restricting discovered features with the -label-whitelist option.</em></p>\n\n<h3 id=\"cpu\">CPU</h3>\n\n<table>\n <thead>\n <tr>\n <th>Feature name</th>\n <th>Value</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu-cpuid.&lt;cpuid-flag&gt;</code></strong></td>\n <td>true</td>\n <td>CPU capability is supported. <strong>NOTE:</strong> the capability might be supported but not enabled.</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu-hardware_multithreading</code></strong></td>\n <td>true</td>\n <td>Hardware multithreading, such as Intel HTT, enabled (number of logical CPUs is greater than physical CPUs)</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu-power.sst_bf.enabled</code></strong></td>\n <td>true</td>\n <td>Intel SST-BF (<a href=\"https://www.intel.com/content/www/us/en/architecture-and-technology/speed-select-technology-article.html\">Intel Speed Select Technology</a> - Base frequency) enabled</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu-pstate.status</code></strong></td>\n <td>string</td>\n <td>The status of the <a href=\"https://www.kernel.org/doc/Documentation/cpu-freq/intel-pstate.txt\">Intel pstate</a> driver when in use and enabled, either active or passive.</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu-pstate.turbo</code></strong></td>\n <td>bool</td>\n <td>Set to true if turbo frequencies are enabled in Intel pstate driver, set to false if they have been disabled.</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu-pstate.scaling_governor</code></strong></td>\n <td>string</td>\n <td>The value of the Intel pstate scaling_governor when in use, either powersave or performance.</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu-cstate.enabled</code></strong></td>\n <td>bool</td>\n <td>Set to true if cstates are set in the intel_idle driver, otherwise set to false. Unset if intel_idle cpuidle driver is not active.</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu-rdt.&lt;rdt-flag&gt;</code></strong></td>\n <td>true</td>\n <td><a href=\"http://www.intel.com/content/www/us/en/architecture-and-technology/resource-director-technology.html\">Intel RDT</a> capability is supported. See <a href=\"#intel-rdt-flags\">RDT flags</a> for details.</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu-sgx.enabled</code></strong></td>\n <td>true</td>\n <td>Set to true if Intel SGX is enabled in BIOS (based a non-zero sum value of SGX EPC section sizes).</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu-se.enabled</code></strong></td>\n <td>true</td>\n <td>Set to true if IBM Secure Execution for Linux (IBM Z &amp; LinuxONE) is available and enabled (requires <code class=\"language-plaintext highlighter-rouge\">/sys/firmware/uv/prot_virt_host</code> facility)</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu-model.vendor_id</code></strong></td>\n <td>string</td>\n <td>Comparable CPU vendor ID.</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu-model.family</code></strong></td>\n <td>int</td>\n <td>CPU family.</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu-model.id</code></strong></td>\n <td>int</td>\n <td>CPU model number.</td>\n </tr>\n </tbody>\n</table>\n\n<p>The CPU label source is configurable, see\n<a href=\"deployment-and-usage#worker-configuration\">worker configuration</a> and\n<a href=\"../advanced/worker-configuration-reference#sourcescpu\"><code class=\"language-plaintext highlighter-rouge\">sources.cpu</code></a>\nconfiguration options for details.</p>\n\n<h4 id=\"x86-cpuid-flags-partial-list\">X86 CPUID flags (partial list)</h4>\n\n<table>\n <thead>\n <tr>\n <th>Flag</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>ADX</td>\n <td>Multi-Precision Add-Carry Instruction Extensions (ADX)</td>\n </tr>\n <tr>\n <td>AESNI</td>\n <td>Advanced Encryption Standard (AES) New Instructions (AES-NI)</td>\n </tr>\n <tr>\n <td>AVX</td>\n <td>Advanced Vector Extensions (AVX)</td>\n </tr>\n <tr>\n <td>AVX2</td>\n <td>Advanced Vector Extensions 2 (AVX2)</td>\n </tr>\n <tr>\n <td>AMXBF16</td>\n <td>Advanced Matrix Extension, tile multiplication operations on BFLOAT16 numbers</td>\n </tr>\n <tr>\n <td>AMXINT8</td>\n <td>Advanced Matrix Extension, tile multiplication operations on 8-bit integers</td>\n </tr>\n <tr>\n <td>AMXTILE</td>\n <td>Advanced Matrix Extension, base tile architecture support</td>\n </tr>\n <tr>\n <td>AVX512BF16</td>\n <td>AVX-512 BFLOAT16 instructions</td>\n </tr>\n <tr>\n <td>AVX512BITALG</td>\n <td>AVX-512 bit Algorithms</td>\n </tr>\n <tr>\n <td>AVX512BW</td>\n <td>AVX-512 byte and word Instructions</td>\n </tr>\n <tr>\n <td>AVX512CD</td>\n <td>AVX-512 conflict detection instructions</td>\n </tr>\n <tr>\n <td>AVX512DQ</td>\n <td>AVX-512 doubleword and quadword instructions</td>\n </tr>\n <tr>\n <td>AVX512ER</td>\n <td>AVX-512 exponential and reciprocal instructions</td>\n </tr>\n <tr>\n <td>AVX512F</td>\n <td>AVX-512 foundation</td>\n </tr>\n <tr>\n <td>AVX512FP16</td>\n <td>AVX-512 FP16 instructions</td>\n </tr>\n <tr>\n <td>AVX512IFMA</td>\n <td>AVX-512 integer fused multiply-add instructions</td>\n </tr>\n <tr>\n <td>AVX512PF</td>\n <td>AVX-512 prefetch instructions</td>\n </tr>\n <tr>\n <td>AVX512VBMI</td>\n <td>AVX-512 vector bit manipulation instructions</td>\n </tr>\n <tr>\n <td>AVX512VBMI2</td>\n <td>AVX-512 vector bit manipulation instructions, version 2</td>\n </tr>\n <tr>\n <td>AVX512VL</td>\n <td>AVX-512 vector length extensions</td>\n </tr>\n <tr>\n <td>AVX512VNNI</td>\n <td>AVX-512 vector neural network instructions</td>\n </tr>\n <tr>\n <td>AVX512VP2INTERSECT</td>\n <td>AVX-512 intersect for D/Q</td>\n </tr>\n <tr>\n <td>AVX512VPOPCNTDQ</td>\n <td>AVX-512 vector population count doubleword and quadword</td>\n </tr>\n <tr>\n <td>ENQCMD</td>\n <td>Enqueue Command</td>\n </tr>\n <tr>\n <td>GFNI</td>\n <td>Galois Field New Instructions</td>\n </tr>\n <tr>\n <td>HYPERVISOR</td>\n <td>Running under hypervisor</td>\n </tr>\n <tr>\n <td>VAES</td>\n <td>AVX-512 vector AES instructions</td>\n </tr>\n <tr>\n <td>VPCLMULQDQ</td>\n <td>Carry-less multiplication quadword</td>\n </tr>\n </tbody>\n</table>\n\n<p>By default, the following CPUID flags have been blacklisted: BMI1, BMI2, CLMUL,\nCMOV, CX16, ERMS, F16C, HTT, LZCNT, MMX, MMXEXT, NX, POPCNT, RDRAND, RDSEED,\nRDTSCP, SGX, SSE, SSE2, SSE3, SSE4, SSE42 and SSSE3. See\n<a href=\"../advanced/worker-configuration-reference#sourcescpu\"><code class=\"language-plaintext highlighter-rouge\">sources.cpu</code></a>\nconfiguration options to change the behavior.</p>\n\n<p>See the full list in <a href=\"https://github.com/klauspost/cpuid#x86-cpu-instructions\">github.com/klauspost/cpuid</a>.</p>\n\n<h4 id=\"arm-cpuid-flags-partial-list\">Arm CPUID flags (partial list)</h4>\n\n<table>\n <thead>\n <tr>\n <th>Flag</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>IDIVA</td>\n <td>Integer divide instructions available in ARM mode</td>\n </tr>\n <tr>\n <td>IDIVT</td>\n <td>Integer divide instructions available in Thumb mode</td>\n </tr>\n <tr>\n <td>THUMB</td>\n <td>Thumb instructions</td>\n </tr>\n <tr>\n <td>FASTMUL</td>\n <td>Fast multiplication</td>\n </tr>\n <tr>\n <td>VFP</td>\n <td>Vector floating point instruction extension (VFP)</td>\n </tr>\n <tr>\n <td>VFPv3</td>\n <td>Vector floating point extension v3</td>\n </tr>\n <tr>\n <td>VFPv4</td>\n <td>Vector floating point extension v4</td>\n </tr>\n <tr>\n <td>VFPD32</td>\n <td>VFP with 32 D-registers</td>\n </tr>\n <tr>\n <td>HALF</td>\n <td>Half-word loads and stores</td>\n </tr>\n <tr>\n <td>EDSP</td>\n <td>DSP extensions</td>\n </tr>\n <tr>\n <td>NEON</td>\n <td>NEON SIMD instructions</td>\n </tr>\n <tr>\n <td>LPAE</td>\n <td>Large Physical Address Extensions</td>\n </tr>\n </tbody>\n</table>\n\n<h4 id=\"arm64-cpuid-flags-partial-list\">Arm64 CPUID flags (partial list)</h4>\n\n<table>\n <thead>\n <tr>\n <th>Flag</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>AES</td>\n <td>Announcing the Advanced Encryption Standard</td>\n </tr>\n <tr>\n <td>EVSTRM</td>\n <td>Event Stream Frequency Features</td>\n </tr>\n <tr>\n <td>FPHP</td>\n <td>Half Precision(16bit) Floating Point Data Processing Instructions</td>\n </tr>\n <tr>\n <td>ASIMDHP</td>\n <td>Half Precision(16bit) Asimd Data Processing Instructions</td>\n </tr>\n <tr>\n <td>ATOMICS</td>\n <td>Atomic Instructions to the A64</td>\n </tr>\n <tr>\n <td>ASIMRDM</td>\n <td>Support for Rounding Double Multiply Add/Subtract</td>\n </tr>\n <tr>\n <td>PMULL</td>\n <td>Optional Cryptographic and CRC32 Instructions</td>\n </tr>\n <tr>\n <td>JSCVT</td>\n <td>Perform Conversion to Match Javascript</td>\n </tr>\n <tr>\n <td>DCPOP</td>\n <td>Persistent Memory Support</td>\n </tr>\n </tbody>\n</table>\n\n<h4 id=\"intel-rdt-flags\">Intel RDT flags</h4>\n\n<table>\n <thead>\n <tr>\n <th>Flag</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>RDTMON</td>\n <td>Intel RDT Monitoring Technology</td>\n </tr>\n <tr>\n <td>RDTCMT</td>\n <td>Intel Cache Monitoring (CMT)</td>\n </tr>\n <tr>\n <td>RDTMBM</td>\n <td>Intel Memory Bandwidth Monitoring (MBM)</td>\n </tr>\n <tr>\n <td>RDTL3CA</td>\n <td>Intel L3 Cache Allocation Technology</td>\n </tr>\n <tr>\n <td>RDTl2CA</td>\n <td>Intel L2 Cache Allocation Technology</td>\n </tr>\n <tr>\n <td>RDTMBA</td>\n <td>Intel Memory Bandwidth Allocation (MBA) Technology</td>\n </tr>\n </tbody>\n</table>\n\n<h3 id=\"iommu-deprecated\">IOMMU (deprecated)</h3>\n\n<table>\n <thead>\n <tr>\n <th>Feature</th>\n <th>Value</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">iommu.enabled</code></strong></td>\n <td>true</td>\n <td>IOMMU is present and enabled in the kernel</td>\n </tr>\n </tbody>\n</table>\n\n<p><strong>DEPRECATED</strong>: The <strong>iommu</strong> source is deprecated and not enabled by default.</p>\n\n<h3 id=\"kernel\">Kernel</h3>\n\n<table>\n <thead>\n <tr>\n <th>Feature</th>\n <th>Value</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">kernel-config.&lt;option&gt;</code></strong></td>\n <td>true</td>\n <td>Kernel config option is enabled (set y or m). Default options are <code class=\"language-plaintext highlighter-rouge\">NO_HZ</code>, <code class=\"language-plaintext highlighter-rouge\">NO_HZ_IDLE</code>, <code class=\"language-plaintext highlighter-rouge\">NO_HZ_FULL</code> and <code class=\"language-plaintext highlighter-rouge\">PREEMPT</code></td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">kernel-selinux.enabled</code></strong></td>\n <td>true</td>\n <td>Selinux is enabled on the node</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">kernel-version.full</code></strong></td>\n <td>string</td>\n <td>Full kernel version as reported by <code class=\"language-plaintext highlighter-rouge\">/proc/sys/kernel/osrelease</code> (e.g. 4.5.6-7-g123abcde)</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">kernel-version.major</code></strong></td>\n <td>string</td>\n <td>First component of the kernel version (e.g. 4)</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">kernel-version.minor</code></strong></td>\n <td>string</td>\n <td>Second component of the kernel version (e.g. 5)</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">kernel-version.revision</code></strong></td>\n <td>string</td>\n <td>Third component of the kernel version (e.g. 6)</td>\n </tr>\n </tbody>\n</table>\n\n<p>The kernel label source is configurable, see\n<a href=\"deployment-and-usage#worker-configuration\">worker configuration</a> and\n<a href=\"../advanced/worker-configuration-reference#sourceskernel\"><code class=\"language-plaintext highlighter-rouge\">sources.kernel</code></a>\nconfiguration options for details.</p>\n\n<h3 id=\"memory\">Memory</h3>\n\n<table>\n <thead>\n <tr>\n <th>Feature</th>\n <th>Value</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">memory-numa</code></strong></td>\n <td>true</td>\n <td>Multiple memory nodes i.e. NUMA architecture detected</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">memory-nv.present</code></strong></td>\n <td>true</td>\n <td>NVDIMM device(s) are present</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">memory-nv.dax</code></strong></td>\n <td>true</td>\n <td>NVDIMM region(s) configured in DAX mode are present</td>\n </tr>\n </tbody>\n</table>\n\n<h3 id=\"network\">Network</h3>\n\n<table>\n <thead>\n <tr>\n <th>Feature</th>\n <th>Value</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">network-sriov.capable</code></strong></td>\n <td>true</td>\n <td><a href=\"http://www.intel.com/content/www/us/en/pci-express/pci-sig-sr-iov-primer-sr-iov-technology-paper.html\">Single Root Input/Output Virtualization</a> (SR-IOV) enabled Network Interface Card(s) present</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">network-sriov.configured</code></strong></td>\n <td>true</td>\n <td>SR-IOV virtual functions have been configured</td>\n </tr>\n </tbody>\n</table>\n\n<h3 id=\"pci\">PCI</h3>\n\n<table>\n <thead>\n <tr>\n <th>Feature</th>\n <th>Value</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">pci-&lt;device label&gt;.present</code></strong></td>\n <td>true</td>\n <td>PCI device is detected</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">pci-&lt;device label&gt;.sriov.capable</code></strong></td>\n <td>true</td>\n <td><a href=\"http://www.intel.com/content/www/us/en/pci-express/pci-sig-sr-iov-primer-sr-iov-technology-paper.html\">Single Root Input/Output Virtualization</a> (SR-IOV) enabled PCI device present</td>\n </tr>\n </tbody>\n</table>\n\n<p><code class=\"language-plaintext highlighter-rouge\">&lt;device label&gt;</code> is format is configurable and set to <code class=\"language-plaintext highlighter-rouge\">&lt;class&gt;_&lt;vendor&gt;</code> by\ndefault. For more more details about configuration of the pci labels, see\n<a href=\"../advanced/worker-configuration-reference#sourcespci\"><code class=\"language-plaintext highlighter-rouge\">sources.pci</code></a> options\nand <a href=\"deployment-and-usage#worker-configuration\">worker configuration</a>\ninstructions.</p>\n\n<h3 id=\"usb\">USB</h3>\n\n<table>\n <thead>\n <tr>\n <th>Feature</th>\n <th>Value</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">usb-&lt;device label&gt;.present</code></strong></td>\n <td>true</td>\n <td>USB device is detected</td>\n </tr>\n </tbody>\n</table>\n\n<p><code class=\"language-plaintext highlighter-rouge\">&lt;device label&gt;</code> is format is configurable and set to\n<code class=\"language-plaintext highlighter-rouge\">&lt;class&gt;_&lt;vendor&gt;_&lt;device&gt;</code> by default. For more more details about\nconfiguration of the usb labels, see\n<a href=\"../advanced/worker-configuration-reference#sourcesusb\"><code class=\"language-plaintext highlighter-rouge\">sources.usb</code></a> options\nand <a href=\"deployment-and-usage#worker-configuration\">worker configuration</a>\ninstructions.</p>\n\n<h3 id=\"storage\">Storage</h3>\n\n<table>\n <thead>\n <tr>\n <th>Feature</th>\n <th>Value</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">storage-nonrotationaldisk</code></strong></td>\n <td>true</td>\n <td>Non-rotational disk, like SSD, is present in the node</td>\n </tr>\n </tbody>\n</table>\n\n<h3 id=\"system\">System</h3>\n\n<table>\n <thead>\n <tr>\n <th>Feature</th>\n <th>Value</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">system-os_release.ID</code></strong></td>\n <td>string</td>\n <td>Operating system identifier</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">system-os_release.VERSION_ID</code></strong></td>\n <td>string</td>\n <td>Operating system version identifier (e.g. 6.7)</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">system-os_release.VERSION_ID.major</code></strong></td>\n <td>string</td>\n <td>First component of the OS version id (e.g. 6)</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">system-os_release.VERSION_ID.minor</code></strong></td>\n <td>string</td>\n <td>Second component of the OS version id (e.g. 7)</td>\n </tr>\n </tbody>\n</table>\n\n<h3 id=\"custom\">Custom</h3>\n\n<p>The custom label source is designed for creating\n<a href=\"#user-defined-labels\">user defined labels</a>. However, it has a few statically\ndefined built-in labels:</p>\n\n<table>\n <thead>\n <tr>\n <th>Feature</th>\n <th>Value</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">custom-rdma.capable</code></strong></td>\n <td>true</td>\n <td>The node has an RDMA capable Network adapter</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">custom-rdma.enabled</code></strong></td>\n <td>true</td>\n <td>The node has the needed RDMA modules loaded to run RDMA traffic</td>\n </tr>\n </tbody>\n</table>\n\n<h2 id=\"user-defined-labels\">User defined labels</h2>\n\n<p>NFD has many extension points for creating vendor and application specific\nlabels. See the <a href=\"/node-feature-discovery/v0.11/advanced/customization-guide.html\">customization guide</a> for\ndetailed documentation.</p>\n\n<h2 id=\"extended-resources\">Extended resources</h2>\n\n<p>This feature is experimental and by no means a replacement for the usage of\ndevice plugins.</p>\n\n<p>Labels which have integer values, can be promoted to Kubernetes extended\nresources by listing them to the master <code class=\"language-plaintext highlighter-rouge\">-resource-labels</code> command line flag.\nThese labels wont then show in the node label section, they will appear only\nas extended resources.</p>\n\n<p>An example use-case for the extended resources could be based on a hook which\ncreates a label for the node SGX EPC memory section size. By giving the name of\nthat label in the <code class=\"language-plaintext highlighter-rouge\">-resource-labels</code> flag, that value will then turn into an\nextended resource of the node, allowing PODs to request that resource and the\nKubernetes scheduler to schedule such PODs to only those nodes which have a\nsufficient capacity of said resource left.</p>\n\n<p>Similar to labels, the default namespace <code class=\"language-plaintext highlighter-rouge\">feature.node.kubernetes.io</code> is\nautomatically prefixed to the extended resource, if the promoted label doesnt\nhave a namespace.</p>\n\n<p>Example usage of the command line arguments, using a new namespace:\n<code class=\"language-plaintext highlighter-rouge\">nfd-master -resource-labels=my_source-my.feature,sgx.some.ns/epc -extra-label-ns=sgx.some.ns</code></p>\n\n<p>The above would result in following extended resources provided that related\nlabels exist:</p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code> sgx.some.ns/epc: &lt;label value&gt;\n feature.node.kubernetes.io/my_source-my.feature: &lt;label value&gt;\n</code></pre> </div></div>\n\n<!-- Links -->\n","dir":"/get-started/","name":"features.md","path":"get-started/features.md","url":"/get-started/features.html"},{"title":"Examples and demos","layout":"default","sort":5,"content":"<h1 class=\"no_toc\" id=\"examples-and-demos\">Examples and demos</h1>\n\n<h2 class=\"no_toc text-delta\" id=\"table-of-contents\">Table of contents</h2>\n\n<ol id=\"markdown-toc\">\n <li><a href=\"#demos\" id=\"markdown-toc-demos\">Demos</a> <ol>\n <li><a href=\"#usage-demo\" id=\"markdown-toc-usage-demo\">Usage demo</a></li>\n <li><a href=\"#demo-use-case\" id=\"markdown-toc-demo-use-case\">Demo use case</a></li>\n </ol>\n </li>\n</ol>\n\n<hr />\n\n<p>This page contains usage examples and demos.</p>\n\n<h2 id=\"demos\">Demos</h2>\n\n<h3 id=\"usage-demo\">Usage demo</h3>\n\n<p><a href=\"https://asciinema.org/a/247316\"><img src=\"https://asciinema.org/a/247316.svg\" alt=\"asciicast\" /></a></p>\n\n<h3 id=\"demo-use-case\">Demo use case</h3>\n\n<p>A demo on the benefits of using node feature discovery can be found in the\nsource code repository under\n<a href=\"https://github.com/kubernetes-sigs/node-feature-discovery/tree/v0.11.3/demo\">demo/</a>.</p>\n","dir":"/get-started/","name":"examples-and-demos.md","path":"get-started/examples-and-demos.md","url":"/get-started/examples-and-demos.html"},{"title":"Topology Updater Cmdline Reference","layout":"default","sort":5,"content":"<h1 id=\"nfd-topology-updater-commandline-flags\">NFD-Topology-Updater Commandline Flags</h1>\n\n<h2 class=\"no_toc\" id=\"table-of-contents\">Table of Contents</h2>\n\n<ol class=\"no_toc text-delta\" id=\"markdown-toc\">\n <li><a href=\"#nfd-topology-updater-commandline-flags\" id=\"markdown-toc-nfd-topology-updater-commandline-flags\">NFD-Topology-Updater Commandline Flags</a> <ol>\n <li><a href=\"#-h--help\" id=\"markdown-toc--h--help\">-h, -help</a></li>\n <li><a href=\"#-version\" id=\"markdown-toc--version\">-version</a></li>\n <li><a href=\"#-server\" id=\"markdown-toc--server\">-server</a></li>\n <li><a href=\"#-ca-file\" id=\"markdown-toc--ca-file\">-ca-file</a></li>\n <li><a href=\"#-cert-file\" id=\"markdown-toc--cert-file\">-cert-file</a></li>\n <li><a href=\"#-key-file\" id=\"markdown-toc--key-file\">-key-file</a></li>\n <li><a href=\"#-server-name-override\" id=\"markdown-toc--server-name-override\">-server-name-override</a></li>\n <li><a href=\"#-no-publish\" id=\"markdown-toc--no-publish\">-no-publish</a></li>\n <li><a href=\"#-oneshot\" id=\"markdown-toc--oneshot\">-oneshot</a></li>\n <li><a href=\"#-sleep-interval\" id=\"markdown-toc--sleep-interval\">-sleep-interval</a></li>\n <li><a href=\"#-watch-namespace\" id=\"markdown-toc--watch-namespace\">-watch-namespace</a></li>\n <li><a href=\"#-kubelet-config-file\" id=\"markdown-toc--kubelet-config-file\">-kubelet-config-file</a></li>\n <li><a href=\"#-podresources-socket\" id=\"markdown-toc--podresources-socket\">-podresources-socket</a></li>\n </ol>\n </li>\n</ol>\n\n<hr />\n\n<p>To quickly view available command line flags execute <code class=\"language-plaintext highlighter-rouge\">nfd-topology-updater -help</code>.\nIn a docker container:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>docker run gcr.io/k8s-staging-nfd/node-feature-discovery:master nfd-topology-updater <span class=\"nt\">-help</span>\n</code></pre> </div></div>\n\n<h3 id=\"-h--help\">-h, -help</h3>\n\n<p>Print usage and exit.</p>\n\n<h3 id=\"-version\">-version</h3>\n\n<p>Print version and exit.</p>\n\n<h3 id=\"-server\">-server</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-server</code> flag specifies the address of the nfd-master endpoint where to\nconnect to.</p>\n\n<p>Default: localhost:8080</p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-topology-updater <span class=\"nt\">-server</span><span class=\"o\">=</span>nfd-master.nfd.svc.cluster.local:443\n</code></pre> </div></div>\n\n<h3 id=\"-ca-file\">-ca-file</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-ca-file</code> is one of the three flags (together with <code class=\"language-plaintext highlighter-rouge\">-cert-file</code> and\n<code class=\"language-plaintext highlighter-rouge\">-key-file</code>) controlling the mutual TLS authentication on the topology-updater side.\nThis flag specifies the TLS root certificate that is used for verifying the\nauthenticity of nfd-master.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Note: Must be specified together with <code class=\"language-plaintext highlighter-rouge\">-cert-file</code> and <code class=\"language-plaintext highlighter-rouge\">-key-file</code></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-topology-updater <span class=\"nt\">-ca-file</span><span class=\"o\">=</span>/opt/nfd/ca.crt <span class=\"nt\">-cert-file</span><span class=\"o\">=</span>/opt/nfd/updater.crt <span class=\"nt\">-key-file</span><span class=\"o\">=</span>/opt/nfd/updater.key\n</code></pre> </div></div>\n\n<h3 id=\"-cert-file\">-cert-file</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-cert-file</code> is one of the three flags (together with <code class=\"language-plaintext highlighter-rouge\">-ca-file</code> and\n<code class=\"language-plaintext highlighter-rouge\">-key-file</code>) controlling mutual TLS authentication on the topology-updater\nside. This flag specifies the TLS certificate presented for authenticating\noutgoing requests.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Note: Must be specified together with <code class=\"language-plaintext highlighter-rouge\">-ca-file</code> and <code class=\"language-plaintext highlighter-rouge\">-key-file</code></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-topology-updater <span class=\"nt\">-cert-file</span><span class=\"o\">=</span>/opt/nfd/updater.crt <span class=\"nt\">-key-file</span><span class=\"o\">=</span>/opt/nfd/updater.key <span class=\"nt\">-ca-file</span><span class=\"o\">=</span>/opt/nfd/ca.crt\n</code></pre> </div></div>\n\n<h3 id=\"-key-file\">-key-file</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-key-file</code> is one of the three flags (together with <code class=\"language-plaintext highlighter-rouge\">-ca-file</code> and\n<code class=\"language-plaintext highlighter-rouge\">-cert-file</code>) controlling the mutual TLS authentication on topology-updater\nside. This flag specifies the private key corresponding the given certificate file\n(<code class=\"language-plaintext highlighter-rouge\">-cert-file</code>) that is used for authenticating outgoing requests.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Note: Must be specified together with <code class=\"language-plaintext highlighter-rouge\">-cert-file</code> and <code class=\"language-plaintext highlighter-rouge\">-ca-file</code></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-topology-updater <span class=\"nt\">-key-file</span><span class=\"o\">=</span>/opt/nfd/updater.key <span class=\"nt\">-cert-file</span><span class=\"o\">=</span>/opt/nfd/updater.crt <span class=\"nt\">-ca-file</span><span class=\"o\">=</span>/opt/nfd/ca.crt\n</code></pre> </div></div>\n\n<h3 id=\"-server-name-override\">-server-name-override</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-server-name-override</code> flag specifies the common name (CN) which to\nexpect from the nfd-master TLS certificate. This flag is mostly intended for\ndevelopment and debugging purposes.</p>\n\n<p>Default: <em>empty</em></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-topology-updater <span class=\"nt\">-server-name-override</span><span class=\"o\">=</span>localhost\n</code></pre> </div></div>\n\n<h3 id=\"-no-publish\">-no-publish</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-no-publish</code> flag disables all communication with the nfd-master, making\nit a “dry-run” flag for nfd-topology-updater. NFD-Topology-Updater runs\nresource hardware topology detection normally, but no CR requests are sent to\nnfd-master.</p>\n\n<p>Default: <em>false</em></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-topology-updater <span class=\"nt\">-no-publish</span>\n</code></pre> </div></div>\n\n<h3 id=\"-oneshot\">-oneshot</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-oneshot</code> flag causes nfd-topology-updater to exit after one pass of\nresource hardware topology detection.</p>\n\n<p>Default: <em>false</em></p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-topology-updater <span class=\"nt\">-oneshot</span> <span class=\"nt\">-no-publish</span>\n</code></pre> </div></div>\n\n<h3 id=\"-sleep-interval\">-sleep-interval</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-sleep-interval</code> specifies the interval between resource hardware\ntopology re-examination (and CR updates). A non-positive value implies\ninfinite sleep interval, i.e. no re-detection is done.</p>\n\n<p>Default: 60s</p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-topology-updater <span class=\"nt\">-sleep-interval</span><span class=\"o\">=</span>1h\n</code></pre> </div></div>\n\n<h3 id=\"-watch-namespace\">-watch-namespace</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-watch-namespace</code> specifies the namespace to ensure that resource\nhardware topology examination only happens for the pods running in the\nspecified namespace. Pods that are not running in the specified namespace\nare not considered during resource accounting. This is particularly useful\nfor testing/debugging purpose. A “*” value would mean that all the pods would\nbe considered during the accounting process.</p>\n\n<p>Default: “*”</p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-topology-updater <span class=\"nt\">-watch-namespace</span><span class=\"o\">=</span>rte\n</code></pre> </div></div>\n\n<h3 id=\"-kubelet-config-file\">-kubelet-config-file</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-kubelet-config-file</code> specifies the path to the Kubelets configuration\nfile.</p>\n\n<p>Default: /host-var/lib/kubelet/config.yaml</p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-topology-updater <span class=\"nt\">-kubelet-config-file</span><span class=\"o\">=</span>/var/lib/kubelet/config.yaml\n</code></pre> </div></div>\n\n<h3 id=\"-podresources-socket\">-podresources-socket</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">-podresources-socket</code> specifies the path to the Unix socket where kubelet\nexports a gRPC service to enable discovery of in-use CPUs and devices, and to\nprovide metadata for them.</p>\n\n<p>Default: /host-var/lib/kubelet/pod-resources/kubelet.sock</p>\n\n<p>Example:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>nfd-topology-updater <span class=\"nt\">-podresources-socket</span><span class=\"o\">=</span>/var/lib/kubelet/pod-resources/kubelet.sock\n</code></pre> </div></div>\n","dir":"/advanced/","name":"topology-updater-commandline-reference.md","path":"advanced/topology-updater-commandline-reference.md","url":"/advanced/topology-updater-commandline-reference.html"},{"title":"Customization guide","layout":"default","sort":5,"content":"<h1 class=\"no_toc\" id=\"customization-guide\">Customization guide</h1>\n\n<h2 class=\"no_toc text-delta\" id=\"table-of-contents\">Table of contents</h2>\n\n<ol id=\"markdown-toc\">\n <li><a href=\"#overview\" id=\"markdown-toc-overview\">Overview</a></li>\n <li><a href=\"#nodefeaturerule-custom-resource\" id=\"markdown-toc-nodefeaturerule-custom-resource\">NodeFeatureRule custom resource</a> <ol>\n <li><a href=\"#a-nodefeaturerule-example\" id=\"markdown-toc-a-nodefeaturerule-example\">A NodeFeatureRule example</a></li>\n <li><a href=\"#nodefeaturerule-controller\" id=\"markdown-toc-nodefeaturerule-controller\">NodeFeatureRule controller</a></li>\n </ol>\n </li>\n <li><a href=\"#local-feature-source\" id=\"markdown-toc-local-feature-source\">Local feature source</a> <ol>\n <li><a href=\"#a-hook-example\" id=\"markdown-toc-a-hook-example\">A hook example</a></li>\n <li><a href=\"#hooks\" id=\"markdown-toc-hooks\">Hooks</a></li>\n <li><a href=\"#feature-files\" id=\"markdown-toc-feature-files\">Feature files</a></li>\n <li><a href=\"#input-format\" id=\"markdown-toc-input-format\">Input format</a></li>\n <li><a href=\"#mounts\" id=\"markdown-toc-mounts\">Mounts</a></li>\n </ol>\n </li>\n <li><a href=\"#custom-feature-source\" id=\"markdown-toc-custom-feature-source\">Custom feature source</a> <ol>\n <li><a href=\"#an-example-custom-feature-source-configuration\" id=\"markdown-toc-an-example-custom-feature-source-configuration\">An example custom feature source configuration</a></li>\n <li><a href=\"#additional-configuration-directory\" id=\"markdown-toc-additional-configuration-directory\">Additional configuration directory</a></li>\n </ol>\n </li>\n <li><a href=\"#node-labels\" id=\"markdown-toc-node-labels\">Node labels</a></li>\n <li><a href=\"#label-rule-format\" id=\"markdown-toc-label-rule-format\">Label rule format</a> <ol>\n <li><a href=\"#fields\" id=\"markdown-toc-fields\">Fields</a></li>\n <li><a href=\"#available-features\" id=\"markdown-toc-available-features\">Available features</a></li>\n <li><a href=\"#templating\" id=\"markdown-toc-templating\">Templating</a></li>\n <li><a href=\"#backreferences\" id=\"markdown-toc-backreferences\">Backreferences</a></li>\n <li><a href=\"#examples\" id=\"markdown-toc-examples\">Examples</a></li>\n </ol>\n </li>\n <li><a href=\"#legacy-custom-rule-syntax\" id=\"markdown-toc-legacy-custom-rule-syntax\">Legacy custom rule syntax</a> <ol>\n <li><a href=\"#general-nomenclature-and-definitions\" id=\"markdown-toc-general-nomenclature-and-definitions\">General nomenclature and definitions</a></li>\n <li><a href=\"#custom-features-format-using-the-nomenclature-defined-above\" id=\"markdown-toc-custom-features-format-using-the-nomenclature-defined-above\">Custom features format (using the nomenclature defined above)</a></li>\n <li><a href=\"#matching-process\" id=\"markdown-toc-matching-process\">Matching process</a></li>\n <li><a href=\"#rules\" id=\"markdown-toc-rules\">Rules</a></li>\n <li><a href=\"#legacy-custom-rule-example\" id=\"markdown-toc-legacy-custom-rule-example\">Legacy custom rule example</a></li>\n </ol>\n </li>\n</ol>\n\n<hr />\n\n<h2 id=\"overview\">Overview</h2>\n\n<p>NFD provides multiple extension points for vendor and application specific\nlabeling:</p>\n\n<ul>\n <li><a href=\"#nodefeaturerule-custom-resource\"><code class=\"language-plaintext highlighter-rouge\">NodeFeatureRule</code></a> objects provide a way to\ndeploy custom labeling rules via the Kubernetes API</li>\n <li><a href=\"#local-feature-source\"><code class=\"language-plaintext highlighter-rouge\">local</code></a> feature source of nfd-worker creates\nlabels by executing hooks and reading files</li>\n <li><a href=\"#custom-feature-source\"><code class=\"language-plaintext highlighter-rouge\">custom</code></a> feature source of nfd-worker creates\nlabels based on user-specified rules</li>\n</ul>\n\n<h2 id=\"nodefeaturerule-custom-resource\">NodeFeatureRule custom resource</h2>\n\n<p><code class=\"language-plaintext highlighter-rouge\">NodeFeatureRule</code> objects provide an easy way to create vendor or application\nspecific labels. It uses a flexible rule-based mechanism for creating labels\nbased on node feature.</p>\n\n<h3 id=\"a-nodefeaturerule-example\">A NodeFeatureRule example</h3>\n\n<p>Consider the following referential example:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">apiVersion</span><span class=\"pi\">:</span> <span class=\"s\">nfd.k8s-sigs.io/v1alpha1</span>\n<span class=\"na\">kind</span><span class=\"pi\">:</span> <span class=\"s\">NodeFeatureRule</span>\n<span class=\"na\">metadata</span><span class=\"pi\">:</span>\n <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s\">my-sample-rule-object</span>\n<span class=\"na\">spec</span><span class=\"pi\">:</span>\n <span class=\"na\">rules</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">my</span><span class=\"nv\"> </span><span class=\"s\">sample</span><span class=\"nv\"> </span><span class=\"s\">rule\"</span>\n <span class=\"na\">labels</span><span class=\"pi\">:</span>\n <span class=\"s2\">\"</span><span class=\"s\">my-sample-feature\"</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">true\"</span>\n <span class=\"na\">matchFeatures</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">kernel.loadedmodule</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">dummy</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">Exists</span><span class=\"pi\">}</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">kernel.config</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">X86</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">In</span><span class=\"pi\">,</span> <span class=\"nv\">value</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">y\"</span><span class=\"pi\">]}</span>\n</code></pre> </div></div>\n\n<p>It specifies one rule which creates node label\n<code class=\"language-plaintext highlighter-rouge\">feature.node.kubenernetes.io/my-sample-feature=true</code> if both of the following\nconditions are true (<code class=\"language-plaintext highlighter-rouge\">matchFeatures</code> implements a logical AND over the\nmatchers):</p>\n\n<ul>\n <li>The <code class=\"language-plaintext highlighter-rouge\">dummy</code> network driver module has been loaded</li>\n <li>X86 option in kernel config is set to <code class=\"language-plaintext highlighter-rouge\">=y</code></li>\n</ul>\n\n<p>Create a <code class=\"language-plaintext highlighter-rouge\">NodeFeatureRule</code> with a yaml file:</p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>kubectl apply <span class=\"nt\">-f</span> https://raw.githubusercontent.com/kubernetes-sigs/node-feature-discovery/v0.11.3/examples/nodefeaturerule.yaml\n</code></pre> </div></div>\n\n<p>Now, on X86 platforms the feature label appears after doing <code class=\"language-plaintext highlighter-rouge\">modprobe dummy</code> on\na system and correspondingly the label is removed after <code class=\"language-plaintext highlighter-rouge\">rmmod dummy</code>. Note a\nre-labeling delay up to the sleep-interval of nfd-worker (1 minute by default).</p>\n\n<h3 id=\"nodefeaturerule-controller\">NodeFeatureRule controller</h3>\n\n<p>NFD-Master acts as the controller for <code class=\"language-plaintext highlighter-rouge\">NodeFeatureRule</code> objects. It applies these\nrules on raw feature data received from nfd-worker instances and creates node\nlabels, accordingly.</p>\n\n<p><strong>NOTE</strong> nfd-master is stateless and (re-)labelling only happens when a request\nis received from nfd-worker. That is, in practice rules are evaluated and\nlabels for each node are created on intervals specified by the\n<a href=\"worker-configuration-reference#coresleepinterval\"><code class=\"language-plaintext highlighter-rouge\">core.sleepInterval</code></a>\nconfiguration option (or\n<a href=\"worker-commandline-reference#-sleep-interval\"><code class=\"language-plaintext highlighter-rouge\">-sleep-interval</code></a> command line\nflag) of nfd-worker instances. This means that modification or creation of\n<code class=\"language-plaintext highlighter-rouge\">NodeFeatureRule</code> objects does not instantly cause the node labels to be updated.\nInstead, the changes only come visible in node labels as nfd-worker instances\nsend their labelling requests.</p>\n\n<h2 id=\"local-feature-source\">Local feature source</h2>\n\n<p>NFD-Worker has a special feature source named <code class=\"language-plaintext highlighter-rouge\">local</code> which is an integration\npoint for external feature detectors. It provides a mechanism for pluggable\nextensions, allowing the creation of new user-specific features and even\noverriding built-in labels.</p>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">local</code> feature source has two methods for detecting features, hooks and\nfeature files. The features discovered by the <code class=\"language-plaintext highlighter-rouge\">local</code> source can further be\nused in label rules specified in\n<a href=\"#nodefeaturerule-custom-resource\"><code class=\"language-plaintext highlighter-rouge\">NodeFeatureRule</code></a> objects and the\n<a href=\"#custom-feature-source\"><code class=\"language-plaintext highlighter-rouge\">custom</code></a> feature source.</p>\n\n<p><strong>NOTE:</strong> Be careful when creating and/or updating hook or feature files while\nNFD is running. In order to avoid race conditions you should write into a\ntemporary file (outside the <code class=\"language-plaintext highlighter-rouge\">source.d</code> and <code class=\"language-plaintext highlighter-rouge\">features.d</code> directories), and,\natomically create/update the original file by doing a filesystem move\noperation.</p>\n\n<h3 id=\"a-hook-example\">A hook example</h3>\n\n<p>Consider a shell script\n<code class=\"language-plaintext highlighter-rouge\">/etc/kubernetes/node-feature-discovery/source.d/my-hook.sh</code> having the\nfollowing stdout output, or alternatively, a plaintext file\n<code class=\"language-plaintext highlighter-rouge\">/etc/kubernetes/node-feature-discovery/features.d/my-features</code> having the\nfollowing contents:</p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>my-feature.1\nmy-feature.2=myvalue\nmy.namespace/my-feature.3=456\n</code></pre> </div></div>\n\n<p>This will translate into the following node labels:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"s\">feature.node.kubernetes.io/my-feature.1</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">true\"</span>\n<span class=\"s\">feature.node.kubernetes.io/my-feature.2</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">myvalue\"</span>\n<span class=\"s\">my.namespace/my-feature.3</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">456\"</span>\n</code></pre> </div></div>\n\n<p>Note that in the example above <code class=\"language-plaintext highlighter-rouge\">-extra-label-ns=my.namespace</code> must be specified\non the nfd-master command line.</p>\n\n<h3 id=\"hooks\">Hooks</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">local</code> source executes hooks found in\n<code class=\"language-plaintext highlighter-rouge\">/etc/kubernetes/node-feature-discovery/source.d/</code>. The hook files must be\nexecutable and they are supposed to print all discovered features in <code class=\"language-plaintext highlighter-rouge\">stdout</code>.\nWith ELF binaries static linking is recommended as the selection of system\nlibraries available in the NFD release image is very limited. Other runtimes\ncurrently supported by the NFD image are bash and perl.</p>\n\n<p><code class=\"language-plaintext highlighter-rouge\">stderr</code> output of hooks is propagated to NFD log so it can be used for\ndebugging and logging.</p>\n\n<p>NFD tries to execute any regular files found from the hooks directory.\nAny additional data files the hook might need (e.g. a configuration file)\nshould be placed in a separate directory in order to avoid NFD unnecessarily\ntrying to execute them. A subdirectory under the hooks directory can be used,\nfor example <code class=\"language-plaintext highlighter-rouge\">/etc/kubernetes/node-feature-discovery/source.d/conf/</code>.</p>\n\n<p><strong>NOTE:</strong> NFD will blindly run any executables placed/mounted in the hooks\ndirectory. It is the users responsibility to review the hooks for e.g.\npossible security implications.</p>\n\n<p><strong>NOTE:</strong> The <a href=\"../get-started/deployment-and-usage#minimal\">minimal</a> image\nvariant only supports running statically linked binaries.</p>\n\n<h3 id=\"feature-files\">Feature files</h3>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">local</code> source reads files found in\n<code class=\"language-plaintext highlighter-rouge\">/etc/kubernetes/node-feature-discovery/features.d/</code>.</p>\n\n<h3 id=\"input-format\">Input format</h3>\n\n<p>The hook stdout and feature files are expected to contain features in simple\nkey-value pairs, separated by newlines:</p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>&lt;name&gt;[=&lt;value&gt;]\n</code></pre> </div></div>\n\n<p>The label value defaults to <code class=\"language-plaintext highlighter-rouge\">true</code>, if not specified.</p>\n\n<p>Label namespace may be specified with <code class=\"language-plaintext highlighter-rouge\">&lt;namespace&gt;/&lt;name&gt;[=&lt;value&gt;]</code>. The\nnamespace must be explicitly allowed with the <code class=\"language-plaintext highlighter-rouge\">-extra-label-ns</code> command line\nflag of nfd-master if using something else than\n<code class=\"language-plaintext highlighter-rouge\">[&lt;sub-ns&gt;.]feature.node.kubernetes.io</code> or\n<code class=\"language-plaintext highlighter-rouge\">[&lt;sub-ns&gt;.]profile.node.kubernetes.io</code>.</p>\n\n<h3 id=\"mounts\">Mounts</h3>\n\n<p>The standard NFD deployments contain <code class=\"language-plaintext highlighter-rouge\">hostPath</code> mounts for\n<code class=\"language-plaintext highlighter-rouge\">/etc/kubernetes/node-feature-discovery/source.d/</code> and\n<code class=\"language-plaintext highlighter-rouge\">/etc/kubernetes/node-feature-discovery/features.d/</code>, making these directories\nfrom the host available inside the nfd-worker container.</p>\n\n<h4 id=\"injecting-labels-from-other-pods\">Injecting labels from other pods</h4>\n\n<p>One use case for the hooks and/or feature files is detecting features in other\nPods outside NFD, e.g. in Kubernetes device plugins. By using the same\n<code class=\"language-plaintext highlighter-rouge\">hostPath</code> mounts for <code class=\"language-plaintext highlighter-rouge\">/etc/kubernetes/node-feature-discovery/source.d/</code> and\n<code class=\"language-plaintext highlighter-rouge\">/etc/kubernetes/node-feature-discovery/features.d/</code> in the side-car (e.g.\ndevice plugin) creates a shared area for deploying hooks and feature files to\nNFD. NFD will periodically scan the directories and run any hooks and read any\nfeature files it finds.</p>\n\n<h2 id=\"custom-feature-source\">Custom feature source</h2>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">custom</code> feature source in nfd-worker provides a rule-based mechanism for\nlabel creation, similar to the\n<a href=\"#nodefeaturerule-custom-resource\"><code class=\"language-plaintext highlighter-rouge\">NodeFeatureRule</code></a> objects. The difference is\nthat the rules are specified in the worker configuration instead of a\nKubernetes API object.</p>\n\n<p>See <a href=\"/node-feature-discovery/v0.11/get-started/deployment-and-usage.html#worker-configuration\">worker configuration</a>\nfor instructions how to set-up and manage the worker configuration.</p>\n\n<h3 id=\"an-example-custom-feature-source-configuration\">An example custom feature source configuration</h3>\n\n<p>Consider the following referential configuration for nfd-worker:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">core</span><span class=\"pi\">:</span>\n <span class=\"na\">labelSources</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">custom\"</span><span class=\"pi\">]</span>\n<span class=\"na\">sources</span><span class=\"pi\">:</span>\n <span class=\"na\">custom</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">my</span><span class=\"nv\"> </span><span class=\"s\">sample</span><span class=\"nv\"> </span><span class=\"s\">rule\"</span>\n <span class=\"na\">labels</span><span class=\"pi\">:</span>\n <span class=\"s2\">\"</span><span class=\"s\">my-sample-feature\"</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">true\"</span>\n <span class=\"na\">matchFeatures</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">kernel.loadedmodule</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">dummy</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">Exists</span><span class=\"pi\">}</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">kernel.config</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">X86</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">In</span><span class=\"pi\">,</span> <span class=\"nv\">value</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">y\"</span><span class=\"pi\">]}</span>\n</code></pre> </div></div>\n\n<p>It specifies one rule which creates node label\n<code class=\"language-plaintext highlighter-rouge\">feature.node.kubenernetes.io/my-sample-feature=true</code> if both of the following\nconditions are true (<code class=\"language-plaintext highlighter-rouge\">matchFeatures</code> implements a logical AND over the\nmatchers):</p>\n\n<ul>\n <li>The <code class=\"language-plaintext highlighter-rouge\">dummy</code> network driver module has been loaded</li>\n <li>X86 option in kernel config is set to <code class=\"language-plaintext highlighter-rouge\">=y</code></li>\n</ul>\n\n<p>In addition, the configuration only enables the <code class=\"language-plaintext highlighter-rouge\">custom</code> source, disabling all\nbuilt-in labels.</p>\n\n<p>Now, on X86 platforms the feature label appears after doing <code class=\"language-plaintext highlighter-rouge\">modprobe dummy</code> on\na system and correspondingly the label is removed after <code class=\"language-plaintext highlighter-rouge\">rmmod dummy</code>. Note a\nre-labeling delay up to the sleep-interval of nfd-worker (1 minute by default).</p>\n\n<h3 id=\"additional-configuration-directory\">Additional configuration directory</h3>\n\n<p>In addition to the rules defined in the nfd-worker configuration file, the\n<code class=\"language-plaintext highlighter-rouge\">custom</code> feature source can read more configuration files located in the\n<code class=\"language-plaintext highlighter-rouge\">/etc/kubernetes/node-feature-discovery/custom.d/</code> directory. This makes more\ndynamic and flexible configuration easier.</p>\n\n<p>As an example, consider having file\n<code class=\"language-plaintext highlighter-rouge\">/etc/kubernetes/node-feature-discovery/custom.d/my-rule.yaml</code> with the\nfollowing content:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">my</span><span class=\"nv\"> </span><span class=\"s\">e1000</span><span class=\"nv\"> </span><span class=\"s\">rule\"</span>\n <span class=\"na\">labels</span><span class=\"pi\">:</span>\n <span class=\"s2\">\"</span><span class=\"s\">e1000.present\"</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">true\"</span>\n <span class=\"na\">matchFeatures</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">kernel.loadedmodule</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">e1000</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">Exists</span><span class=\"pi\">}</span>\n</code></pre> </div></div>\n\n<p>This simple rule will create <code class=\"language-plaintext highlighter-rouge\">feature.node.kubenernetes.io/e1000.present=true</code>\nlabel if the <code class=\"language-plaintext highlighter-rouge\">e1000</code> kernel module has been loaded.</p>\n\n<p>The\n<a href=\"https://github.com/kubernetes-sigs/node-feature-discovery/blob/v0.11.3/deployment/overlays/samples/custom-rules\"><code class=\"language-plaintext highlighter-rouge\">samples/custom-rules</code></a>\nkustomize overlay sample contains an example for deploying a custom rule from a\nConfigMap.</p>\n\n<h2 id=\"node-labels\">Node labels</h2>\n\n<p>Feature labels have the following format:</p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>&lt;namespace&gt;/&lt;name&gt; = &lt;value&gt;\n</code></pre> </div></div>\n\n<p>The namespace part (i.e. prefix) of the labels is controlled by nfd:</p>\n\n<ul>\n <li>All built-in labels use <code class=\"language-plaintext highlighter-rouge\">feature.node.kubernetes.io</code>. This is also\nthe default for user defined features that dont specify any namespace.</li>\n <li>User-defined labels are allowed to use:\n <ul>\n <li><code class=\"language-plaintext highlighter-rouge\">feature.node.kubernetes.io</code> and <code class=\"language-plaintext highlighter-rouge\">profile.node.kubernetes.io</code> plus their\nsub-namespaces (e.g. <code class=\"language-plaintext highlighter-rouge\">vendor.profile.node.kubernetes.io</code> and\n<code class=\"language-plaintext highlighter-rouge\">sub.ns.profile.node.kubernetes.io</code>) by default</li>\n <li>Additional namespaces may be enabled with the\n<a href=\"../advanced/master-commandline-reference#-extra-label-ns\"><code class=\"language-plaintext highlighter-rouge\">-extra-label-ns</code></a>\ncommand line flag of nfd-master</li>\n </ul>\n </li>\n</ul>\n\n<h2 id=\"label-rule-format\">Label rule format</h2>\n\n<p>This section describes the rule format used in\n<a href=\"#nodefeaturerule-custom-resource\"><code class=\"language-plaintext highlighter-rouge\">NodeFeatureRule</code></a> objects and in the\nconfiguration of the <a href=\"#custom-feature-source\"><code class=\"language-plaintext highlighter-rouge\">custom</code></a> feature source.</p>\n\n<p>It is based on a generic feature matcher that covers all features discovered by\nnfd-worker. The rules rely on a unified data model of the available features\nand a generic expression-based format. Features that can be used in the rules\nare described in detail in <a href=\"#available-features\">available features</a> below.</p>\n\n<p>Take this rule as a referential example:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code> <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">my</span><span class=\"nv\"> </span><span class=\"s\">feature</span><span class=\"nv\"> </span><span class=\"s\">rule\"</span>\n <span class=\"na\">labels</span><span class=\"pi\">:</span>\n <span class=\"s2\">\"</span><span class=\"s\">my-special-feature\"</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">my-value\"</span>\n <span class=\"na\">matchFeatures</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">cpu.cpuid</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">AVX512F</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">Exists</span><span class=\"pi\">}</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">kernel.version</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">major</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">In</span><span class=\"pi\">,</span> <span class=\"nv\">value</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">5\"</span><span class=\"pi\">]}</span>\n <span class=\"na\">minor</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">Gt</span><span class=\"pi\">,</span> <span class=\"nv\">value</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">1\"</span><span class=\"pi\">]}</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">pci.device</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">vendor</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">In</span><span class=\"pi\">,</span> <span class=\"nv\">value</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">8086\"</span><span class=\"pi\">]}</span>\n <span class=\"na\">class</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">In</span><span class=\"pi\">,</span> <span class=\"nv\">value</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">0200\"</span><span class=\"pi\">]}</span>\n</code></pre> </div></div>\n\n<p>This will yield <code class=\"language-plaintext highlighter-rouge\">feature.node.kubenernetes.io/my-special-feature=my-value</code> node\nlabel if all of these are true (<code class=\"language-plaintext highlighter-rouge\">matchFeatures</code> implements a logical AND over\nthe matchers):</p>\n\n<ul>\n <li>the CPU has AVX512F capability</li>\n <li>kernel version is 5.2 or later (must be v5.x)</li>\n <li>an Intel network controller is present</li>\n</ul>\n\n<h3 id=\"fields\">Fields</h3>\n\n<h4 id=\"name\">Name</h4>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">.name</code> field is required and used as an identifier of the rule.</p>\n\n<h4 id=\"labels\">Labels</h4>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">.labels</code> is a map of the node labels to create if the rule matches.</p>\n\n<h4 id=\"labels-template\">Labels template</h4>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">.labelsTemplate</code> field specifies a text template for dynamically creating\nlabels based on the matched features. See <a href=\"#templating\">templating</a> for\ndetails.</p>\n\n<p><strong>NOTE</strong> The <code class=\"language-plaintext highlighter-rouge\">labels</code> field has priority over <code class=\"language-plaintext highlighter-rouge\">labelsTemplate</code>, i.e.\nlabels specified in the <code class=\"language-plaintext highlighter-rouge\">labels</code> field will override anything\noriginating from <code class=\"language-plaintext highlighter-rouge\">labelsTemplate</code>.</p>\n\n<h4 id=\"vars\">Vars</h4>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">.vars</code> field is a map of values (key-value pairs) to store for subsequent\nrules to use. In other words, these are variables that are not advertised as\nnode labels. See <a href=\"#backreferences\">backreferences</a> for more details on the\nusage of vars.</p>\n\n<h4 id=\"vars-template\">Vars template</h4>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">.varsTemplate</code> field specifies a text template for dynamically creating\nvars based on the matched features. See <a href=\"#templating\">templating</a> for details\non using templates and <a href=\"#backreferences\">backreferences</a> for more details on\nthe usage of vars.</p>\n\n<p><strong>NOTE</strong> The <code class=\"language-plaintext highlighter-rouge\">vars</code> field has priority over <code class=\"language-plaintext highlighter-rouge\">varsTemplate</code>, i.e.\nvars specified in the <code class=\"language-plaintext highlighter-rouge\">vars</code> field will override anything originating from\n<code class=\"language-plaintext highlighter-rouge\">varsTemplate</code>.</p>\n\n<h4 id=\"matchfeatures\">MatchFeatures</h4>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">.matchFeatures</code> field specifies a feature matcher, consisting of a list of\nfeature matcher terms. It implements a logical AND over the terms i.e. all\nof them must match in order for the rule to trigger.</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code> <span class=\"na\">matchFeatures</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">&lt;feature-name&gt;</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"s\">&lt;key&gt;</span><span class=\"pi\">:</span>\n <span class=\"na\">op</span><span class=\"pi\">:</span> <span class=\"s\">&lt;op&gt;</span>\n <span class=\"na\">value</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"s\">&lt;value-1&gt;</span>\n <span class=\"pi\">-</span> <span class=\"s\">...</span>\n</code></pre> </div></div>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">.matchFeatures[].feature</code> field specifies the feature against which to\nmatch.</p>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">.matchFeatures[].matchExpressions</code> field specifies a map of expressions\nwhich to evaluate against the elements of the feature.</p>\n\n<p>In each MatchExpression <code class=\"language-plaintext highlighter-rouge\">op</code> specifies the operator to apply. Valid values are\ndescribed below.</p>\n\n<table>\n <thead>\n <tr>\n <th>Operator</th>\n <th>Number of values</th>\n <th>Matches when</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">In</code></td>\n <td>1 or greater</td>\n <td>Input is equal to one of the values</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">NotIn</code></td>\n <td>1 or greater</td>\n <td>Input is not equal to any of the values</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">InRegexp</code></td>\n <td>1 or greater</td>\n <td>Values of the MatchExpression are treated as regexps and input matches one or more of them</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">Exists</code></td>\n <td>0</td>\n <td>The key exists</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">DoesNotExist</code></td>\n <td>0</td>\n <td>The key does not exists</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">Gt</code></td>\n <td>1</td>\n <td>Input is greater than the value. Both the input and value must be integer numbers.</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">Lt</code></td>\n <td>1</td>\n <td>Input is less than the value. Both the input and value must be integer numbers.</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">GtLt</code></td>\n <td>2</td>\n <td>Input is between two values. Both the input and value must be integer numbers.</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">IsTrue</code></td>\n <td>0</td>\n <td>Input is equal to “true”</td>\n </tr>\n <tr>\n <td><code class=\"language-plaintext highlighter-rouge\">IsFalse</code></td>\n <td>0</td>\n <td>Input is equal “false”</td>\n </tr>\n </tbody>\n</table>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">value</code> field of MatchExpression is a list of string arguments to the\noperator.</p>\n\n<p>The behavior of MatchExpression depends on the <a href=\"#feature-types\">feature type</a>:\nfor <em>flag</em> and <em>attribute</em> features the MatchExpression operates on the feature\nelement whose name matches the <code class=\"language-plaintext highlighter-rouge\">&lt;key&gt;</code>. However, for <em>instance</em> features all\nMatchExpressions are evaluated against the attributes of each instance\nseparately.</p>\n\n<h4 id=\"matchany\">MatchAny</h4>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">.matchAny</code> field is a list of of <a href=\"#matchfeatures\"><code class=\"language-plaintext highlighter-rouge\">matchFeatures</code></a>\nmatchers. A logical OR is applied over the matchers, i.e. at least one of them\nmust match in order for the rule to trigger.</p>\n\n<p>Consider the following example:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code> <span class=\"na\">matchAny</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">matchFeatures</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">kernel.loadedmodule</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">kmod-1</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">Exists</span><span class=\"pi\">}</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">pci.device</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">vendor</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">In</span><span class=\"pi\">,</span> <span class=\"nv\">value</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">0eee\"</span><span class=\"pi\">]}</span>\n <span class=\"na\">class</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">In</span><span class=\"pi\">,</span> <span class=\"nv\">value</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">0200\"</span><span class=\"pi\">]}</span>\n <span class=\"pi\">-</span> <span class=\"na\">matchFeatures</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">kernel.loadedmodule</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">kmod-2</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">Exists</span><span class=\"pi\">}</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">pci.device</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">vendor</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">In</span><span class=\"pi\">,</span> <span class=\"nv\">value</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">0fff\"</span><span class=\"pi\">]}</span>\n <span class=\"na\">class</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">In</span><span class=\"pi\">,</span> <span class=\"nv\">value</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">0200\"</span><span class=\"pi\">]}</span>\n</code></pre> </div></div>\n\n<p>This matches if kernel module kmod-1 is loaded and a network controller from\nvendor 0eee is present, OR, if kernel module kmod-2 has been loaded and a\nnetwork controller from vendor 0fff is present (OR both of these conditions are\ntrue).</p>\n\n<h3 id=\"available-features\">Available features</h3>\n\n<h4 id=\"feature-types\">Feature types</h4>\n\n<p>Features are divided into three different types:</p>\n\n<ul>\n <li><strong>flag</strong> features: a set of names without any associated values, e.g. CPUID\nflags or loaded kernel modules</li>\n <li><strong>attribute</strong> features: a set of names each of which has a single value\nassociated with it (essentially a map of key-value pairs), e.g. kernel config\nflags or os release information</li>\n <li><strong>instance</strong> features: a list of instances, each of which has multiple\nattributes (key-value pairs of their own) associated with it, e.g. PCI or USB\ndevices</li>\n</ul>\n\n<h4 id=\"list-of-features\">List of features</h4>\n\n<p>The following features are available for matching:</p>\n\n<table>\n <thead>\n <tr>\n <th>Feature</th>\n <th>Feature type</th>\n <th>Elements</th>\n <th>Value type</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu.cpuid</code></strong></td>\n <td>flag</td>\n <td> </td>\n <td> </td>\n <td>Supported CPU capabilities</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">&lt;cpuid-flag&gt;</code></strong></td>\n <td> </td>\n <td>CPUID flag is present</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu.cstate</code></strong></td>\n <td>attribute</td>\n <td> </td>\n <td> </td>\n <td>Status of cstates in the intel_idle cpuidle driver</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">enabled</code></strong></td>\n <td>bool</td>\n <td>true if cstates are set, otherwise false. Does not exist of intel_idle driver is not active.</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu.model</code></strong></td>\n <td>attribute</td>\n <td> </td>\n <td> </td>\n <td>CPU model related attributes</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">family</code></strong></td>\n <td>int</td>\n <td>CPU family</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">vendor_id</code></strong></td>\n <td>string</td>\n <td>CPU vendor ID</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">id</code></strong></td>\n <td>int</td>\n <td>CPU model ID</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu.pstate</code></strong></td>\n <td>attribute</td>\n <td> </td>\n <td> </td>\n <td>State of the Intel pstate driver. Does not exist if the driver is not enabled.</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">status</code></strong></td>\n <td>string</td>\n <td>Status of the driver, possible values are active and passive</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">turbo</code></strong></td>\n <td>bool</td>\n <td>true if turbo frequencies are enabled, otherwise false</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">scaling</code></strong></td>\n <td>string</td>\n <td>Active scaling_governor, possible values are powersave or performance.</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu.rdt</code></strong></td>\n <td>flag</td>\n <td> </td>\n <td> </td>\n <td>Intel RDT capabilities supported by the system</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">&lt;rdt-flag&gt;</code></strong></td>\n <td> </td>\n <td>RDT capability is supported, see <a href=\"../get-started/features#intel-rdt-flags\">RDT flags</a> for details</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu.sgx</code></strong></td>\n <td>attribute</td>\n <td> </td>\n <td> </td>\n <td>Intel SGX (Software Guard Extensions) capabilities</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">enabled</code></strong></td>\n <td>bool</td>\n <td><code class=\"language-plaintext highlighter-rouge\">true</code> if Intel SGX has been enabled, otherwise does not exist</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu.sst</code></strong></td>\n <td>attribute</td>\n <td> </td>\n <td> </td>\n <td>Intel SST (Speed Select Technology) capabilities</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">bf.enabled</code></strong></td>\n <td>bool</td>\n <td><code class=\"language-plaintext highlighter-rouge\">true</code> if Intel SST-BF (Intel Speed Select Technology - Base frequency) has been enabled, otherwise does not exist</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu.se</code></strong></td>\n <td>attribute</td>\n <td> </td>\n <td> </td>\n <td>IBM Secure Execution for Linux (IBM Z &amp; LinuxONE)</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">enabled</code></strong></td>\n <td>bool</td>\n <td><code class=\"language-plaintext highlighter-rouge\">true</code> if IBM Secure Execution for Linux is available and has been enabled, otherwise does not exist</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">cpu.topology</code></strong></td>\n <td>attribute</td>\n <td> </td>\n <td> </td>\n <td>CPU topology related features</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">hardware_multithreading</code></strong></td>\n <td>bool</td>\n <td>Hardware multithreading, such as Intel HTT, is enabled</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">kernel.config</code></strong></td>\n <td>attribute</td>\n <td> </td>\n <td> </td>\n <td>Kernel configuration options</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">&lt;config-flag&gt;</code></strong></td>\n <td>string</td>\n <td>Value of the kconfig option</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">kernel.loadedmodule</code></strong></td>\n <td>flag</td>\n <td> </td>\n <td> </td>\n <td>Loaded kernel modules</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">mod-name</code></strong></td>\n <td> </td>\n <td>Kernel module <code class=\"language-plaintext highlighter-rouge\">&lt;mod-name&gt;</code> is loaded</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">kernel.selinux</code></strong></td>\n <td>attribute</td>\n <td> </td>\n <td> </td>\n <td>Kernel SELinux related features</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">enabled</code></strong></td>\n <td>bool</td>\n <td><code class=\"language-plaintext highlighter-rouge\">true</code> if SELinux has been enabled and is in enforcing mode, otherwise <code class=\"language-plaintext highlighter-rouge\">false</code></td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">kernel.version</code></strong></td>\n <td>attribute</td>\n <td> </td>\n <td> </td>\n <td>Kernel version information</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">full</code></strong></td>\n <td>string</td>\n <td>Full kernel version (e.g. 4.5.6-7-g123abcde)</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">major</code></strong></td>\n <td>int</td>\n <td>First component of the kernel version (e.g. 4)</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">minor</code></strong></td>\n <td>int</td>\n <td>Second component of the kernel version (e.g. 5)</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">revision</code></strong></td>\n <td>int</td>\n <td>Third component of the kernel version (e.g. 6)</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">local.label</code></strong></td>\n <td>attribute</td>\n <td> </td>\n <td> </td>\n <td>Features from hooks and feature files, i.e. labels from the <a href=\"#local-feature-source\"><em>local</em> feature source</a></td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">&lt;label-name&gt;</code></strong></td>\n <td>string</td>\n <td>Label <code class=\"language-plaintext highlighter-rouge\">&lt;label-name&gt;</code> created by the local feature source, value equals the value of the label</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">memory.nv</code></strong></td>\n <td>instance</td>\n <td> </td>\n <td> </td>\n <td>NVDIMM devices present in the system</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">&lt;sysfs-attribute&gt;</code></strong></td>\n <td>string</td>\n <td>Value of the sysfs device attribute, available attributes: <code class=\"language-plaintext highlighter-rouge\">devtype</code>, <code class=\"language-plaintext highlighter-rouge\">mode</code></td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">memory.numa</code></strong></td>\n <td>attribute</td>\n <td> </td>\n <td> </td>\n <td>NUMA nodes</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">is_numa</code></strong></td>\n <td>bool</td>\n <td><code class=\"language-plaintext highlighter-rouge\">true</code> if NUMA architecture, <code class=\"language-plaintext highlighter-rouge\">false</code> otherwise</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">node_count</code></strong></td>\n <td>int</td>\n <td>Number of NUMA nodes</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">network.device</code></strong></td>\n <td>instance</td>\n <td> </td>\n <td> </td>\n <td>Physical (non-virtual) network interfaces present in the system</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">name</code></strong></td>\n <td>string</td>\n <td>Name of the network interface</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">&lt;sysfs-attribute&gt;</code></strong></td>\n <td>string</td>\n <td>Sysfs network interface attribute, available attributes: <code class=\"language-plaintext highlighter-rouge\">operstate</code>, <code class=\"language-plaintext highlighter-rouge\">speed</code>, <code class=\"language-plaintext highlighter-rouge\">sriov_numvfs</code>, <code class=\"language-plaintext highlighter-rouge\">sriov_totalvfs</code></td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">pci.device</code></strong></td>\n <td>instance</td>\n <td> </td>\n <td> </td>\n <td>PCI devices present in the system</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">&lt;sysfs-attribute&gt;</code></strong></td>\n <td>string</td>\n <td>Value of the sysfs device attribute, available attributes: <code class=\"language-plaintext highlighter-rouge\">class</code>, <code class=\"language-plaintext highlighter-rouge\">vendor</code>, <code class=\"language-plaintext highlighter-rouge\">device</code>, <code class=\"language-plaintext highlighter-rouge\">subsystem_vendor</code>, <code class=\"language-plaintext highlighter-rouge\">subsystem_device</code>, <code class=\"language-plaintext highlighter-rouge\">sriov_totalvfs</code>, <code class=\"language-plaintext highlighter-rouge\">iommu_group/type</code>, <code class=\"language-plaintext highlighter-rouge\">iommu/intel-iommu/version</code></td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">storage.device</code></strong></td>\n <td>instance</td>\n <td> </td>\n <td> </td>\n <td>Block storage devices present in the system</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">name</code></strong></td>\n <td>string</td>\n <td>Name of the block device</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">&lt;sysfs-attribute&gt;</code></strong></td>\n <td>string</td>\n <td>Sysfs network interface attribute, available attributes: <code class=\"language-plaintext highlighter-rouge\">dax</code>, <code class=\"language-plaintext highlighter-rouge\">rotational</code>, <code class=\"language-plaintext highlighter-rouge\">nr_zones</code>, <code class=\"language-plaintext highlighter-rouge\">zoned</code></td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">system.osrelease</code></strong></td>\n <td>attribute</td>\n <td> </td>\n <td> </td>\n <td>System identification data from <code class=\"language-plaintext highlighter-rouge\">/etc/os-release</code></td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">&lt;parameter&gt;</code></strong></td>\n <td>string</td>\n <td>One parameter from <code class=\"language-plaintext highlighter-rouge\">/etc/os-release</code></td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">system.name</code></strong></td>\n <td>attribute</td>\n <td> </td>\n <td> </td>\n <td>System name information</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">nodename</code></strong></td>\n <td>string</td>\n <td>Name of the kubernetes node object</td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">usb.device</code></strong></td>\n <td>instance</td>\n <td> </td>\n <td> </td>\n <td>USB devices present in the system</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">&lt;sysfs-attribute&gt;</code></strong></td>\n <td>string</td>\n <td>Value of the sysfs device attribute, available attributes: <code class=\"language-plaintext highlighter-rouge\">class</code>, <code class=\"language-plaintext highlighter-rouge\">vendor</code>, <code class=\"language-plaintext highlighter-rouge\">device</code>, <code class=\"language-plaintext highlighter-rouge\">serial</code></td>\n </tr>\n <tr>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">rule.matched</code></strong></td>\n <td>attribute</td>\n <td> </td>\n <td> </td>\n <td>Previously matched rules</td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n <td><strong><code class=\"language-plaintext highlighter-rouge\">&lt;label-or-var&gt;</code></strong></td>\n <td>string</td>\n <td>Label or var from a preceding rule that matched</td>\n </tr>\n </tbody>\n</table>\n\n<h3 id=\"templating\">Templating</h3>\n\n<p>Rules support template-based creation of labels and vars with the\n<code class=\"language-plaintext highlighter-rouge\">.labelsTemplate</code> and <code class=\"language-plaintext highlighter-rouge\">.varsTemplate</code> fields. These makes it possible to\ndynamically generate labels and vars based on the features that matched.</p>\n\n<p>The template must expand into a simple format with <code class=\"language-plaintext highlighter-rouge\">&lt;key&gt;=&lt;value&gt;</code> pairs\nseparated by newline.</p>\n\n<p>Consider the following example:\n<!-- --></p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code> <span class=\"na\">labelsTemplate</span><span class=\"pi\">:</span> <span class=\"pi\">|</span>\n <span class=\"s\">{{ range .pci.device }}vendor-{{ .class }}-{{ .device }}.present=true</span>\n <span class=\"s\">{{ end }}</span>\n <span class=\"na\">matchFeatures</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">pci.device</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">class</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">InRegexp</span><span class=\"pi\">,</span> <span class=\"nv\">value</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">^02\"</span><span class=\"pi\">]}</span>\n <span class=\"na\">vendor</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">0fff\"</span><span class=\"pi\">]</span>\n</code></pre> </div></div>\n\n<!-- -->\n<p>The rule above will create individual labels\n<code class=\"language-plaintext highlighter-rouge\">feature.node.kubernetes.io/vendor-&lt;class-id&gt;-&lt;device-id&gt;.present=true</code> for\neach network controller device (device class starting with 02) from vendor\n0ffff.</p>\n\n<p>All the matched features of each feature matcher term under <code class=\"language-plaintext highlighter-rouge\">matchFeatures</code>\nfields are available for the template engine. Matched features can be\nreferenced with <code class=\"language-plaintext highlighter-rouge\">{{ .&lt;feature-name&gt; }}</code> in the template, and\nthe available data could be described in yaml as follows:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"s\">.</span>\n <span class=\"s\">&lt;key-feature&gt;</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">Name</span><span class=\"pi\">:</span> <span class=\"s\">&lt;matched-key&gt;</span>\n <span class=\"pi\">-</span> <span class=\"s\">...</span>\n\n <span class=\"s\">&lt;value-feature&gt;</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">Name</span><span class=\"pi\">:</span> <span class=\"s\">&lt;matched-key&gt;</span>\n <span class=\"na\">Value</span><span class=\"pi\">:</span> <span class=\"s\">&lt;matched-value&gt;</span>\n <span class=\"pi\">-</span> <span class=\"s\">...</span>\n\n <span class=\"s\">&lt;instance-feature&gt;</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"s\">&lt;attribute-1-name&gt;</span><span class=\"pi\">:</span> <span class=\"s\">&lt;attribute-1-value&gt;</span>\n <span class=\"s\">&lt;attribute-2-name&gt;</span><span class=\"pi\">:</span> <span class=\"s\">&lt;attribute-2-value&gt;</span>\n <span class=\"s\">...</span>\n <span class=\"pi\">-</span> <span class=\"s\">...</span>\n</code></pre> </div></div>\n\n<p>That is, the per-feature data is a list of objects whose data fields depend on\nthe type of the feature:</p>\n\n<ul>\n <li>for <em>flag</em> features only Name is available</li>\n <li>for <em>value</em> features Name and Value are available</li>\n <li>for <em>instance</em> features all attributes of the matched instance are available</li>\n</ul>\n\n<p>A simple example of a template utilizing name and value from an <em>attribute</em>\nfeature:\n<!-- --></p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code> <span class=\"na\">labelsTemplate</span><span class=\"pi\">:</span> <span class=\"pi\">|</span>\n <span class=\"s\">{{ range .system.osrelease }}system-{{ .Name }}={{ .Value }}</span>\n <span class=\"s\">{{ end }}</span>\n <span class=\"na\">matchFeatures</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">system.osRelease</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">ID</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">Exists</span><span class=\"pi\">}</span>\n <span class=\"s\">VERSION_ID.major</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">Exists</span><span class=\"pi\">}</span>\n</code></pre> </div></div>\n\n<!-- -->\n<p><strong>NOTE</strong> In case of matchAny is specified, the template is executed separately\nagainst each individual <code class=\"language-plaintext highlighter-rouge\">matchFeatures</code> field and the final set of labels will\nbe superset of all these separate template expansions. E.g. consider the\nfollowing:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code> <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s\">&lt;name&gt;</span>\n <span class=\"na\">labelsTemplate</span><span class=\"pi\">:</span> <span class=\"s\">&lt;template&gt;</span>\n <span class=\"na\">matchFeatures</span><span class=\"pi\">:</span> <span class=\"s\">&lt;matcher#1&gt;</span>\n <span class=\"na\">matchAny</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">matchFeatures</span><span class=\"pi\">:</span> <span class=\"s\">&lt;matcher#2&gt;</span>\n <span class=\"pi\">-</span> <span class=\"na\">matchFeatures</span><span class=\"pi\">:</span> <span class=\"s\">&lt;matcher#3&gt;</span>\n</code></pre> </div></div>\n\n<p>In the example above (assuming the overall result is a match) the template\nwould be executed on matcher#1 as well as on matcher#2 and/or matcher#3\n(depending on whether both or only one of them match). All the labels from\nthese separate expansions would be created, i.e. the end result would be a\nunion of all the individual expansions.</p>\n\n<p>Rule templates use the Golang <a href=\"https://pkg.go.dev/text/template\">text/template</a>\npackage and all its built-in functionality (e.g. pipelines and functions) can\nbe used. An example template taking use of the built-in <code class=\"language-plaintext highlighter-rouge\">len</code> function,\nadvertising the number of PCI network controllers from a specific vendor:\n<!-- --></p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code> <span class=\"na\">labelsTemplate</span><span class=\"pi\">:</span> <span class=\"pi\">|</span>\n <span class=\"s\">num-intel-network-controllers={{ .pci.device | len }}</span>\n <span class=\"na\">matchFeatures</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">pci.device</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">vendor</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">In</span><span class=\"pi\">,</span> <span class=\"nv\">value</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">8086\"</span><span class=\"pi\">]}</span>\n <span class=\"na\">class</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">In</span><span class=\"pi\">,</span> <span class=\"nv\">value</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">0200\"</span><span class=\"pi\">]}</span>\n\n</code></pre> </div></div>\n\n<!-- -->\n<p>Imaginative template pipelines are possible, but care must be taken in order to\nproduce understandable and maintainable rule sets.</p>\n\n<h3 id=\"backreferences\">Backreferences</h3>\n\n<p>Rules support referencing the output of preceding rules. This enables\nsophisticated scenarios where multiple rules are combined together\nto for more complex heuristics than a single rule can provide. The labels and\nvars created by the execution of preceding rules are available as a special\n<code class=\"language-plaintext highlighter-rouge\">rule.matched</code> feature.</p>\n\n<p>Consider the following configuration:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code> <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">my</span><span class=\"nv\"> </span><span class=\"s\">kernel</span><span class=\"nv\"> </span><span class=\"s\">label</span><span class=\"nv\"> </span><span class=\"s\">rule\"</span>\n <span class=\"na\">labels</span><span class=\"pi\">:</span>\n <span class=\"na\">kernel-feature</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">true\"</span>\n <span class=\"na\">matchFeatures</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">kernel.version</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">major</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">Gt</span><span class=\"pi\">,</span> <span class=\"nv\">value</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">4\"</span><span class=\"pi\">]}</span>\n\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">my</span><span class=\"nv\"> </span><span class=\"s\">var</span><span class=\"nv\"> </span><span class=\"s\">rule\"</span>\n <span class=\"na\">vars</span><span class=\"pi\">:</span>\n <span class=\"na\">nolabel-feature</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">true\"</span>\n <span class=\"na\">matchFeatures</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">cpu.cpuid</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">AVX512F</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">Exists</span><span class=\"pi\">}</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">pci.device</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">vendor</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">In</span><span class=\"pi\">,</span> <span class=\"nv\">value</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">0fff\"</span><span class=\"pi\">]}</span>\n <span class=\"na\">device</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">In</span><span class=\"pi\">,</span> <span class=\"nv\">value</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">1234\"</span><span class=\"pi\">,</span> <span class=\"s2\">\"</span><span class=\"s\">1235\"</span><span class=\"pi\">]}</span>\n\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">my</span><span class=\"nv\"> </span><span class=\"s\">high</span><span class=\"nv\"> </span><span class=\"s\">level</span><span class=\"nv\"> </span><span class=\"s\">feature</span><span class=\"nv\"> </span><span class=\"s\">rule\"</span>\n <span class=\"na\">labels</span><span class=\"pi\">:</span>\n <span class=\"na\">high-level-feature</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">true\"</span>\n <span class=\"na\">matchFeatures</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">rule.matched</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">kernel-feature</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">IsTrue</span><span class=\"pi\">}</span>\n <span class=\"na\">nolabel-feature</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">IsTrue</span><span class=\"pi\">}</span>\n</code></pre> </div></div>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">feature.node.kubernetes.io/high-level-feature = true</code> label depends on thw\ntwo previous rules.</p>\n\n<p>Note that when referencing rules across multiple\n<a href=\"#nodefeaturerule-custom-resource\"><code class=\"language-plaintext highlighter-rouge\">NodeFeatureRule</code></a> objects attention must be\npaid to the ordering. <code class=\"language-plaintext highlighter-rouge\">NodeFeatureRule</code> objects are processed in alphabetical\norder (based on their <code class=\"language-plaintext highlighter-rouge\">.metadata.name</code>).</p>\n\n<h3 id=\"examples\">Examples</h3>\n\n<p>Some more configuration examples below.</p>\n\n<p>Match certain CPUID features:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code> <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">example</span><span class=\"nv\"> </span><span class=\"s\">cpuid</span><span class=\"nv\"> </span><span class=\"s\">rule\"</span>\n <span class=\"na\">labels</span><span class=\"pi\">:</span>\n <span class=\"na\">my-special-cpu-feature</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">true\"</span>\n <span class=\"na\">matchFeatures</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">cpu.cpuid</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">AESNI</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">Exists</span><span class=\"pi\">}</span>\n <span class=\"na\">AVX</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">Exists</span><span class=\"pi\">}</span>\n</code></pre> </div></div>\n\n<p>Require a certain loaded kernel module and OS version:</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code> <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">my</span><span class=\"nv\"> </span><span class=\"s\">multi-feature</span><span class=\"nv\"> </span><span class=\"s\">rule\"</span>\n <span class=\"na\">labels</span><span class=\"pi\">:</span>\n <span class=\"na\">my-special-multi-feature</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">true\"</span>\n <span class=\"na\">matchFeatures</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">kernel.loadedmodule</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">e1000</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">Exists</span><span class=\"pi\">}</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">system.osrelease</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">NAME</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">InRegexp</span><span class=\"pi\">,</span> <span class=\"nv\">values</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">^openSUSE\"</span><span class=\"pi\">]}</span>\n <span class=\"s\">VERSION_ID.major</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">Gt</span><span class=\"pi\">,</span> <span class=\"nv\">values</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">14\"</span><span class=\"pi\">]}</span>\n</code></pre> </div></div>\n\n<p>Require a loaded kernel module and two specific PCI devices (both of which\nmust be present):</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code> <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">my</span><span class=\"nv\"> </span><span class=\"s\">multi-device</span><span class=\"nv\"> </span><span class=\"s\">rule\"</span>\n <span class=\"na\">labels</span><span class=\"pi\">:</span>\n <span class=\"na\">my-multi-device-feature</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">true\"</span>\n <span class=\"na\">matchFeatures</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">feature</span><span class=\"pi\">:</span> <span class=\"s\">kernel.loadedmodule</span>\n <span class=\"na\">matchExpressions</span><span class=\"pi\">:</span>\n <span class=\"na\">my-driver-module</span><span class=\"pi\">:</span> <span class=\"pi\">{</span><span class=\"nv\">op</span><span class=\"pi\">:</span> <span class=\"nv\">Exists</span><span class=\"pi\">}</span>\n <span class=\"pi\">-</span> <span class=\"s\">pci.device</span><span class=\"pi\">:</span>\n <span class=\"na\">vendor</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">0fff\"</span>\n <span class=\"na\">device</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">1234\"</span>\n <span class=\"pi\">-</span> <span class=\"s\">pci.device</span><span class=\"pi\">:</span>\n <span class=\"na\">vendor</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">0fff\"</span>\n <span class=\"na\">device</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">abcd\"</span>\n</code></pre> </div></div>\n\n<h2 id=\"legacy-custom-rule-syntax\">Legacy custom rule syntax</h2>\n\n<p><strong>DEPRECATED</strong>: use the new rule syntax instead.</p>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">custom</code> source supports the legacy <code class=\"language-plaintext highlighter-rouge\">matchOn</code> rule syntax for\nbackwards-compatibility.</p>\n\n<p>To aid in making the legacy rule syntax clearer, we define a general and a per\nrule nomenclature, keeping things as consistent as possible.</p>\n\n<h3 id=\"general-nomenclature-and-definitions\">General nomenclature and definitions</h3>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>Rule :Represents a matching logic that is used to match on a feature.\nRule Input :The input a Rule is provided. This determines how a Rule performs the match operation.\nMatcher :A composition of Rules, each Matcher may be composed of at most one instance of each Rule.\n</code></pre> </div></div>\n\n<h3 id=\"custom-features-format-using-the-nomenclature-defined-above\">Custom features format (using the nomenclature defined above)</h3>\n\n<p>Rules are specified under <code class=\"language-plaintext highlighter-rouge\">sources.custom</code> in the nfd-worker configuration\nfile.</p>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">sources</span><span class=\"pi\">:</span>\n <span class=\"na\">custom</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s\">&lt;feature name&gt;</span>\n <span class=\"na\">value</span><span class=\"pi\">:</span> <span class=\"s\">&lt;optional feature value, defaults to \"true\"&gt;</span>\n <span class=\"na\">matchOn</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"s\">&lt;Rule-1&gt;</span><span class=\"pi\">:</span> <span class=\"s\">&lt;Rule-1 Input&gt;</span>\n <span class=\"pi\">[</span><span class=\"nv\">&lt;Rule-2&gt;</span><span class=\"pi\">:</span> <span class=\"nv\">&lt;Rule-2 Input&gt;</span><span class=\"pi\">]</span>\n <span class=\"pi\">-</span> <span class=\"s\">&lt;Matcher-2&gt;</span>\n <span class=\"pi\">-</span> <span class=\"s\">...</span>\n <span class=\"pi\">-</span> <span class=\"s\">...</span>\n <span class=\"pi\">-</span> <span class=\"s\">&lt;Matcher-N&gt;</span>\n <span class=\"pi\">-</span> <span class=\"s\">&lt;custom feature 2&gt;</span>\n <span class=\"pi\">-</span> <span class=\"s\">...</span>\n <span class=\"pi\">-</span> <span class=\"s\">...</span>\n <span class=\"pi\">-</span> <span class=\"s\">&lt;custom feature M&gt;</span>\n</code></pre> </div></div>\n\n<p>The label is constructed by adding <code class=\"language-plaintext highlighter-rouge\">custom-</code> prefix to the name field, label\nvalue defaults to <code class=\"language-plaintext highlighter-rouge\">true</code> if not specified in the rule spec:</p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>feature.node.kubernetes.io/custom-&lt;name&gt; = &lt;value&gt;\n</code></pre> </div></div>\n\n<h3 id=\"matching-process\">Matching process</h3>\n\n<p>Specifying Rules to match on a feature is done by providing a list of Matchers.\nEach Matcher contains one or more Rules.</p>\n\n<p>Logical <em>OR</em> is performed between Matchers and logical <em>AND</em> is performed\nbetween Rules of a given Matcher.</p>\n\n<h3 id=\"rules\">Rules</h3>\n\n<h4 id=\"pciid-rule\">pciid rule</h4>\n\n<h5 id=\"nomenclature\">Nomenclature</h5>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>Attribute :A PCI attribute.\nElement :An identifier of the PCI attribute.\n</code></pre> </div></div>\n\n<p>The PciId Rule allows matching the PCI devices in the system on the following\nAttributes: <code class=\"language-plaintext highlighter-rouge\">class</code>,<code class=\"language-plaintext highlighter-rouge\">vendor</code> and <code class=\"language-plaintext highlighter-rouge\">device</code>. A list of Elements is provided for\neach Attribute.</p>\n\n<h5 id=\"format\">Format</h5>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">pciId </span><span class=\"pi\">:</span>\n <span class=\"na\">class</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"nv\">&lt;class id&gt;</span><span class=\"pi\">,</span> <span class=\"nv\">...</span><span class=\"pi\">]</span>\n <span class=\"na\">vendor</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"nv\">&lt;vendor id&gt;</span><span class=\"pi\">,</span> <span class=\"nv\">...</span><span class=\"pi\">]</span>\n <span class=\"na\">device</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"nv\">&lt;device id&gt;</span><span class=\"pi\">,</span> <span class=\"nv\">...</span><span class=\"pi\">]</span>\n</code></pre> </div></div>\n\n<p>Matching is done by performing a logical <em>OR</em> between Elements of an Attribute\nand logical <em>AND</em> between the specified Attributes for each PCI device in the\nsystem. At least one Attribute must be specified. Missing attributes will not\npartake in the matching process.</p>\n\n<h4 id=\"usbid-rule\">UsbId rule</h4>\n\n<h5 id=\"nomenclature-1\">Nomenclature</h5>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>Attribute :A USB attribute.\nElement :An identifier of the USB attribute.\n</code></pre> </div></div>\n\n<p>The UsbId Rule allows matching the USB devices in the system on the following\nAttributes: <code class=\"language-plaintext highlighter-rouge\">class</code>,<code class=\"language-plaintext highlighter-rouge\">vendor</code>, <code class=\"language-plaintext highlighter-rouge\">device</code> and <code class=\"language-plaintext highlighter-rouge\">serial</code>. A list of Elements is\nprovided for each Attribute.</p>\n\n<h5 id=\"format-1\">Format</h5>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">usbId </span><span class=\"pi\">:</span>\n <span class=\"na\">class</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"nv\">&lt;class id&gt;</span><span class=\"pi\">,</span> <span class=\"nv\">...</span><span class=\"pi\">]</span>\n <span class=\"na\">vendor</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"nv\">&lt;vendor id&gt;</span><span class=\"pi\">,</span> <span class=\"nv\">...</span><span class=\"pi\">]</span>\n <span class=\"na\">device</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"nv\">&lt;device id&gt;</span><span class=\"pi\">,</span> <span class=\"nv\">...</span><span class=\"pi\">]</span>\n <span class=\"na\">serial</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"nv\">&lt;serial&gt;</span><span class=\"pi\">,</span> <span class=\"nv\">...</span><span class=\"pi\">]</span>\n</code></pre> </div></div>\n\n<p>Matching is done by performing a logical <em>OR</em> between Elements of an Attribute\nand logical <em>AND</em> between the specified Attributes for each USB device in the\nsystem. At least one Attribute must be specified. Missing attributes will not\npartake in the matching process.</p>\n\n<h4 id=\"loadedkmod-rule\">LoadedKMod rule</h4>\n\n<h5 id=\"nomenclature-2\">Nomenclature</h5>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>Element :A kernel module\n</code></pre> </div></div>\n\n<p>The LoadedKMod Rule allows matching the loaded kernel modules in the system\nagainst a provided list of Elements.</p>\n\n<h5 id=\"format-2\">Format</h5>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">loadedKMod </span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"nv\">&lt;kernel module&gt;</span><span class=\"pi\">,</span> <span class=\"nv\">...</span><span class=\"pi\">]</span>\n</code></pre> </div></div>\n\n<p>Matching is done by performing logical <em>AND</em> for each provided Element, i.e\nthe Rule will match if all provided Elements (kernel modules) are loaded in the\nsystem.</p>\n\n<h4 id=\"cpuid-rule\">CpuId rule</h4>\n\n<h5 id=\"nomenclature-3\">Nomenclature</h5>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>Element :A CPUID flag\n</code></pre> </div></div>\n\n<p>The Rule allows matching the available CPUID flags in the system against a\nprovided list of Elements.</p>\n\n<h5 id=\"format-3\">Format</h5>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">cpuId </span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"nv\">&lt;CPUID flag string&gt;</span><span class=\"pi\">,</span> <span class=\"nv\">...</span><span class=\"pi\">]</span>\n</code></pre> </div></div>\n\n<p>Matching is done by performing logical <em>AND</em> for each provided Element, i.e the\nRule will match if all provided Elements (CPUID flag strings) are available in\nthe system.</p>\n\n<h4 id=\"kconfig-rule\">Kconfig rule</h4>\n\n<h5 id=\"nomenclature-4\">Nomenclature</h5>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>Element :A Kconfig option\n</code></pre> </div></div>\n\n<p>The Rule allows matching the kconfig options in the system against a provided\nlist of Elements.</p>\n\n<h5 id=\"format-4\">Format</h5>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">kConfig</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"nv\">&lt;kernel config option ('y' or 'm') or '=&lt;value&gt;'&gt;</span><span class=\"pi\">,</span> <span class=\"nv\">...</span><span class=\"pi\">]</span>\n</code></pre> </div></div>\n\n<p>Matching is done by performing logical <em>AND</em> for each provided Element, i.e the\nRule will match if all provided Elements (kernel config options) are enabled\n(<code class=\"language-plaintext highlighter-rouge\">y</code> or <code class=\"language-plaintext highlighter-rouge\">m</code>) or matching <code class=\"language-plaintext highlighter-rouge\">=&lt;value&gt;</code> in the kernel.</p>\n\n<h4 id=\"nodename-rule\">Nodename rule</h4>\n\n<h5 id=\"nomenclature-5\">Nomenclature</h5>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>Element :A nodename regexp pattern\n</code></pre> </div></div>\n\n<p>The Rule allows matching the nodes name against a provided list of Elements.</p>\n\n<h5 id=\"format-5\">Format</h5>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">nodename</span><span class=\"pi\">:</span> <span class=\"pi\">[</span> <span class=\"nv\">&lt;nodename regexp pattern&gt;</span><span class=\"pi\">,</span> <span class=\"nv\">...</span> <span class=\"pi\">]</span>\n</code></pre> </div></div>\n\n<p>Matching is done by performing logical <em>OR</em> for each provided Element, i.e the\nRule will match if one of the provided Elements (nodename regexp pattern)\nmatches the nodes name.</p>\n\n<h3 id=\"legacy-custom-rule-example\">Legacy custom rule example</h3>\n\n<div class=\"language-yaml highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"na\">custom</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">my.kernel.feature\"</span>\n <span class=\"na\">matchOn</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">loadedKMod</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">kmod1\"</span><span class=\"pi\">,</span> <span class=\"s2\">\"</span><span class=\"s\">kmod2\"</span><span class=\"pi\">]</span>\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">my.pci.feature\"</span>\n <span class=\"na\">matchOn</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">pciId</span><span class=\"pi\">:</span>\n <span class=\"na\">vendor</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">15b3\"</span><span class=\"pi\">]</span>\n <span class=\"na\">device</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">1014\"</span><span class=\"pi\">,</span> <span class=\"s2\">\"</span><span class=\"s\">1017\"</span><span class=\"pi\">]</span>\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">my.usb.feature\"</span>\n <span class=\"na\">matchOn</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">usbId</span><span class=\"pi\">:</span>\n <span class=\"na\">vendor</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">1d6b\"</span><span class=\"pi\">]</span>\n <span class=\"na\">device</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">0003\"</span><span class=\"pi\">]</span>\n <span class=\"na\">serial</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">090129a\"</span><span class=\"pi\">]</span>\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">my.combined.feature\"</span>\n <span class=\"na\">matchOn</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">loadedKMod </span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">vendor_kmod1\"</span><span class=\"pi\">,</span> <span class=\"s2\">\"</span><span class=\"s\">vendor_kmod2\"</span><span class=\"pi\">]</span>\n <span class=\"na\">pciId</span><span class=\"pi\">:</span>\n <span class=\"na\">vendor</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">15b3\"</span><span class=\"pi\">]</span>\n <span class=\"na\">device</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">1014\"</span><span class=\"pi\">,</span> <span class=\"s2\">\"</span><span class=\"s\">1017\"</span><span class=\"pi\">]</span>\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">vendor.feature.node.kubernetes.io/accumulated.feature\"</span>\n <span class=\"na\">matchOn</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">loadedKMod </span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">some_kmod1\"</span><span class=\"pi\">,</span> <span class=\"s2\">\"</span><span class=\"s\">some_kmod2\"</span><span class=\"pi\">]</span>\n <span class=\"pi\">-</span> <span class=\"na\">pciId</span><span class=\"pi\">:</span>\n <span class=\"na\">vendor</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">15b3\"</span><span class=\"pi\">]</span>\n <span class=\"na\">device</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">1014\"</span><span class=\"pi\">,</span> <span class=\"s2\">\"</span><span class=\"s\">1017\"</span><span class=\"pi\">]</span>\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">my.kernel.featureneedscpu\"</span>\n <span class=\"na\">matchOn</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">kConfig</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">KVM_INTEL\"</span><span class=\"pi\">]</span>\n <span class=\"pi\">-</span> <span class=\"na\">cpuId</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">VMX\"</span><span class=\"pi\">]</span>\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">my.kernel.modulecompiler\"</span>\n <span class=\"na\">matchOn</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">kConfig</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">GCC_VERSION=100101\"</span><span class=\"pi\">]</span>\n <span class=\"na\">loadedKMod</span><span class=\"pi\">:</span> <span class=\"pi\">[</span><span class=\"s2\">\"</span><span class=\"s\">kmod1\"</span><span class=\"pi\">]</span>\n <span class=\"pi\">-</span> <span class=\"na\">name</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">profile.node.kubernetes.io/my-datacenter\"</span>\n <span class=\"na\">value</span><span class=\"pi\">:</span> <span class=\"s2\">\"</span><span class=\"s\">datacenter-1\"</span>\n <span class=\"na\">matchOn</span><span class=\"pi\">:</span>\n <span class=\"pi\">-</span> <span class=\"na\">nodename</span><span class=\"pi\">:</span> <span class=\"pi\">[</span> <span class=\"s2\">\"</span><span class=\"s\">node-datacenter1-rack.*-server.*\"</span> <span class=\"pi\">]</span>\n</code></pre> </div></div>\n\n<p><strong>In the example above:</strong></p>\n\n<ul>\n <li>A node would contain the label:\n<code class=\"language-plaintext highlighter-rouge\">feature.node.kubernetes.io/custom-my.kernel.feature=true</code> if the node has\n<code class=\"language-plaintext highlighter-rouge\">kmod1</code> <em>AND</em> <code class=\"language-plaintext highlighter-rouge\">kmod2</code> kernel modules loaded.</li>\n <li>A node would contain the label:\n<code class=\"language-plaintext highlighter-rouge\">feature.node.kubernetes.io/custom-my.pci.feature=true</code> if the node contains\na PCI device with a PCI vendor ID of <code class=\"language-plaintext highlighter-rouge\">15b3</code> <em>AND</em> PCI device ID of <code class=\"language-plaintext highlighter-rouge\">1014</code> <em>OR</em>\n<code class=\"language-plaintext highlighter-rouge\">1017</code>.</li>\n <li>A node would contain the label:\n<code class=\"language-plaintext highlighter-rouge\">feature.node.kubernetes.io/custom-my.usb.feature=true</code> if the node contains\na USB device with a USB vendor ID of <code class=\"language-plaintext highlighter-rouge\">1d6b</code> <em>AND</em> USB device ID of <code class=\"language-plaintext highlighter-rouge\">0003</code>.</li>\n <li>A node would contain the label:\n<code class=\"language-plaintext highlighter-rouge\">feature.node.kubernetes.io/custom-my.combined.feature=true</code> if\n<code class=\"language-plaintext highlighter-rouge\">vendor_kmod1</code> <em>AND</em> <code class=\"language-plaintext highlighter-rouge\">vendor_kmod2</code> kernel modules are loaded <strong>AND</strong> the node\ncontains a PCI device\nwith a PCI vendor ID of <code class=\"language-plaintext highlighter-rouge\">15b3</code> <em>AND</em> PCI device ID of <code class=\"language-plaintext highlighter-rouge\">1014</code> <em>or</em> <code class=\"language-plaintext highlighter-rouge\">1017</code>.</li>\n <li>A node would contain the label:\n<code class=\"language-plaintext highlighter-rouge\">vendor.feature.node.kubernetes.io/accumulated.feature=true</code> if\n<code class=\"language-plaintext highlighter-rouge\">some_kmod1</code> <em>AND</em> <code class=\"language-plaintext highlighter-rouge\">some_kmod2</code> kernel modules are loaded <strong>OR</strong> the node\ncontains a PCI device\nwith a PCI vendor ID of <code class=\"language-plaintext highlighter-rouge\">15b3</code> <em>AND</em> PCI device ID of <code class=\"language-plaintext highlighter-rouge\">1014</code> <em>OR</em> <code class=\"language-plaintext highlighter-rouge\">1017</code>.</li>\n <li>A node would contain the label:\n<code class=\"language-plaintext highlighter-rouge\">feature.node.kubernetes.io/custom-my.kernel.featureneedscpu=true</code> if\n<code class=\"language-plaintext highlighter-rouge\">KVM_INTEL</code> kernel config is enabled <strong>AND</strong> the node CPU supports <code class=\"language-plaintext highlighter-rouge\">VMX</code>\nvirtual machine extensions</li>\n <li>A node would contain the label:\n<code class=\"language-plaintext highlighter-rouge\">feature.node.kubernetes.io/custom-my.kernel.modulecompiler=true</code> if the\nin-tree <code class=\"language-plaintext highlighter-rouge\">kmod1</code> kernel module is loaded <strong>AND</strong> its built with\n<code class=\"language-plaintext highlighter-rouge\">GCC_VERSION=100101</code>.</li>\n <li>A node would contain the label:\n<code class=\"language-plaintext highlighter-rouge\">profile.node.kubernetes.io/my-datacenter=datacenter-1</code> if the nodes name\nmatches the <code class=\"language-plaintext highlighter-rouge\">node-datacenter1-rack.*-server.*</code> pattern, e.g.\n<code class=\"language-plaintext highlighter-rouge\">node-datacenter1-rack2-server42</code></li>\n</ul>\n\n","dir":"/advanced/","name":"customization-guide.md","path":"advanced/customization-guide.md","url":"/advanced/customization-guide.html"}]