1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-06 16:57:10 +00:00
node-feature-discovery/v0.11/get-started/quick-start.html

94 lines
20 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=5, user-scalable=no"> <meta name="description" content="Quick start Minimal steps to deploy latest released version of NFD in your cluster. Installation Deploy with kustomize creates a new namespace, s..."> <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>Quick start · Node Feature Discovery</title> <meta name="twitter:title" content="Quick start · Node Feature Discovery"> <meta name="twitter:description" content="Quick start Minimal steps to deploy latest released version of NFD in your cluster. Installation Deploy with kustomize creates a new namespace, s..."> <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/quick-start.html"> <meta name="twitter:creator" content="@rundocs/jekyll-rtd-theme v2.0.10"> <meta property="og:title" content="Quick start · Node Feature Discovery"> <meta property="og:description" content="Quick start Minimal steps to deploy latest released version of NFD in your cluster. Installation Deploy with kustomize creates a new namespace, s..."> <meta property="og:locale" content="en"> <meta property="og:url" content="https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/get-started/quick-start.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-06-07T10:38:26-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/quick-start.html" }, "headline": "Quick start · Node Feature Discovery", "image": [], "author": { "@type": "Person", "name": "Kubernetes SIGs" }, "datePublished": "2016-07-23T00:07:52-05:00", "dateModified": "2022-06-07T10:38:26-05:00", "publisher": { "@type": "Organization", "name": "Kubernetes SIGs", "logo": { "@type": "ImageObject", "url": "https://avatars.githubusercontent.com/u/36015203?v=4" } }, "description": "Quick start Minimal steps to deploy latest released version of NFD in your cluster. Installation Deploy with kustomize creates a new namespace, s..." } </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/introduction.html"><link rel="next" href="https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/get-started/deployment-and-usage.html"><link rel="canonical" href="https://kubernetes-sigs.github.com/node-feature-discovery/v0.11/get-started/quick-start.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 Re
</code></pre> </div></div> <h2 id="verify">Verify</h2> <p>Wait until NFD master and NFD worker are running.</p> <div class="language-bash highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>kubectl <span class="nt">-n</span> node-feature-discovery get ds,deploy
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
daemonset.apps/nfd-worker 2 2 2 2 2 &lt;none&gt; 10s
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/nfd-master 1/1 1 1 17s
</code></pre> </div></div> <p>Check that NFD feature labels have been created</p> <div class="language-bash highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>kubectl get no <span class="nt">-o</span> json | jq .items[].metadata.labels
<span class="o">{</span>
<span class="s2">"beta.kubernetes.io/arch"</span>: <span class="s2">"amd64"</span>,
<span class="s2">"beta.kubernetes.io/os"</span>: <span class="s2">"linux"</span>,
<span class="s2">"feature.node.kubernetes.io/cpu-cpuid.ADX"</span>: <span class="s2">"true"</span>,
<span class="s2">"feature.node.kubernetes.io/cpu-cpuid.AESNI"</span>: <span class="s2">"true"</span>,
<span class="s2">"feature.node.kubernetes.io/cpu-cpuid.AVX"</span>: <span class="s2">"true"</span>,
...
</code></pre> </div></div> <h2 id="use-node-labels">Use node labels</h2> <p>Create a pod targeting a distinguishing feature (select a valid feature from the list printed on the previous step)</p> <div class="language-bash highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span><span class="nb">cat</span> <span class="o">&lt;&lt;</span> <span class="no">EOF</span><span class="sh"> | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
name: feature-dependent-pod
spec:
containers:
- image: k8s.gcr.io/pause
name: pause
nodeSelector:
# Select a valid feature
feature.node.kubernetes.io/cpu-cpuid.AESNI: 'true'
</span><span class="no">EOF
</span>pod/feature-dependent-pod created
</code></pre> </div></div> <p>See that the pod is running on a desired node</p> <div class="language-bash highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>kubectl get po feature-dependent-pod <span class="nt">-o</span> wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
feature-dependent-pod 1/1 Running 0 23s 10.36.0.4 node-2 &lt;none&gt; &lt;none&gt;
</code></pre> </div></div> <h2 id="additional-optional-installation-steps">Additional Optional Installation Steps</h2> <p>In order to deploy nfd-master and nfd-topology-updater daemons use <code class="language-plaintext highlighter-rouge notranslate">topologyupdater</code> overlay.</p> <p>Deploy with kustomize creates a new namespace, service and required RBAC rules and nfd-master and nfd-topology-updater daemons.</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.1
</code></pre> </div></div> <p><strong>NOTE:</strong></p> <p><a href="https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/#monitoring-device-plugin-resources">PodResource API</a> is a prerequisite for nfd-topology-updater.</p> <p>Preceding Kubernetes v1.23, the <code class="language-plaintext highlighter-rouge notranslate">kubelet</code> must be started with the following flag:</p> <p><code class="language-plaintext highlighter-rouge notranslate">--feature-gates=KubeletPodResourcesGetAllocatable=true</code></p> <p>Starting Kubernetes v1.23, the <code class="language-plaintext highlighter-rouge notranslate">GetAllocatableResources</code> is enabled by default through <code class="language-plaintext highlighter-rouge notranslate">KubeletPodResourcesGetAllocatable</code> <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates">feature gate</a>.</p> <h2 id="verify-1">Verify</h2> <p>Wait until NFD master and NFD topologyupdater are running.</p> <div class="language-bash highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>kubectl <span class="nt">-n</span> node-feature-discovery get ds,deploy
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
daemonset.apps/nfd-topology-updater 2 2 2 2 2 &lt;none&gt; 5s
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/nfd-master 1/1 1 1 17s
</code></pre> </div></div> <p>Check that the NodeResourceTopology CR instances are created</p> <div class="language-bash highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>kubectl get noderesourcetopologies.topology.node.k8s.io
NAME AGE
kind-control-plane 23s
kind-worker 23s
</code></pre> </div></div> <h2 id="show-the-cr-instances">Show the CR instances</h2> <div class="language-bash highlighter-rouge notranslate"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>kubectl describe noderesourcetopologies.topology.node.k8s.io kind-control-plane
Name: kind-control-plane
Namespace: default
Labels: &lt;none&gt;
Annotations: &lt;none&gt;
API Version: topology.node.k8s.io/v1alpha1
Kind: NodeResourceTopology
...
Topology Policies:
SingleNUMANodeContainerLevel
Zones:
Name: node-0
Costs:
node-0: 10
node-1: 20
Resources:
Name: Cpu
Allocatable: 3
Capacity: 3
Available: 3
Name: vendor/nic1
Allocatable: 2
Capacity: 2
Available: 2
Name: vendor/nic2
Allocatable: 2
Capacity: 2
Available: 2
Type: Node
Name: node-1
Costs:
node-0: 20
node-1: 10
Resources:
Name: Cpu
Allocatable: 4
Capacity: 4
Available: 4
Name: vendor/nic1
Allocatable: 2
Capacity: 2
Available: 2
Name: vendor/nic2
Allocatable: 2
Capacity: 2
Available: 2
Type: Node
Events: &lt;none&gt;
</code></pre> </div></div> <p>The CR instances created can be used to gain insight into the allocatable resources along with the granularity of those resources at a per-zone level (represented by node-0 and node-1 in the above example) or can be used by an external entity (e.g. topology-aware scheduler plugin) to take an action based on the gathered information.</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/introduction.html" class="btn" title="Introduction" 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/deployment-and-usage.html" class="btn" title="Deployment and usage" 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://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: 440"> <i class="fa fa-github"></i> Homepage </a> </dd> <dd> <a href="https://github.com/kubernetes-sigs/node-feature-discovery/issues" title="Open issues: 21"> <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: 82767 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>