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/get-started/deployment-and-usage.html
Github Actions 0b95f230d6 Update documentation for v0.11
Auto-generated from v0.11.3-2-g591a5f28 by 'update-gh-pages.sh'
2023-04-18 16:28:49 +00:00

157 lines
No EOL
66 KiB
HTML
Raw Permalink 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.

<!DOCTYPE html> <html lang="en" dir="auto"> <head><meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5, user-scalable=no"> <meta name="description" content="Deployment and usage Table of contents Image variants Full Minimal Deployment options Operator Deployment with kustomize Deployment with Helm Build..."> <meta name="revised" content=""> <meta name="author" content="Kubernetes SIGs"> <meta name="generator" content="rundocs/jekyll-rtd-theme v2.0.10"><meta name="theme-color" content="#2980b9"> <title>Deployment and usage · Node Feature Discovery</title> <meta name="twitter:title" content="Deployment and usage · Node Feature Discovery"> <meta name="twitter:description" content="Deployment and usage Table of contents Image variants Full Minimal Deployment options Operator Deployment with kustomize Deployment with Helm Build..."> <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.11/get-started/deployment-and-usage.html"> <meta name="twitter:creator" content="@rundocs/jekyll-rtd-theme v2.0.10"> <meta property="og:title" content="Deployment and usage · Node Feature Discovery"> <meta property="og:description" content="Deployment and usage Table of contents Image variants Full Minimal Deployment options Operator Deployment with kustomize Deployment with Helm Build..."> <meta property="og:locale" content="en"> <meta property="og:url" content="https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/get-started/deployment-and-usage.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="2023-04-18T11:28:35-05:00"> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Article", "mainEntityOfPage": { "@type": "WebPage", "@id": "https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/get-started/deployment-and-usage.html" }, "headline": "Deployment and usage · Node Feature Discovery", "image": [], "author": { "@type": "Person", "name": "Kubernetes SIGs" }, "datePublished": "2016-07-23T00:07:52-05:00", "dateModified": "2023-04-18T11:28:35-05:00", "publisher": { "@type": "Organization", "name": "Kubernetes SIGs", "logo": { "@type": "ImageObject", "url": "https://avatars.githubusercontent.com/u/36015203?v=4" } }, "description": "Deployment and usage Table of contents Image variants Full Minimal Deployment options Operator Deployment with kustomize Deployment with Helm Build..." } </script> <link rel="dns-prefetch" href="https://cdn.jsdelivr.net"><link rel="prev" href="https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/get-started/quick-start.html"><link rel="next" href="https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/get-started/features.html"><link rel="canonical" href="https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/get-started/deployment-and-usage.html"><link rel="icon" type="image/svg+xml" href="/node-feature-discovery/v0.11/assets/images/favicon.svg"><link rel="icon" type="image/png" href="/node-feature-discovery/v0.11/assets/images/favicon-16x16.png" sizes="16x16"> <link rel="icon" type="image/png" href="/node-feature-discovery/v0.11/assets/images/favicon-32x32.png" sizes="32x32"> <link rel="icon" type="image/png" href="/node-feature-discovery/v0.11/assets/images/favicon-96x96.png" sizes="96x96"><link rel="mask-icon" href="/node-feature-discovery/v0.11/assets/images/favicon.svg" color="#2980b9"><link rel="apple-touch-icon" href="/node-feature-discovery/v0.11/assets/images/apple-touch-icon-300x300.jpg"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/rundocs/jekyll-rtd-theme@2.0.10/assets/css/theme.min.css"><style>@media (min-width: 1280px){.content-wrap{max-width:1200px}}</style><script> window.ui = { title: "Node Feature Discovery", baseurl: "/node-feature-discovery/v0.11", 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> </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 text-center"> <div class="title pb-1"> <a class="h4 no-underline py-1 px-2 rounded-1" href="/node-feature-discovery/v0.11/" title="Documentation of Node Feature Discovery - a Kubernetes add-on for discovering and advertising hardware features and system configuration in the cluster."> <i class="fa fa-home"></i> Node Feature Discovery </a> </div> <span class="version">v0.11.3</span> <form class="search pt-2" action="/node-feature-discovery/v0.11/search.html" method="get" autocomplete="off"> <input class="form-control input-block input-sm" type="text" name="q" placeholder="Search docs..."> </form> </div> <div class="toctree py-2" data-spy="affix" role="navigation" aria-label="main navigation"> <ul> </ul> <a class="caption d-block text-uppercase no-wrap px-2 py-0" href="/node-feature-discovery/v0.11/get-started/"> Get started </a><ul> <li class="toc level-1 " data-sort="1" data-level="1"> <a class="d-flex flex-items-baseline " href="/node-feature-discovery/v0.11/get-started/introduction.html">1. Introduction</a> </li> <li class="toc level-1 " data-sort="2" data-level="1"> <a class="d-flex flex-items-baseline " href="/node-feature-discovery/v0.11/get-started/quick-start.html">2. Quick start</a> </li> <li class="toc level-1 current" data-sort="3" data-level="1"> <a class="d-flex flex-items-baseline current" href="/node-feature-discovery/v0.11/get-started/deployment-and-usage.html">3. Deployment and usage</a> </li> <li class="toc level-1 " data-sort="4" data-level="1"> <a class="d-flex flex-items-baseline " href="/node-feature-discovery/v0.11/get-started/features.html">4. Feature labels</a> </li> <li class="toc level-1 " data-sort="5" data-level="1"> <a class="d-flex flex-items-baseline " href="/node-feature-discovery/v0.11/get-started/examples-and-demos.html">5. Examples and demos</a> </li></ul> <a class="caption d-block text-uppercase no-wrap px-2 py-0" href="/node-feature-discovery/v0.11/advanced/"> Advanced </a><ul> <li class="toc level-1 " data-sort="1" data-level="1"> <a class="d-flex flex-items-baseline " href="/node-feature-discovery/v0.11/advanced/developer-guide.html">1. Developer guide</a> </li> <li class="toc level-1 " data-sort="2" data-level="1"> <a class="d-flex flex-items-baseline " href="/node-feature-discovery/v0.11/advanced/master-commandline-reference.html">2. Master cmdline reference</a> </li> <li class="toc level-1 " data-sort="3" data-level="1"> <a class="d-flex flex-items-baseline " href="/node-feature-discovery/v0.11/advanced/worker-commandline-reference.html">3. Worker cmdline reference</a> </li> <li class="toc level-1 " data-sort="4" data-level="1"> <a class="d-flex flex-items-baseline " href="/node-feature-discovery/v0.11/advanced/worker-configuration-reference.html">4. Worker config reference</a> </li> <li class="toc level-1 " data-sort="5" data-level="1"> <a class="d-flex flex-items-baseline " href="/node-feature-discovery/v0.11/advanced/topology-updater-commandline-reference.html">5. Topology Updater Cmdline Reference</a> </li> <li class="toc level-1 " data-sort="5" data-level="1"> <a class="d-flex flex-items-baseline " href="/node-feature-discovery/v0.11/advanced/customization-guide.html">5. Customization guide</a> </li></ul> <a class="caption d-block text-uppercase no-wrap px-2 py-0" href="/node-feature-discovery/v0.11/contributing/"> Contributing </a><ul> </ul> </div> </div> </div> <div class="content-wrap"> <div class="header d-flex flex-justify-between p-2 hide-lg hide-xl" aria-label="top navigation"> <button id="toggle" aria-label="Toggle menu" class="btn-octicon p-2 m-0 text-white" type="button"> <i class="fa fa-bars"></i> </button> <div class="title flex-1 d-flex flex-justify-center"> <a class="h4 no-underline py-1 px-2 rounded-1" href="/node-feature-discovery/v0.11/">Node Feature Discovery</a> </div> </div> <div class="bg-red-2"> <div class="content p-3 px-sm-5"> This documentation is for Node Feature Discovery version that is no longer supported. Please upgrade and visit the <a class="no-underline" href="/node-feature-discovery/stable">documentation of the latest stable release</a>. </div> </div> <div class="content p-3 p-sm-5"> <div class="navigation-top d-flex flex-justify-between"> <ul class="breadcrumb" role="navigation" aria-label="breadcrumbs navigation"> <li class="breadcrumb-item"> <a class="no-underline" href="/node-feature-discovery/v0.11/" title="/"> <i class="fa fa-home"></i> </a> </li><li class="breadcrumb-item" ><a href="/node-feature-discovery/v0.11/get-started/">get-started</a></li><li class="breadcrumb-item" aria-current="page">deployment-and-usage.md</li></ul> <a class="edit" href="https://github.com/kubernetes-sigs/node-feature-discovery/edit/gh-pages/get-started/deployment-and-usage.md" title="Edit on GitHub" rel="noreferrer" target="_blank"> <i class="fa fa-edit"></i> </a> </div> <hr> <div role="main" itemscope="itemscope" itemtype="https://schema.org/Article"> <div class="markdown-body" itemprop="articleBody"> <h1 class="no_toc" id="deployment-and-usage">Deployment and usage</h1> <h2 class="no_toc text-delta" id="table-of-contents">Table of contents</h2> <ol id="markdown-toc"> <li><a href="#image-variants" id="markdown-toc-image-variants">Image variants</a> <ol> <li><a href="#full" id="markdown-toc-full">Full</a></li> <li><a href="#minimal" id="markdown-toc-minimal">Minimal</a></li> </ol> </li> <li><a href="#deployment-options" id="markdown-toc-deployment-options">Deployment options</a> <ol> <li><a href="#operator" id="markdown-toc-operator">Operator</a></li> <li><a href="#deployment-with-kustomize" id="markdown-toc-deployment-with-kustomize">Deployment with kustomize</a></li> <li><a href="#deployment-with-helm" id="markdown-toc-deployment-with-helm">Deployment with Helm</a></li> <li><a href="#build-your-own" id="markdown-toc-build-your-own">Build your own</a></li> </ol> </li> <li><a href="#usage" id="markdown-toc-usage">Usage</a> <ol> <li><a href="#nfd-master" id="markdown-toc-nfd-master">NFD-Master</a></li> <li><a href="#nfd-worker" id="markdown-toc-nfd-worker">NFD-Worker</a></li> <li><a href="#nfd-topology-updater" id="markdown-toc-nfd-topology-updater">NFD-Topology-Updater</a></li> <li><a href="#communication-security-with-tls" id="markdown-toc-communication-security-with-tls">Communication security with TLS</a></li> </ol> </li> <li><a href="#worker-configuration" id="markdown-toc-worker-configuration">Worker configuration</a></li> <li><a href="#using-node-labels" id="markdown-toc-using-node-labels">Using node labels</a></li> <li><a href="#uninstallation" id="markdown-toc-uninstallation">Uninstallation</a> <ol> <li><a href="#operator-was-used-for-deployment" id="markdown-toc-operator-was-used-for-deployment">Operator was used for deployment</a></li> <li><a href="#manual" id="markdown-toc-manual">Manual</a></li> <li><a href="#removing-feature-labels" id="markdown-toc-removing-feature-labels">Removing feature labels</a></li> </ol> </li> </ol> <hr /> <h2 id="image-variants">Image variants</h2> <p>NFD currently offers two variants of the container image. The "full" variant is currently deployed by default. Released container images are available for x86_64 and Arm64 architectures.</p> <h3 id="full">Full</h3> <p>This image is based on <a href="https://hub.docker.com/_/debian">debian:buster-slim</a> and contains a full Linux system for running shell-based nfd-worker hooks and doing live debugging and diagnosis of the NFD images.</p> <h3 id="minimal">Minimal</h3> <p>This is a minimal image based on <a href="https://github.com/GoogleContainerTools/distroless/blob/master/base/README.md">gcr.io/distroless/base</a> and only supports running statically linked binaries.</p> <p>The container image tag has suffix <code class="language-plaintext highlighter-rouge notranslate">-minimal</code> (e.g. <code class="language-plaintext highlighter-rouge notranslate">k8s.gcr.io/nfd/node-feature-discovery:v0.11.3-minimal</code>)</p> <h2 id="deployment-options">Deployment options</h2> <h3 id="operator">Operator</h3> <p>Deployment using the <a href="https://github.com/kubernetes-sigs/node-feature-discovery-operator">Node Feature Discovery Operator</a> is recommended to be done via <a href="https://operatorhub.io/operator/nfd-operator">operatorhub.io</a>.</p> <ol> <li>You need to have <a href="https://github.com/operator-framework/operator-lifecycle-manager">OLM</a> installed. If you don't, take a look at the <a href="https://github.com/operator-framework/operator-lifecycle-manager/releases/latest">latest release</a> for detailed instructions.</li> <li> <p>Install the operator:</p> <div class="language-bash highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code>kubectl create <span class="nt">-f</span> https://operatorhub.io/install/nfd-operator.yaml
</code></pre> </div> </div> </li> <li> <p>Create <code class="language-plaintext highlighter-rouge notranslate">NodeFeatureDiscovery</code> object (in <code class="language-plaintext highlighter-rouge notranslate">nfd</code> namespace here):</p> <div class="language-bash highlighter-rouge notranslate"><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 -
apiVersion: v1
kind: Namespace
metadata:
name: nfd
---
apiVersion: nfd.kubernetes.io/v1
kind: NodeFeatureDiscovery
metadata:
name: my-nfd-deployment
namespace: nfd
spec:
operand:
image: k8s.gcr.io/nfd/node-feature-discovery:v0.11.3
imagePullPolicy: IfNotPresent
</span><span class="no">EOF
</span></code></pre> </div> </div> </li> </ol> <p>In order to deploy the <a href="#minimal">minimal</a> image you need to use</p> <div class="language-yaml highlighter-rouge notranslate"><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>
</code></pre> </div></div> <p>in the <code class="language-plaintext highlighter-rouge notranslate">NodeFeatureDiscovery</code> object above.</p> <h3 id="deployment-with-kustomize">Deployment with kustomize</h3> <p>This requires <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl">kubectl</a> v1.21 or later. The kustomize overlays provided in the repo can be used directly:</p> <div class="language-bash highlighter-rouge notranslate"><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
</code></pre> </div></div> <p>This will required RBAC rules and deploy nfd-master (as a deployment) and nfd-worker (as daemonset) in the <code class="language-plaintext highlighter-rouge notranslate">node-feature-discovery</code> namespace.</p> <p><strong>NOTE:</strong> nfd-topology-updater is not deployed as part of the <code class="language-plaintext highlighter-rouge notranslate">default</code> overlay. Please refer to the <a href="#master-worker-topologyupdater">Master Worker Topologyupdater</a> and <a href="#topology-updater">Topologyupdater</a> below.</p> <p>Alternatively you can clone the repository and customize the deployment by creating your own overlays. For example, to deploy the <a href="#minimal">minimal</a> image. See <a href="https://github.com/kubernetes-sigs/kustomize">kustomize</a> for more information about managing deployment configurations.</p> <h4 id="default-overlays">Default overlays</h4> <p>The NFD repository hosts a set of overlays for different usages and deployment scenarios under <a href="https://github.com/kubernetes-sigs/node-feature-discovery/blob/v0.11.3/deployment/overlays"><code class="language-plaintext highlighter-rouge notranslate">deployment/overlays</code></a></p> <ul> <li><a href="https://github.com/kubernetes-sigs/node-feature-discovery/blob/v0.11.3/deployment/overlays/default"><code class="language-plaintext highlighter-rouge notranslate">default</code></a>: default deployment of nfd-worker as a daemonset, described above</li> <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 notranslate">default-combined</code></a> see <a href="#master-worker-pod">Master-worker pod</a> below</li> <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 notranslate">default-job</code></a>: see <a href="#worker-one-shot">Worker one-shot</a> below</li> <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 notranslate">master-worker-topologyupdater</code></a>: see <a href="#master-worker-topologyupdater">Master Worker Topologyupdater</a> below</li> <li><a href="https://github.com/kubernetes-sigs/node-feature-discovery/blob/v0.11.3/deployment/overlays/topologyupdater"><code class="language-plaintext highlighter-rouge notranslate">topologyupdater</code></a>: see <a href="#topology-updater">Topology Updater</a> below</li> <li><a href="https://github.com/kubernetes-sigs/node-feature-discovery/blob/v0.11.3/deployment/overlays/prune"><code class="language-plaintext highlighter-rouge notranslate">prune</code></a>: clean up the cluster after uninstallation, see <a href="#removing-feature-labels">Removing feature labels</a></li> <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 notranslate">samples/cert-manager</code></a>: an example for supplementing the default deployment with cert-manager for TLS authentication, see <a href="#automated-tls-certificate-management-using-cert-manager">Automated TLS certificate management using cert-manager</a> for details</li> <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 notranslate">samples/custom-rules</code></a>: an example for spicing up the default deployment with a separately managed configmap of custom labeling rules, see <a href="#features.md#custom">Custom feature source</a> for more information about custom node labels</li> </ul> <h4 id="master-worker-pod">Master-worker pod</h4> <p>You can also run nfd-master and nfd-worker inside the same pod</p> <div class="language-bash highlighter-rouge notranslate"><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
</code></pre> </div></div> <p>This creates a DaemonSet that runs nfd-worker and nfd-master in the same Pod. In this case no nfd-master is run on the master node(s), but, the worker nodes are able to label themselves which may be desirable e.g. in single-node setups.</p> <p><strong>NOTE:</strong> nfd-topology-updater is not deployed by the default-combined overlay. To enable nfd-topology-updater in this scenario,the users must customize the deployment themselves.</p> <h4 id="worker-one-shot">Worker one-shot</h4> <p>Feature discovery can alternatively be configured as a one-shot job. The <code class="language-plaintext highlighter-rouge notranslate">default-job</code> overlay may be used to achieve this:</p> <div class="language-bash highlighter-rouge notranslate"><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>
kubectl 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>
<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>
kubectl apply <span class="nt">-f</span> -
</code></pre> </div></div> <p>The example above launches as many jobs as there are non-master nodes. Note that this approach does not guarantee running once on every node. For example, tainted, non-ready nodes or some other reasons in Job scheduling may cause some node(s) will run extra job instance(s) to satisfy the request.</p> <h4 id="master-worker-topologyupdater">Master Worker Topologyupdater</h4> <p>NFD Master, NFD worker and NFD Topologyupdater can be configured to be deployed as separate pods. The <code class="language-plaintext highlighter-rouge notranslate">master-worker-topologyupdater</code> overlay may be used to achieve this:</p> <div class="language-bash highlighter-rouge notranslate"><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
</code></pre> </div></div> <h4 id="topologyupdater">Topologyupdater</h4> <p>In order to deploy just NFD master and NFD Topologyupdater (without nfd-worker) use the <code class="language-plaintext highlighter-rouge notranslate">topologyupdater</code> overlay:</p> <div class="language-bash highlighter-rouge notranslate"><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
</code></pre> </div></div> <p>NFD Topologyupdater can be configured along with the <code class="language-plaintext highlighter-rouge notranslate">default</code> overlay (which deploys NFD worker and NFD master) where all the software components are deployed as separate pods. The <code class="language-plaintext highlighter-rouge notranslate">topologyupdater</code> overlay may be used along with <code class="language-plaintext highlighter-rouge notranslate">default</code> overlay to achieve this:</p> <div class="language-bash highlighter-rouge notranslate"><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
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
</code></pre> </div></div> <h3 id="deployment-with-helm">Deployment with Helm</h3> <p>Node Feature Discovery Helm chart allow to easily deploy and manage NFD.</p> <h4 id="prerequisites">Prerequisites</h4> <p><a href="https://helm.sh/">Helm package manager</a> should be installed.</p> <h4 id="deployment">Deployment</h4> <p>To install the latest stable version:</p> <div class="language-bash highlighter-rouge notranslate"><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
helm repo add nfd https://kubernetes-sigs.github.io/node-feature-discovery/charts
helm repo update
helm <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>
</code></pre> </div></div> <p>To install the latest development version you need to clone the NFD Git repository and install from there.</p> <div class="language-bash highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/kubernetes-sigs/node-feature-discovery/
<span class="nb">cd </span>node-feature-discovery/deployment/helm
<span class="nb">export </span><span class="nv">NFD_NS</span><span class="o">=</span>node-feature-discovery
helm <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>
</code></pre> </div></div> <p>See the <a href="#configuration">configuration</a> section below for instructions how to alter the deployment parameters.</p> <p>In order to deploy the <a href="#minimal">minimal</a> image you need to override the image tag:</p> <div class="language-bash highlighter-rouge notranslate"><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>
</code></pre> </div></div> <h4 id="configuration">Configuration</h4> <p>You can override values from <code class="language-plaintext highlighter-rouge notranslate">values.yaml</code> and provide a file with custom values:</p> <div class="language-bash highlighter-rouge notranslate"><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
helm <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>
</code></pre> </div></div> <p>To specify each parameter separately you can provide them to helm install command:</p> <div class="language-bash highlighter-rouge notranslate"><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
helm <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>
</code></pre> </div></div> <h4 id="uninstalling-the-chart">Uninstalling the chart</h4> <p>To uninstall the <code class="language-plaintext highlighter-rouge notranslate">node-feature-discovery</code> deployment:</p> <div class="language-bash highlighter-rouge notranslate"><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
helm uninstall node-feature-discovery <span class="nt">--namespace</span> <span class="nv">$NFD_NS</span>
</code></pre> </div></div> <p>The command removes all the Kubernetes components associated with the chart and deletes the release.</p> <h4 id="chart-parameters">Chart parameters</h4> <p>In order to tailor the deployment of the Node Feature Discovery to your cluster needs We have introduced the following Chart parameters.</p> <h5 id="general-parameters">General parameters</h5> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Default</th> <th>description</th> </tr> </thead> <tbody> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">image.repository</code></td> <td>string</td> <td><code class="language-plaintext highlighter-rouge notranslate">k8s.gcr.io/nfd/node-feature-discovery</code></td> <td>NFD image repository</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">image.tag</code></td> <td>string</td> <td><code class="language-plaintext highlighter-rouge notranslate">v0.11.3</code></td> <td>NFD image tag</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">image.pullPolicy</code></td> <td>string</td> <td><code class="language-plaintext highlighter-rouge notranslate">Always</code></td> <td>Image pull policy</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">imagePullSecrets</code></td> <td>list</td> <td>[]</td> <td>ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. <a href="https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod">More info</a></td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">nameOverride</code></td> <td>string</td> <td> </td> <td>Override the name of the chart</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">fullnameOverride</code></td> <td>string</td> <td> </td> <td>Override a default fully qualified app name</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">nodeFeatureRule.createCRD</code></td> <td>bool</td> <td>true</td> <td>Specifies whether to create the NodeFeatureRule CRD</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">tls.enable</code></td> <td>bool</td> <td>false</td> <td>Specifies whether to use TLS for communications between components</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">tls.certManager</code></td> <td>bool</td> <td>false</td> <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> </tr> </tbody> </table> <h5 id="master-pod-parameters">Master pod parameters</h5> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Default</th> <th>description</th> </tr> </thead> <tbody> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">master.*</code></td> <td>dict</td> <td> </td> <td>NFD master deployment configuration</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">master.instance</code></td> <td>string</td> <td> </td> <td>Instance name. Used to separate annotation namespaces for multiple parallel deployments</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">master.extraLabelNs</code></td> <td>array</td> <td>[]</td> <td>List of allowed extra label namespaces</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">master.resourceLabels</code></td> <td>array</td> <td>[]</td> <td>List of labels to be registered as extended resources</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">master.featureRulesController</code></td> <td>bool</td> <td>null</td> <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 notranslate">master.instance</code> is empty.</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">master.replicaCount</code></td> <td>integer</td> <td>1</td> <td>Number of desired pods. This is a pointer to distinguish between explicit zero and not specified</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">master.podSecurityContext</code></td> <td>dict</td> <td>{}</td> <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> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">master.securityContext</code></td> <td>dict</td> <td>{}</td> <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> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">master.serviceAccount.create</code></td> <td>bool</td> <td>true</td> <td>Specifies whether a service account should be created</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">master.serviceAccount.annotations</code></td> <td>dict</td> <td>{}</td> <td>Annotations to add to the service account</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">master.serviceAccount.name</code></td> <td>string</td> <td> </td> <td>The name of the service account to use. If not set and create is true, a name is generated using the fullname template</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">master.rbac.create</code></td> <td>bool</td> <td>true</td> <td>Specifies whether to create <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/">RBAC</a> configuration for nfd-master</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">master.service.type</code></td> <td>string</td> <td>ClusterIP</td> <td>NFD master service type</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">master.service.port</code></td> <td>integer</td> <td>8080</td> <td>NFD master service port</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">master.resources</code></td> <td>dict</td> <td>{}</td> <td>NFD master pod <a href="https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/">resources management</a></td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">master.nodeSelector</code></td> <td>dict</td> <td>{}</td> <td>NFD master pod <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector">node selector</a></td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">master.tolerations</code></td> <td>dict</td> <td><em>Scheduling to master node is disabled</em></td> <td>NFD master pod <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/">tolerations</a></td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">master.annotations</code></td> <td>dict</td> <td>{}</td> <td>NFD master pod <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/">annotations</a></td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">master.affinity</code></td> <td>dict</td> <td> </td> <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> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">master.deploymentAnnotations</code></td> <td>dict</td> <td>{}</td> <td>NFD master deployment <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/">annotations</a></td> </tr> </tbody> </table> <h5 id="worker-pod-parameters">Worker pod parameters</h5> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Default</th> <th>description</th> </tr> </thead> <tbody> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">worker.*</code></td> <td>dict</td> <td> </td> <td>NFD worker daemonset configuration</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">worker.config</code></td> <td>dict</td> <td> </td> <td>NFD worker <a href="/node-feature-discovery/v0.11/advanced/worker-configuration-reference.html">configuration</a></td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">worker.podSecurityContext</code></td> <td>dict</td> <td>{}</td> <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> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">worker.securityContext</code></td> <td>dict</td> <td>{}</td> <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> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">worker.mountUsrSrc</code></td> <td>bool</td> <td>false</td> <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> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">worker.resources</code></td> <td>dict</td> <td>{}</td> <td>NFD worker pod <a href="https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/">resources management</a></td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">worker.nodeSelector</code></td> <td>dict</td> <td>{}</td> <td>NFD worker pod <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector">node selector</a></td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">worker.tolerations</code></td> <td>dict</td> <td>{}</td> <td>NFD worker pod <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/">node tolerations</a></td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">worker.annotations</code></td> <td>dict</td> <td>{}</td> <td>NFD worker pod <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/">annotations</a></td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">worker.daemonsetAnnotations</code></td> <td>dict</td> <td>{}</td> <td>NFD worker daemonset <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/">annotations</a></td> </tr> </tbody> </table> <h5 id="topology-updater-parameters">Topology updater parameters</h5> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Default</th> <th>description</th> </tr> </thead> <tbody> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">topologyUpdater.*</code></td> <td>dict</td> <td> </td> <td>NFD Topology Updater configuration</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">topologyUpdater.enable</code></td> <td>bool</td> <td>false</td> <td>Specifies whether the NFD Topology Updater should be created</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">topologyUpdater.createCRDs</code></td> <td>bool</td> <td>false</td> <td>Specifies whether the NFD Topology Updater CRDs should be created</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">topologyUpdater.serviceAccount.create</code></td> <td>bool</td> <td>true</td> <td>Specifies whether the service account for topology updater should be created</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">topologyUpdater.serviceAccount.annotations</code></td> <td>dict</td> <td>{}</td> <td>Annotations to add to the service account for topology updater</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">topologyUpdater.serviceAccount.name</code></td> <td>string</td> <td> </td> <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 notranslate">-topology-updater</code> suffix</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">topologyUpdater.rbac</code></td> <td>dict</td> <td> </td> <td>RBAC <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/">parameters</a> for the topology updater</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">topologyUpdater.rbac.create</code></td> <td>bool</td> <td>false</td> <td>Specifies whether the cluster role and binding for topology updater should be created</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">topologyUpdater.kubeletConfigPath</code></td> <td>string</td> <td>""</td> <td>Specifies the kubelet config host path</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">topologyUpdater.kubeletPodResourcesSockPath</code></td> <td>string</td> <td>""</td> <td>Specifies the kubelet sock path to read pod resources</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">topologyUpdater.updateInterval</code></td> <td>string</td> <td>60s</td> <td>Time to sleep between CR updates. Non-positive value implies no CR update.</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">topologyUpdater.watchNamespace</code></td> <td>string</td> <td><code class="language-plaintext highlighter-rouge notranslate">*</code></td> <td>Namespace to watch pods, <code class="language-plaintext highlighter-rouge notranslate">*</code> for all namespaces</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">topologyUpdater.podSecurityContext</code></td> <td>dict</td> <td>{}</td> <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> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">topologyUpdater.securityContext</code></td> <td>dict</td> <td>{}</td> <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> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">topologyUpdater.resources</code></td> <td>dict</td> <td>{}</td> <td>Topology updater pod <a href="https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/">resources management</a></td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">topologyUpdater.nodeSelector</code></td> <td>dict</td> <td>{}</td> <td>Topology updater pod <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector">node selector</a></td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">topologyUpdater.tolerations</code></td> <td>dict</td> <td>{}</td> <td>Topology updater pod <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/">node tolerations</a></td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">topologyUpdater.annotations</code></td> <td>dict</td> <td>{}</td> <td>Topology updater pod <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/">annotations</a></td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge notranslate">topologyUpdater.affinity</code></td> <td>dict</td> <td>{}</td> <td>Topology updater pod <a href="https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/">affinity</a></td> </tr> </tbody> </table> <h3 id="build-your-own">Build your own</h3> <p>If you want to use the latest development version (master branch) you need to build your own custom image. See the <a href="../advanced/developer-guide">Developer Guide</a> for instructions how to build images and deploy them on your cluster.</p> <h2 id="usage">Usage</h2> <h3 id="nfd-master">NFD-Master</h3> <p>NFD-Master runs as a deployment (with a replica count of 1), by default it prefers running on the cluster's master nodes but will run on worker nodes if no master nodes are found.</p> <p>For High Availability, you should simply increase the replica count of the deployment object. You should also look into adding <a href="https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity">inter-pod</a> affinity to prevent masters from running on the same node. However note that inter-pod affinity is costly and is not recommended in bigger clusters.</p> <p>NFD-Master listens for connections from nfd-worker(s) and connects to the Kubernetes API server to add node labels advertised by them.</p> <p>If you have RBAC authorization enabled (as is the default e.g. with clusters initialized with kubeadm) you need to configure the appropriate ClusterRoles, ClusterRoleBindings and a ServiceAccount in order for NFD to create node labels. The provided template will configure these for you.</p> <h3 id="nfd-worker">NFD-Worker</h3> <p>NFD-Worker is preferably run as a Kubernetes DaemonSet. This assures re-labeling on regular intervals capturing changes in the system configuration and makes sure that new nodes are labeled as they are added to the cluster. Worker connects to the nfd-master service to advertise hardware features.</p> <p>When run as a daemonset, nodes are re-labeled at an default interval of 60s. This can be changed by using the <a href="../advanced/worker-configuration-reference.html#coresleepinterval"><code class="language-plaintext highlighter-rouge notranslate">core.sleepInterval</code></a> config option (or <a href="../advanced/worker-commandline-reference.html#-sleep-interval"><code class="language-plaintext highlighter-rouge notranslate">-sleep-interval</code></a> command line flag).</p> <p>The worker configuration file is watched and re-read on every change which provides a simple mechanism of dynamic run-time reconfiguration. See <a href="#worker-configuration">worker configuration</a> for more details.</p> <h3 id="nfd-topology-updater">NFD-Topology-Updater</h3> <p>NFD-Topology-Updater is preferably run as a Kubernetes DaemonSet. This assures re-examination (and CR updates) on regular intervals capturing changes in the allocated resources and hence the allocatable resources on a per zone basis. It makes sure that more CR instances are created as new nodes get added to the cluster. Topology-Updater connects to the nfd-master service to create CR instances corresponding to nodes.</p> <p>When run as a daemonset, nodes are re-examined for the allocated resources (to determine the information of the allocatable resources on a per zone basis where a zone can be a NUMA node) at an interval specified using the <code class="language-plaintext highlighter-rouge notranslate">-sleep-interval</code> option. The default sleep interval is set to 60s which is the the value when no -sleep-interval is specified.</p> <h3 id="communication-security-with-tls">Communication security with TLS</h3> <p>NFD supports mutual TLS authentication between the nfd-master and nfd-worker instances. That is, nfd-worker and nfd-master both verify that the other end presents a valid certificate.</p> <p>TLS authentication is enabled by specifying <code class="language-plaintext highlighter-rouge notranslate">-ca-file</code>, <code class="language-plaintext highlighter-rouge notranslate">-key-file</code> and <code class="language-plaintext highlighter-rouge notranslate">-cert-file</code> args, on both the nfd-master and nfd-worker instances. The template specs provided with NFD contain (commented out) example configuration for enabling TLS authentication.</p> <p>The Common Name (CN) of the nfd-master certificate must match the DNS name of the nfd-master Service of the cluster. By default, nfd-master only check that the nfd-worker has been signed by the specified root certificate (-ca-file).</p> <p>Additional hardening can be enabled by specifying <code class="language-plaintext highlighter-rouge notranslate">-verify-node-name</code> in nfd-master args, in which case nfd-master verifies that the NodeName presented by nfd-worker matches the Common Name (CN) or a Subject Alternative Name (SAN) of its certificate. Note that <code class="language-plaintext highlighter-rouge notranslate">-verify-node-name</code> complicates certificate management and is not yet supported in the helm or kustomize deployment methods.</p> <h4 id="automated-tls-certificate-management-using-cert-manager">Automated TLS certificate management using cert-manager</h4> <p><a href="https://cert-manager.io/">cert-manager</a> can be used to automate certificate management between nfd-master and the nfd-worker pods.</p> <p>The NFD source code repository contains an example kustomize overlay and helm chart that can be used to deploy NFD with cert-manager supplied certificates enabled.</p> <p>To install <code class="language-plaintext highlighter-rouge notranslate">cert-manager</code> itself can be done as easily as this, below, or you can refer to their documentation for other installation methods such as the helm chart they provide.</p> <div class="language-bash highlighter-rouge notranslate"><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
</code></pre> </div></div> <p>To use the kustomize overlay to install node-feature-discovery with TLS enabled, you may use the following:</p> <div class="language-bash highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code>kubectl apply <span class="nt">-k</span> deployment/overlays/samples/cert-manager
</code></pre> </div></div> <p>To make use of the helm chart, override <code class="language-plaintext highlighter-rouge notranslate">values.yaml</code> to enable both the <code class="language-plaintext highlighter-rouge notranslate">tls.enabled</code> and <code class="language-plaintext highlighter-rouge notranslate">tls.certManager</code> options. Note that if you do not enable <code class="language-plaintext highlighter-rouge notranslate">tls.certManager</code>, helm will successfully install the application, but deployment will wait until certificates are manually created, as demonstrated below.</p> <p>See the sample installation commands in the Helm <a href="#deployment">Deployment</a> and <a href="#configuration">Configuration</a> sections above for how to either override individual values, or provide a yaml file with which to override default values.</p> <h4 id="manual-tls-certificate-management">Manual TLS certificate management</h4> <p>If you do not with to make use of cert-manager, the certificates can be manually created and stored as secrets within the NFD namespace.</p> <p>Create a CA certificate</p> <div class="language-bash highlighter-rouge notranslate"><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>
<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
</code></pre> </div></div> <p>Create a common openssl config file.</p> <div class="language-bash highlighter-rouge notranslate"><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
[ req ]
default_bits = 4096
prompt = no
default_md = sha256
req_extensions = req_ext
distinguished_name = dn
[ dn ]
C = XX
ST = some-state
L = some-city
O = some-company
OU = node-feature-discovery
[ req_ext ]
subjectAltName = @alt_names
[ v3_ext ]
authorityKeyIdentifier=keyid,issuer:always
basicConstraints=CA:FALSE
keyUsage=keyEncipherment,dataEncipherment
extendedKeyUsage=serverAuth,clientAuth
subjectAltName=@alt_names
</span><span class="no">EOF
</span></code></pre> </div></div> <p>Now, create the nfd-master certificate.</p> <div class="language-bash highlighter-rouge notranslate"><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
.include nfd-common.conf
[ dn ]
CN = nfd-master
[ alt_names ]
DNS.1 = nfd-master
DNS.2 = nfd-master.node-feature-discovery.svc.cluster.local
DNS.3 = localhost
</span><span class="no">EOF
</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
</code></pre> </div></div> <p>Create certificates for nfd-worker and nfd-topology-updater</p> <div class="language-bash highlighter-rouge notranslate"><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
.include nfd-common.conf
[ dn ]
CN = nfd-worker
[ alt_names ]
DNS.1 = nfd-worker
DNS.2 = nfd-worker.node-feature-discovery.svc.cluster.local
</span><span class="no">EOF
</span><span class="c"># Config for topology updater is identical except for the DN and alt_names</span>
<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
openssl 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
openssl 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
</code></pre> </div></div> <p>Now, sign the certificates with the CA created earlier.</p> <div class="language-bash highlighter-rouge notranslate"><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
</span><span class="nb">echo </span>signing <span class="nv">$cert</span>
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>
<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>
<span class="nt">-extensions</span> v3_ext <span class="nt">-extfile</span> <span class="nv">$cert</span>.conf
<span class="k">done</span>
</code></pre> </div></div> <p>Finally, turn these certificates into secrets.</p> <div class="language-bash highlighter-rouge notranslate"><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
</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
<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 -
---
apiVersion: v1
kind: Secret
type: kubernetes.io/tls
metadata:
name: </span><span class="k">${</span><span class="nv">cert</span><span class="k">}</span><span class="sh">-cert
data:
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">
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">
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">
</span><span class="no">EOF
</span><span class="k">done</span>
</code></pre> </div></div> <h2 id="worker-configuration">Worker configuration</h2> <p>NFD-Worker supports dynamic configuration through a configuration file. The default location is <code class="language-plaintext highlighter-rouge notranslate">/etc/kubernetes/node-feature-discovery/nfd-worker.conf</code>, but, this can be changed by specifying the<code class="language-plaintext highlighter-rouge notranslate">-config</code> command line flag. Configuration file is re-read whenever it is modified which makes run-time re-configuration of nfd-worker straightforward.</p> <p>Worker configuration file is read inside the container, and thus, Volumes and VolumeMounts are needed to make your configuration available for NFD. The preferred method is to use a ConfigMap which provides easy deployment and re-configurability.</p> <p>The provided nfd-worker deployment templates create an empty configmap and mount it inside the nfd-worker containers. In kustomize deployments, configuration can be edited with:</p> <div class="language-bash highlighter-rouge notranslate"><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
</code></pre> </div></div> <p>In Helm deployments, <a href="#worker-pod-parameters">Worker pod parameter</a> <code class="language-plaintext highlighter-rouge notranslate">worker.config</code> can be used to edit the respective configuration.</p> <p>See <a href="/node-feature-discovery/v0.11/advanced/worker-configuration-reference.html">nfd-worker configuration file reference</a> for more details. The (empty-by-default) <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> contains all available configuration options and can be used as a reference for creating creating a configuration.</p> <p>Configuration options can also be specified via the <code class="language-plaintext highlighter-rouge notranslate">-options</code> command line flag, in which case no mounts need to be used. The same format as in the config file must be used, i.e. JSON (or YAML). For example:</p> <div class="language-bash highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code><span class="nt">-options</span><span class="o">=</span><span class="s1">'{"sources": { "pci": { "deviceClassWhitelist": ["12"] } } }'</span>
</code></pre> </div></div> <p>Configuration options specified from the command line will override those read from the config file.</p> <h2 id="using-node-labels">Using node labels</h2> <p>Nodes with specific features can be targeted using the <code class="language-plaintext highlighter-rouge notranslate">nodeSelector</code> field. The following example shows how to target nodes with Intel TurboBoost enabled.</p> <div class="language-yaml highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code><span class="na">apiVersion</span><span class="pi">:</span> <span class="s">v1</span>
<span class="na">kind</span><span class="pi">:</span> <span class="s">Pod</span>
<span class="na">metadata</span><span class="pi">:</span>
<span class="na">labels</span><span class="pi">:</span>
<span class="na">env</span><span class="pi">:</span> <span class="s">test</span>
<span class="na">name</span><span class="pi">:</span> <span class="s">golang-test</span>
<span class="na">spec</span><span class="pi">:</span>
<span class="na">containers</span><span class="pi">:</span>
<span class="pi">-</span> <span class="na">image</span><span class="pi">:</span> <span class="s">golang</span>
<span class="na">name</span><span class="pi">:</span> <span class="s">go1</span>
<span class="na">nodeSelector</span><span class="pi">:</span>
<span class="s">feature.node.kubernetes.io/cpu-pstate.turbo</span><span class="pi">:</span> <span class="s1">'</span><span class="s">true'</span>
</code></pre> </div></div> <p>For more details on targeting nodes, see <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/">node selection</a>.</p> <h2 id="uninstallation">Uninstallation</h2> <h3 id="operator-was-used-for-deployment">Operator was used for deployment</h3> <p>If you followed the deployment instructions above you can simply do:</p> <div class="language-bash highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code>kubectl <span class="nt">-n</span> nfd delete NodeFeatureDiscovery my-nfd-deployment
</code></pre> </div></div> <p>Optionally, you can also remove the namespace:</p> <div class="language-bash highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code>kubectl delete ns nfd
</code></pre> </div></div> <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 documentation for instructions for uninstalling the operator and operator lifecycle manager, respectively.</p> <h3 id="manual">Manual</h3> <p>Simplest way is to invoke <code class="language-plaintext highlighter-rouge notranslate">kubectl delete</code> on the deployment files you used. Beware that this will also delete the namespace that NFD is running in. For example, in case the default deployment from the repo was used:</p> <div class="language-bash highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code>
kubectl 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
</code></pre> </div></div> <p>Alternatively you can delete create objects one-by-one, depending on the type of deployment, for example:</p> <div class="language-bash highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code><span class="nv">NFD_NS</span><span class="o">=</span>node-feature-discovery
kubectl <span class="nt">-n</span> <span class="nv">$NFD_NS</span> delete ds nfd-worker
kubectl <span class="nt">-n</span> <span class="nv">$NFD_NS</span> delete deploy nfd-master
kubectl <span class="nt">-n</span> <span class="nv">$NFD_NS</span> delete svc nfd-master
kubectl <span class="nt">-n</span> <span class="nv">$NFD_NS</span> delete sa nfd-master
kubectl delete clusterrole nfd-master
kubectl delete clusterrolebinding nfd-master
</code></pre> </div></div> <h3 id="removing-feature-labels">Removing feature labels</h3> <p>NFD-Master has a special <code class="language-plaintext highlighter-rouge notranslate">-prune</code> command line flag for removing all nfd-related node labels, annotations and extended resources from the cluster.</p> <div class="language-bash highlighter-rouge notranslate"><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
kubectl <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>
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
</code></pre> </div></div> <p><strong>NOTE:</strong> You must run prune before removing the RBAC rules (serviceaccount, clusterrole and clusterrolebinding).</p> <!-- 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.11/get-started/quick-start.html" class="btn" title="Quick start" accesskey="p" rel="prev"> <i class="fa fa-arrow-circle-left"></i> Previous </a></div> <div class="next"><a href="/node-feature-discovery/v0.11/get-started/features.html" class="btn" title="Feature labels" 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-2023,</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://pages.github.com" rel="noreferrer" target="_blank" title="github-pages v209">GitHub Pages</a> using a <a href="https://github.com/rundocs/jekyll-rtd-theme" rel="noreferrer" target="_blank" title="rundocs/jekyll-rtd-theme v2.0.10">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.11 </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: 548"> <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: 88991 Kb"> <i class="fa fa-download"></i> Download </a> </dd> </dl> <hr> <div class="license f6 pb-2"> This <a href="/node-feature-discovery/v0.11/" title="Node Feature Discovery">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 src="https://cdn.jsdelivr.net/gh/rundocs/jekyll-rtd-theme@2.0.10/assets/js/jquery.min.js"></script><script src="https://cdn.jsdelivr.net/gh/rundocs/jekyll-rtd-theme@2.0.10/assets/js/theme.min.js"></script> </body> </html>