1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-06 08:47:04 +00:00
node-feature-discovery/v0.9/get-started/features.html

104 lines
60 KiB
HTML
Raw Normal View History

<!DOCTYPE html> <html lang="en" dir="auto"> <head><meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="description" content="Feature discovery Table of contents Feature labels Feature sources CPU Custom IOMMU Kernel Memory Network PCI USB Storage System Local user-speci..."> <meta name="revised" content=""> <meta name="author" content="Kubernetes SIGs"> <meta name="generator" content="jekyll-rtd-theme v2.0.9"> <meta property="og:title" content="Feature discovery · Node Feature Discovery"> <meta property="og:description" content="Feature discovery Table of contents Feature labels Feature sources CPU Custom IOMMU Kernel Memory Network PCI USB Storage System Local user-speci..."> <meta property="og:locale" content="en"> <meta property="og:url" content="https://kubernetes-sigs.github.com/node-feature-discovery/v0.9/get-started/features.html"> <meta property="og:type" content="article"> <meta property="article:author" content="Kubernetes SIGs"> <meta property="article:published_time" content="2016-07-23T00:07:52-05:00"> <meta property="article:modified_time" content="2022-01-25T10:04:57-06:00"> <meta name="twitter:title" content="Feature discovery · Node Feature Discovery"> <meta name="twitter:description" content="Feature discovery Table of contents Feature labels Feature sources CPU Custom IOMMU Kernel Memory Network PCI USB Storage System Local user-speci..."> <meta name="twitter:card" content="summary"> <meta name="twitter:site" content="@Kubernetes SIGs"> <meta name="twitter:url" content="https://kubernetes-sigs.github.com/node-feature-discovery/v0.9/get-started/features.html"> <meta name="twitter:creator" content="@jekyll-rtd-theme v2.0.9"> <title>Feature discovery · Node Feature Discovery</title> <link rel="dns-prefetch" href="https://rundocs-analytics.glitch.me"> <link rel="dns-prefetch" href="https://cdn.jsdelivr.net"> <link rel="canonical" href="https://kubernetes-sigs.github.com/node-feature-discovery/v0.9/get-started/features.html"><link rel="prev" href="https://kubernetes-sigs.github.com/node-feature-discovery/v0.9/get-started/deployment-and-usage.html"><link rel="next" href="https://kubernetes-sigs.github.com/node-feature-discovery/v0.9/get-started/examples-and-demos.html"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/rundocs/jekyll-rtd-theme@2.0.9/assets/css/theme.min.css"> <link rel="icon" type="image/svg+xml" href="/node-feature-discovery/v0.9/assets/images/favicon.svg"> <link rel="icon" type="image/png" href="/node-feature-discovery/v0.9/assets/images/favicon-16x16.png" sizes="16x16"> <link rel="icon" type="image/png" href="/node-feature-discovery/v0.9/assets/images/favicon-32x32.png" sizes="32x32"> <link rel="icon" type="image/png" href="/node-feature-discovery/v0.9/assets/images/favicon-96x96.png" sizes="96x96"> <link rel="mask-icon" href="/node-feature-discovery/v0.9/assets/images/favicon.svg" color="#2980b9"> <link rel="apple-touch-icon" href="/node-feature-discovery/v0.9/assets/images/apple-touch-icon-300x300.jpg"> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Article", "mainEntityOfPage": { "@type": "WebPage", "@id": "https://kubernetes-sigs.github.com/node-feature-discovery/v0.9/get-started/features.html" }, "headline": "Feature discovery · Node Feature Discovery", "image": [], "author": { "@type": "Person", "name": "Kubernetes SIGs" }, "datePublished": "2016-07-23T00:07:52-05:00", "dateModified": "2022-01-25T10:04:57-06:00", "publisher": { "@type": "Organization", "name": "Kubernetes SIGs", "logo": { "@type": "ImageObject", "url": "https://avatars.githubusercontent.com/u/36015203?v=4" } }, "description": "Feature discovery Table of contents Feature labels Feature sources CPU Custom IOMMU Kernel Memory Network PCI USB Storage System Local user-speci..." } </script> </head> <body class="container"><div class="sidebar-wrap overflow-hidden"> <div class="sidebar height-full overflow-y-scroll overflow-x-hidden"> <div class="header d-flex flex-column p-3
</code></pre> </div></div> <p>The last component (i.e. <code class="language-plaintext highlighter-rouge notranslate">attribute-name</code>) is optional, and only used if a feature logically has sub-hierarchy, e.g. <code class="language-plaintext highlighter-rouge notranslate">sriov.capable</code> and <code class="language-plaintext highlighter-rouge notranslate">sriov.configure</code> from the <code class="language-plaintext highlighter-rouge notranslate">network</code> source.</p> <p>The <code class="language-plaintext highlighter-rouge notranslate">-sources</code> flag controls which sources to use for discovery.</p> <p><em>Note: Consecutive runs of nfd-worker will update the labels on a given node. If features are not discovered on a consecutive run, the corresponding label will be removed. This includes any restrictions placed on the consecutive run, such as restricting discovered features with the -label-whitelist option.</em></p> <h2 id="feature-sources">Feature sources</h2> <h3 id="cpu">CPU</h3> <p>The <strong>cpu</strong> feature source supports the following labels:</p> <table> <thead> <tr> <th>Feature name</th> <th>Attribute</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>cpuid</td> <td>&lt;cpuid flag&gt;</td> <td>CPU capability is supported</td> </tr> <tr> <td>hardware_multithreading</td> <td> </td> <td>Hardware multithreading, such as Intel HTT, enabled (number of logical CPUs is greater than physical CPUs)</td> </tr> <tr> <td>power</td> <td>sst_bf.enabled</td> <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> </tr> <tr> <td><a href="https://www.kernel.org/doc/Documentation/cpu-freq/intel-pstate.txt">pstate</a></td> <td>status</td> <td>The status of the Intel pstate driver when in use and enabled, either active' or passive'.</td> </tr> <tr> <td> </td> <td>turbo</td> <td>Set to true' if turbo frequencies are enabled in Intel pstate driver, set to false' if they have been disabled.</td> </tr> <tr> <td> </td> <td>scaling_governor</td> <td>The value of the Intel pstate scaling_governor when in use, either powersave' or performance'.</td> </tr> <tr> <td>cstate</td> <td>enabled</td> <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> </tr> <tr> <td><a href="http://www.intel.com/content/www/us/en/architecture-and-technology/resource-director-technology.html">rdt</a></td> <td>RDTMON</td> <td>Intel RDT Monitoring Technology</td> </tr> <tr> <td> </td> <td>RDTCMT</td> <td>Intel Cache Monitoring (CMT)</td> </tr> <tr> <td> </td> <td>RDTMBM</td> <td>Intel Memory Bandwidth Monitoring (MBM)</td> </tr> <tr> <td> </td> <td>RDTL3CA</td> <td>Intel L3 Cache Allocation Technology</td> </tr> <tr> <td> </td> <td>RDTL2CA</td> <td>Intel L2 Cache Allocation Technology</td> </tr> <tr> <td> </td> <td>RDTMBA</td> <td>Intel Memory Bandwidth Allocation (MBA) Technology</td> </tr> </tbody> </table> <p>The (sub-)set of CPUID attributes to publish is configurable via the <code class="language-plaintext highlighter-rouge notranslate">attributeBlacklist</code> and <code class="language-plaintext highlighter-rouge notranslate">attributeWhitelist</code> cpuid options of the cpu source. If whitelist is specified, only whitelisted attributes will be published. With blacklist, only blacklisted attributes are filtered out. <code class="language-plaintext highlighter-rouge notranslate">attributeWhitelist</code> has priority over <code class="language-plaintext highlighter-rouge notranslate">attributeBlacklist</code>. For examples and more information about configurability, see <a href="deployment-and-usage#worker-configuration">configuration</a>. By default, the following CPUID flags have been blacklisted: BMI1, BMI2, CLMUL, CMOV, CX16, ERMS, F16C, HTT, LZCNT, MMX, MMXEXT, NX, POPCNT, RDRAND, RDSEED, RDTSCP, SGX, SSE, SSE2, SSE3, SSE4, SSE42 and SSSE3.</p> <p><strong>NOTE</s
Rule Input :The input a Rule is provided. This determines how a Rule performs the match operation.
Matcher :A composition of Rules, each Matcher may be composed of at most one instance of each Rule.
</code></pre> </div></div> <h4 id="custom-features-format-using-the-nomenclature-defined-above">Custom features format (using the nomenclature defined above)</h4> <p>Rules are specified under <code class="language-plaintext highlighter-rouge notranslate">sources.custom</code> in the nfd-worker configuration file.</p> <div class="language-yaml highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code><span class="na">sources</span><span class="pi">:</span>
<span class="na">custom</span><span class="pi">:</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">&lt;feature name&gt;</span>
<span class="na">value</span><span class="pi">:</span> <span class="s">&lt;optional feature value, defaults to "true"&gt;</span>
<span class="na">matchOn</span><span class="pi">:</span>
<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>
<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>
<span class="pi">-</span> <span class="s">&lt;Matcher-2&gt;</span>
<span class="pi">-</span> <span class="s">...</span>
<span class="pi">-</span> <span class="s">...</span>
<span class="pi">-</span> <span class="s">&lt;Matcher-N&gt;</span>
<span class="pi">-</span> <span class="s">&lt;custom feature 2&gt;</span>
<span class="pi">-</span> <span class="s">...</span>
<span class="pi">-</span> <span class="s">...</span>
<span class="pi">-</span> <span class="s">&lt;custom feature M&gt;</span>
</code></pre> </div></div> <h4 id="matching-process">Matching process</h4> <p>Specifying Rules to match on a feature is done by providing a list of Matchers. Each Matcher contains one or more Rules.</p> <p>Logical <em>OR</em> is performed between Matchers and logical <em>AND</em> is performed between Rules of a given Matcher.</p> <h4 id="rules">Rules</h4> <h5 id="pciid-rule">pciid rule</h5> <h6 id="nomenclature">Nomenclature</h6> <div class="language-plaintext highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code>Attribute :A PCI attribute.
Element :An identifier of the PCI attribute.
</code></pre> </div></div> <p>The PciId Rule allows matching the PCI devices in the system on the following Attributes: <code class="language-plaintext highlighter-rouge notranslate">class</code>,<code class="language-plaintext highlighter-rouge notranslate">vendor</code> and <code class="language-plaintext highlighter-rouge notranslate">device</code>. A list of Elements is provided for each Attribute.</p> <h6 id="format">Format</h6> <div class="language-yaml highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code><span class="na">pciId </span><span class="pi">:</span>
<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>
<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>
<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>
</code></pre> </div></div> <p>Matching is done by performing a logical <em>OR</em> between Elements of an Attribute and logical <em>AND</em> between the specified Attributes for each PCI device in the system. At least one Attribute must be specified. Missing attributes will not partake in the matching process.</p> <h5 id="usbid-rule">UsbId rule</h5> <h6 id="nomenclature-1">Nomenclature</h6> <div class="language-plaintext highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code>Attribute :A USB attribute.
Element :An identifier of the USB attribute.
</code></pre> </div></div> <p>The UsbId Rule allows matching the USB devices in the system on the following Attributes: <code class="language-plaintext highlighter-rouge notranslate">class</code>,<code class="language-plaintext highlighter-rouge notranslate">vendor</code>, <code class="language-plaintext highlighter-rouge notranslate">device</code> and <code class="language-plaintext highlighter-rouge notranslate">serial</code>. A list of Elements is provided for each Attribute.</p> <h6 id="format-1">Format</h6> <div class="language-yaml highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code><span class="na">usbId </span><span class="pi">:</span>
<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>
<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>
<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>
<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>
</code></pre> </div></div> <p>Matching is done by performing a logical <em>OR</em> between Elements of an Attribute and logical <em>AND</em> between the specified Attributes for each USB device in the system. At least one Attribute must be specified. Missing attributes will not partake in the matching process.</p> <h5 id="loadedkmod-rule">LoadedKMod rule</h5> <h6 id="nomenclature-2">Nomenclature</h6> <div class="language-plaintext highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code>Element :A kernel module
</code></pre> </div></div> <p>The LoadedKMod Rule allows matching the loaded kernel modules in the system against a provided list of Elements.</p> <h6 id="format-2">Format</h6> <div class="language-yaml highlighter-rouge notranslate"><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>
</code></pre> </div></div> <p>Matching is done by performing logical <em>AND</em> for each provided Element, i.e the Rule will match if all provided Elements (kernel modules) are loaded in the system.</p> <h5 id="cpuid-rule">CpuId rule</h5> <h6 id="nomenclature-3">Nomenclature</h6> <div class="language-plaintext highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code>Element :A CPUID flag
</code></pre> </div></div> <p>The Rule allows matching the available CPUID flags in the system against a provided list of Elements.</p> <h6 id="format-3">Format</h6> <div class="language-yaml highlighter-rouge notranslate"><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>
</code></pre> </div></div> <p>Matching is done by performing logical <em>AND</em> for each provided Element, i.e the Rule will match if all provided Elements (CPUID flag strings) are available in the system.</p> <h5 id="kconfig-rule">Kconfig rule</h5> <h6 id="nomenclature-4">Nomenclature</h6> <div class="language-plaintext highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code>Element :A Kconfig option
</code></pre> </div></div> <p>The Rule allows matching the kconfig options in the system against a provided list of Elements.</p> <h6 id="format-4">Format</h6> <div class="language-yaml highlighter-rouge notranslate"><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>
</code></pre> </div></div> <p>Matching is done by performing logical <em>AND</em> for each provided Element, i.e the Rule will match if all provided Elements (kernel config options) are enabled (<code class="language-plaintext highlighter-rouge notranslate">y</code> or <code class="language-plaintext highlighter-rouge notranslate">m</code>) or matching <code class="language-plaintext highlighter-rouge notranslate">=&lt;value&gt;</code> in the kernel.</p> <h5 id="nodename-rule">Nodename rule</h5> <h6 id="nomenclature-5">Nomenclature</h6> <div class="language-plaintext highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code>Element :A nodename regexp pattern
</code></pre> </div></div> <p>The Rule allows matching the node's name against a provided list of Elements.</p> <h6 id="format-5">Format</h6> <div class="language-yaml highlighter-rouge notranslate"><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>
</code></pre> </div></div> <p>Matching is done by performing logical <em>OR</em> for each provided Element, i.e the Rule will match if one of the provided Elements (nodename regexp pattern) matches the node's name.</p> <h4 id="example">Example</h4> <div class="language-yaml highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code><span class="na">custom</span><span class="pi">:</span>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">my.kernel.feature"</span>
<span class="na">matchOn</span><span class="pi">:</span>
<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>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">my.pci.feature"</span>
<span class="na">matchOn</span><span class="pi">:</span>
<span class="pi">-</span> <span class="na">pciId</span><span class="pi">:</span>
<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>
<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>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">my.usb.feature"</span>
<span class="na">matchOn</span><span class="pi">:</span>
<span class="pi">-</span> <span class="na">usbId</span><span class="pi">:</span>
<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>
<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>
<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>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">my.combined.feature"</span>
<span class="na">matchOn</span><span class="pi">:</span>
<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>
<span class="na">pciId</span><span class="pi">:</span>
<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>
<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>
<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>
<span class="na">matchOn</span><span class="pi">:</span>
<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>
<span class="pi">-</span> <span class="na">pciId</span><span class="pi">:</span>
<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>
<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>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">my.kernel.featureneedscpu"</span>
<span class="na">matchOn</span><span class="pi">:</span>
<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>
<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>
<span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">my.kernel.modulecompiler"</span>
<span class="na">matchOn</span><span class="pi">:</span>
<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>
<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="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s2">"</span><span class="s">my.datacenter"</span>
<span class="na">value</span><span class="pi">:</span> <span class="s2">"</span><span class="s">datacenter-1"</span>
<span class="na">matchOn</span><span class="pi">:</span>
<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>
</code></pre> </div></div> <p><strong>In the example above:</strong></p> <ul> <li>A node would contain the label: <code class="language-plaintext highlighter-rouge notranslate">feature.node.kubernetes.io/custom-my.kernel.feature=true</code> if the node has <code class="language-plaintext highlighter-rouge notranslate">kmod1</code> <em>AND</em> <code class="language-plaintext highlighter-rouge notranslate">kmod2</code> kernel modules loaded.</li> <li>A node would contain the label: <code class="language-plaintext highlighter-rouge notranslate">feature.node.kubernetes.io/custom-my.pci.feature=true</code> if the node contains a PCI device with a PCI vendor ID of <code class="language-plaintext highlighter-rouge notranslate">15b3</code> <em>AND</em> PCI device ID of <code class="language-plaintext highlighter-rouge notranslate">1014</code> <em>OR</em> <code class="language-plaintext highlighter-rouge notranslate">1017</code>.</li> <li>A node would contain the label: <code class="language-plaintext highlighter-rouge notranslate">feature.node.kubernetes.io/custom-my.usb.feature=true</code> if the node contains a USB device with a USB vendor ID of <code class="language-plaintext highlighter-rouge notranslate">1d6b</code> <em>AND</em> USB device ID of <code class="language-plaintext highlighter-rouge notranslate">0003</code>.</li> <li>A node would contain the label: <code class="language-plaintext highlighter-rouge notranslate">feature.node.kubernetes.io/custom-my.combined.feature=true</code> if <code class="language-plaintext highlighter-rouge notranslate">vendor_kmod1</code> <em>AND</em> <code class="language-plaintext highlighter-rouge notranslate">vendor_kmod2</code> kernel modules are loaded <strong>AND</strong> the node contains a PCI device with a PCI vendor ID of <code class="language-plaintext highlighter-rouge notranslate">15b3</code> <em>AND</em> PCI device ID of <code class="language-plaintext highlighter-rouge notranslate">1014</code> <em>or</em> <code class="language-plaintext highlighter-rouge notranslate">1017</code>.</li> <li>A node would contain the label: <code class="language-plaintext highlighter-rouge notranslate">vendor.feature.node.kubernetes.io/accumulated.feature=true</code> if <code class="language-plaintext highlighter-rouge notranslate">some_kmod1</code> <em>AND</em> <code class="language-plaintext highlighter-rouge notranslate">some_kmod2</code> kernel modules are loaded <strong>OR</strong> the node contains a PCI device with a PCI vendor ID of <code class="language-plaintext highlighter-rouge notranslate">15b3</code> <em>AND</em> PCI device ID of <code class="language-plaintext highlighter-rouge notranslate">1014</code> <em>OR</em> <code class="language-plaintext highlighter-rouge notranslate">1017</code>.</li> <li>A node would contain the label: <code class="language-plaintext highlighter-rouge notranslate">feature.node.kubernetes.io/custom-my.kernel.featureneedscpu=true</code> if <code class="language-plaintext highlighter-rouge notranslate">KVM_INTEL</code> kernel config is enabled <strong>AND</strong> the node CPU supports <code class="language-plaintext highlighter-rouge notranslate">VMX</code> virtual machine extensions</li> <li>A node would contain the label: <code class="language-plaintext highlighter-rouge notranslate">feature.node.kubernetes.io/custom-my.kernel.modulecompiler=true</code> if the in-tree <code class="language-plaintext highlighter-rouge notranslate">kmod1</code> kernel module is loaded <strong>AND</strong> it's built with <code class="language-plaintext highlighter-rouge notranslate">GCC_VERSION=100101</code>.</li> <li>A node would contain the label: <code class="language-plaintext highlighter-rouge notranslate">feature.node.kubernetes.io/my.datacenter=datacenter-1</code> if the node's name matches the <code class="language-plaintext highlighter-rouge notranslate">node-datacenter1-rack.*-server.*</code> pattern, e.g. <code class="language-plaintext highlighter-rouge notranslate">node-datacenter1-rack2-server42</code></li> </ul> <h4 id="statically-defined-features">Statica
</code></pre> </div></div> <p>Also the set of PCI device classes that the feature source detects is configurable. By default, device classes (0x)03, (0x)0b40 and (0x)12, i.e. GPUs, co-processors and accelerator cards are detected.</p> <h3 id="usb">USB</h3> <p>The <strong>usb</strong> feature source supports the following labels:</p> <table> <thead> <tr> <th>Feature</th> <th>Attribute</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&lt;device label&gt;</td> <td>present</td> <td>USB device is detected</td> </tr> </tbody> </table> <p><code class="language-plaintext highlighter-rouge notranslate">&lt;device label&gt;</code> is composed of raw USB IDs, separated by underscores. The set of fields used in <code class="language-plaintext highlighter-rouge notranslate">&lt;device label&gt;</code> is configurable, valid fields being <code class="language-plaintext highlighter-rouge notranslate">class</code>, <code class="language-plaintext highlighter-rouge notranslate">vendor</code>, <code class="language-plaintext highlighter-rouge notranslate">device</code> and <code class="language-plaintext highlighter-rouge notranslate">serial</code>. Defaults are <code class="language-plaintext highlighter-rouge notranslate">class</code>, <code class="language-plaintext highlighter-rouge notranslate">vendor</code> and <code class="language-plaintext highlighter-rouge notranslate">device</code>. An example label using the default label fields:</p> <div class="language-plaintext highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code>feature.node.kubernetes.io/usb-fe_1a6e_089a.present=true
</code></pre> </div></div> <p>See <a href="deployment-and-usage#worker-configuration">configuration</a> for more information on NFD config.</p> <h3 id="storage">Storage</h3> <p>The <strong>storage</strong> feature source supports the following labels:</p> <table> <thead> <tr> <th>Feature name</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>nonrotationaldisk</td> <td>Non-rotational disk, like SSD, is present in the node</td> </tr> </tbody> </table> <h3 id="system">System</h3> <p>The <strong>system</strong> feature source supports the following labels:</p> <table> <thead> <tr> <th>Feature</th> <th>Attribute</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>os_release</td> <td>ID</td> <td>Operating system identifier</td> </tr> <tr> <td> </td> <td>VERSION_ID</td> <td>Operating system version identifier (e.g. 6.7')</td> </tr> <tr> <td> </td> <td>VERSION_ID.major</td> <td>First component of the OS version id (e.g. 6')</td> </tr> <tr> <td> </td> <td>VERSION_ID.minor</td> <td>Second component of the OS version id (e.g. 7')</td> </tr> </tbody> </table> <h3 id="local--user-specific-features">Local user-specific features</h3> <p>NFD has a special feature source named <em>local</em> which is designed for getting the labels from user-specific feature detector. It provides a mechanism for users to implement custom feature sources in a pluggable way, without modifying nfd source code or Docker images. The local feature source can be used to advertise new user-specific features, and, for overriding labels created by the other feature sources.</p> <p>The <em>local</em> feature source gets its labels by two different ways:</p> <ul> <li>It tries to execute files found under <code class="language-plaintext highlighter-rouge notranslate">/etc/kubernetes/node-feature-discovery/source.d/</code> directory. The hook files must be executable and they are supposed to print all discovered features in <code class="language-plaintext highlighter-rouge notranslate">stdout</code>, one per line. With ELF binaries static linking is recommended as the selection of system libraries available in the NFD release image is very limited. Other runtimes currently supported by the NFD stock image are bash and perl.</li> <li>It reads files found under <code class="language-plaintext highlighter-rouge notranslate">/etc/kubernetes/node-feature-discovery/features.d/</code> directory. The file content is expected to be similar to the hook output (described above).</li> </ul> <p><strong>NOTE:</strong> The <a href="deployment-and-usage#minimal">minimal</a> image variant only supports running statically linked binaries.</p> <p>These directories must be available inside the Docker image so Volumes and VolumeMounts must be used if standard NFD images are used. The given template files mount by default the <code class="language-plaintext highlighter-rouge notranslate">source.d</code> and the <code class="language-plaintext highlighter-rouge notranslate">features.d</code> directories respectively from <code class="language-plaintext highlighter-rouge notranslate">/etc/kubernetes/node-feature-discovery/source.d/</code> and <code class="language-plaintext highlighter-rouge notranslate">/etc/kubernetes/node-feature-discovery/features.d/</code> from the host. You should update them to match your needs.</p> <p>In both cases, the labels can be binary or non binary, using either <code class="language-plaintext highlighter-rouge notranslate">&lt;name&gt;</code> or <code class="language-plaintext highlighter-rouge notranslate">&lt;name&gt;=&lt;value&gt;</code> format.</p> <p>Unlike the other feature sources, the name of the file, instead of the name of the feature source (that would be <code class="language-plaintext highlighter-rouge notranslate">local</code> in this case), is used as a prefix in the label name, normally. However, if the <code class="language-plaintext highlighter-rouge notranslate">&lt;name&gt;</code> of the label starts with a slash (<code class="language-plaintext highlighter-rouge notranslate">/</code>) it is used as the label
MY_FEATURE_2=myvalue
/override_source-OVERRIDE_BOOL
/override_source-OVERRIDE_VALUE=123
override.namespace/value=456
</code></pre> </div></div> <p>which, in turn, will translate into the following node labels:</p> <div class="language-plaintext highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code>feature.node.kubernetes.io/my-source-MY_FEATURE_1=true
feature.node.kubernetes.io/my-source-MY_FEATURE_2=myvalue
feature.node.kubernetes.io/override_source-OVERRIDE_BOOL=true
feature.node.kubernetes.io/override_source-OVERRIDE_VALUE=123
override.namespace/value=456
</code></pre> </div></div> <h4 id="a-file-example">A file example</h4> <p>User has a file <code class="language-plaintext highlighter-rouge notranslate">/etc/kubernetes/node-feature-discovery/features.d/my-source</code> which contains the following lines:</p> <div class="language-plaintext highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code>MY_FEATURE_1
MY_FEATURE_2=myvalue
/override_source-OVERRIDE_BOOL
/override_source-OVERRIDE_VALUE=123
override.namespace/value=456
</code></pre> </div></div> <p>which, in turn, will translate into the following node labels:</p> <div class="language-plaintext highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code>feature.node.kubernetes.io/my-source-MY_FEATURE_1=true
feature.node.kubernetes.io/my-source-MY_FEATURE_2=myvalue
feature.node.kubernetes.io/override_source-OVERRIDE_BOOL=true
feature.node.kubernetes.io/override_source-OVERRIDE_VALUE=123
override.namespace/value=456
</code></pre> </div></div> <p>NFD tries to run any regular files found from the hooks directory. Any additional data files your hook might need (e.g. a configuration file) should be placed in a separate directory in order to avoid NFD unnecessarily trying to execute these. You can use a subdirectory under the hooks directory, for example <code class="language-plaintext highlighter-rouge notranslate">/etc/kubernetes/node-feature-discovery/source.d/conf/</code>.</p> <p><strong>NOTE!</strong> NFD will blindly run any executables placed/mounted in the hooks directory. It is the user's responsibility to review the hooks for e.g. possible security implications.</p> <p><strong>NOTE!</strong> Be careful when creating and/or updating hook or feature files while NFD is running. In order to avoid race conditions you should write into a temporary file (outside the <code class="language-plaintext highlighter-rouge notranslate">source.d</code> and <code class="language-plaintext highlighter-rouge notranslate">features.d</code> directories), and, atomically create/update the original file by doing a filesystem move operation.</p> <h2 id="extended-resources">Extended resources</h2> <p>This feature is experimental and by no means a replacement for the usage of device plugins.</p> <p>Labels which have integer values, can be promoted to Kubernetes extended resources by listing them to the master <code class="language-plaintext highlighter-rouge notranslate">-resource-labels</code> command line flag. These labels won't then show in the node label section, they will appear only as extended resources.</p> <p>An example use-case for the extended resources could be based on a hook which creates a label for the node SGX EPC memory section size. By giving the name of that label in the <code class="language-plaintext highlighter-rouge notranslate">-resource-labels</code> flag, that value will then turn into an extended resource of the node, allowing PODs to request that resource and the Kubernetes scheduler to schedule such PODs to only those nodes which have a sufficient capacity of said resource left.</p> <p>Similar to labels, the default namespace <code class="language-plaintext highlighter-rouge notranslate">feature.node.kubernetes.io</code> is automatically prefixed to the extended resource, if the promoted label doesn't have a namespace.</p> <p>Example usage of the command line arguments, using a new namespace: <code class="language-plaintext highlighter-rouge notranslate">nfd-master -resource-labels=my_source-my.feature,sgx.some.ns/epc -extra-label-ns=sgx.some.ns</code></p> <p>The above would result in following extended resources provided that related labels exist:</p> <div class="language-plaintext highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code> sgx.some.ns/epc: &lt;label value&gt;
feature.node.kubernetes.io/my_source-my.feature: &lt;label value&gt;
</code></pre> </div></div> <!-- Links --> </div> </div> <div class="navigation-bottom d-flex flex-justify-between py-3" role="navigation" aria-label="footer navigation"> <div class="prev"><a href="/node-feature-discovery/v0.9/get-started/deployment-and-usage.html" class="btn" title="Deployment and usage" accesskey="p" rel="prev"> <i class="fa fa-arrow-circle-left"></i> Previous </a></div> <div class="next"><a href="/node-feature-discovery/v0.9/get-started/examples-and-demos.html" class="btn" title="Examples and demos" accesskey="n" rel="next"> Next <i class="fa fa-arrow-circle-right"></i> </a></div> </div><hr> <div class="copyright text-center text-gray" role="contentinfo"> <i class="fa fa-copyright"></i> <span class="time">2016-2022,</span> <a class="text-gray" href="https://github.com/kubernetes-sigs" rel="noreferrer" target="_blank">Kubernetes SIGs</a> Revision <a class="text-gray" href="https://github.com/kubernetes-sigs/node-feature-discovery/commit/" title="" rel="noreferrer" target="_blank"></a> <br> <div class="generator"> Built with <a href="https://jekyllrb.com" rel="noreferrer" target="_blank">Jekyll</a> using a <a href="https://github.com/rundocs/jekyll-rtd-theme" rel="noreferrer" target="_blank" title="remote theme: jekyll-rtd-theme v2.0.9">theme</a> provided by <a href="https://rundocs.io" rel="noreferrer" target="_blank">RunDocs</a>. </div> </div> </div> </div> <div class="addons-wrap d-flex flex-column overflow-y-auto"> <div class="status d-flex flex-justify-between p-2"> <div class="title p-1"> <i class="fa fa-book"></i> Node Feature Discovery </div> <div class="branch p-1"> <span class="name"> v0.9 </span> <i class="fa fa-caret-down"></i> </div> </div> <div class="addons d-flex flex-column height-full p-2 d-none"> <dl id="versions"> <dt>Versions</dt> <script src="/node-feature-discovery/versions.js"></script> <script> var dt = document.getElementById('versions'); var items = getVersionListItems(); for (var i=0; i < items.length; i++) { var dd = document.createElement('dd'); var a = dd.appendChild(document.createElement('a')); a.appendChild(document.createTextNode(items[i].name)); a.href = items[i].url; dt.appendChild(dd); } </script> </dl> <dl> <dt>GitHub</dt> <dd> <a href="https://github.com/kubernetes-sigs/node-feature-discovery" title="Stars: 397"> <i class="fa fa-github"></i> Homepage </a> </dd> <dd> <a href="https://github.com/kubernetes-sigs/node-feature-discovery/issues" title="Open issues: 29"> <i class="fa fa-question-circle-o"></i> Issues </a> </dd> <dd> <a href="https://github.com/kubernetes-sigs/node-feature-discovery/zipball/gh-pages" title="Size: 82543 Kb"> <i class="fa fa-download"></i> Download </a> </dd> </dl> <hr> <div class="license f6 pb-2"> The <a href="/node-feature-discovery/v0.9/">software</a> is under the terms of <a href="https://github.com/kubernetes-sigs/node-feature-discovery">Apache License 2.0</a>. </div> </div> </div> <script> window.ui = { title: "Node Feature Discovery", baseurl: "/node-feature-discovery/v0.9", i18n: { search_results: "Search Results", search_results_found: "Search finished, found # page(s) matching the search query.", search_results_not_found: "Your search did not match any documents, please make sure that all characters are spelled correctly!" } }; </script> <script src="https://cdn.jsdelivr.net/gh/rundocs/jekyll-rtd-theme@2.0.9/assets/js/jquery.min.js"></script><script src="https://cdn.jsdelivr.net/gh/rundocs/jekyll-rtd-theme@2.0.9/assets/js/theme.min.js"></script> </body> </html>