|
11 | 11 | In order to enable DRA you need to enable both the feature gates and the API groups. |
12 | 12 | Kubernetes cluster with DRA KIND Install KIND. |
13 | 13 | Create a cluster using the following configuration. |
14 | | -kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane image: kindest/node:v1.33.1 - role: worker image: kindest/node:v1.33.1 - role: worker image: kindest/node:v1.33.1 featureGates: # Enable the corresponding DRA feature gates DynamicResourceAllocation: true DRAResourceClaimDeviceStatus: true runtimeConfig: api/beta : true kind create cluster --config kind."><meta itemprop=datePublished content="2024-12-17T14:47:05+00:00"><meta itemprop=dateModified content="2024-12-17T14:47:05+00:00"><meta itemprop=wordCount content="570"><meta name=twitter:card content="summary"><meta name=twitter:title content="Quick Start"><meta name=twitter:description content="DraNet depends on the Kubernetes feature Dynamic Resource Allocation (DRA), that is beta (disabled by default in Kubernetes ∂v1.32). |
| 14 | +kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane image: kindest/node:v1.33.1 - role: worker image: kindest/node:v1.33.1 - role: worker image: kindest/node:v1.33.1 featureGates: # Enable the corresponding DRA feature gates DynamicResourceAllocation: true DRAResourceClaimDeviceStatus: true runtimeConfig: api/beta : true kind create cluster --config kind."><meta itemprop=datePublished content="2024-12-17T14:47:05+00:00"><meta itemprop=dateModified content="2024-12-17T14:47:05+00:00"><meta itemprop=wordCount content="571"><meta name=twitter:card content="summary"><meta name=twitter:title content="Quick Start"><meta name=twitter:description content="DraNet depends on the Kubernetes feature Dynamic Resource Allocation (DRA), that is beta (disabled by default in Kubernetes ∂v1.32). |
15 | 15 | In order to enable DRA you need to enable both the feature gates and the API groups. |
16 | 16 | Kubernetes cluster with DRA KIND Install KIND. |
17 | 17 | Create a cluster using the following configuration. |
|
39 | 39 | </span></span><span style=display:flex><span> |
40 | 40 | </span></span><span style=display:flex><span>kubernetes_feature_enabled{name=<span style=color:#a31515>"DynamicResourceAllocation"</span>,stage=<span style=color:#a31515>"BETA"</span>} 1 |
41 | 41 | </span></span></code></pre></div><h2 id=installation>Installation</h2><p>You can install the latest stable version of <code>DraNet</code> using the provided manifest:</p><pre tabindex=0><code>kubectl apply -f https://raw.githubusercontent.com/google/dranet/refs/heads/main/install.yaml |
42 | | -</code></pre><h3 id=how-to-use-it>How to use it</h3><p>Once the Kubernetes Network Driver is running you can see the list of Network Interfaces and its attributes published by the drivers using <code>kubectl get resourceslices -o yaml</code>:</p><pre tabindex=0><code>apiVersion: resource.k8s.io/v1beta1 |
| 42 | +</code></pre><h3 id=how-to-use-it>How to use it</h3><p>Once the Kubernetes Network Driver is running you can see the list of Network Interfaces and its attributes published by the drivers using <code>kubectl get resourceslices -o yaml</code>:</p><pre tabindex=0><code>apiVersion: resource.k8s.io/v1 |
43 | 43 | kind: ResourceSlice |
44 | 44 | metadata: |
45 | 45 | creationTimestamp: "2024-12-15T23:41:51Z" |
|
96 | 96 | bool: false |
97 | 97 | name: gpu7rdma0 |
98 | 98 | ... |
99 | | -</code></pre><p>Once the resources are available, users can create <code>DeviceClasses</code>, <code>ResourceClaims</code> and/or <code>ResourceClaimTemplates</code> to schedule pods.</p><p>Define a <code>DeviceClass</code> that selects all the network interfaces that are connected to a <code>GCP Network</code></p><div class=highlight><pre tabindex=0 style=background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-yaml data-lang=yaml><span style=display:flex><span>apiVersion: resource.k8s.io/v1beta1 |
| 99 | +</code></pre><p>Once the resources are available, users can create <code>DeviceClasses</code>, <code>ResourceClaims</code> and/or <code>ResourceClaimTemplates</code> to schedule pods.</p><p>Define a <code>DeviceClass</code> that selects all the network interfaces that are connected to a <code>GCP Network</code></p><div class=highlight><pre tabindex=0 style=background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-yaml data-lang=yaml><span style=display:flex><span>apiVersion: resource.k8s.io/v1 |
100 | 100 | </span></span><span style=display:flex><span>kind: DeviceClass |
101 | 101 | </span></span><span style=display:flex><span>metadata: |
102 | 102 | </span></span><span style=display:flex><span> name: dranet-cloud |
|
106 | 106 | </span></span><span style=display:flex><span> expression: device.driver == "dra.net" |
107 | 107 | </span></span><span style=display:flex><span> - cel: |
108 | 108 | </span></span><span style=display:flex><span> expression: has(device.attributes["dra.net"].cloudNetwork) |
109 | | -</span></span></code></pre></div><p>Now you can create a <code>ResourceClaim</code> that connects to a specific network, in this case <code>dra-1-vpc</code> and reference that claim in a <code>Pod</code>:</p><div class=highlight><pre tabindex=0 style=background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-yaml data-lang=yaml><span style=display:flex><span>apiVersion: resource.k8s.io/v1beta1 |
| 109 | +</span></span></code></pre></div><p>Now you can create a <code>ResourceClaim</code> that connects to a specific network, in this case <code>dra-1-vpc</code> and reference that claim in a <code>Pod</code>:</p><div class=highlight><pre tabindex=0 style=background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-yaml data-lang=yaml><span style=display:flex><span>apiVersion: resource.k8s.io/v1 |
110 | 110 | </span></span><span style=display:flex><span>kind: ResourceClaim |
111 | 111 | </span></span><span style=display:flex><span>metadata: |
112 | 112 | </span></span><span style=display:flex><span> name: cloud-network-dra-net-1 |
113 | 113 | </span></span><span style=display:flex><span>spec: |
114 | 114 | </span></span><span style=display:flex><span> devices: |
115 | 115 | </span></span><span style=display:flex><span> requests: |
116 | 116 | </span></span><span style=display:flex><span> - name: req-cloud-net-1 |
117 | | -</span></span><span style=display:flex><span> deviceClassName: dranet-cloud |
118 | | -</span></span><span style=display:flex><span> selectors: |
119 | | -</span></span><span style=display:flex><span> - cel: |
120 | | -</span></span><span style=display:flex><span> expression: device.attributes["dra.net"].cloudNetwork == "dra-1-vpc" |
| 117 | +</span></span><span style=display:flex><span> exactly: |
| 118 | +</span></span><span style=display:flex><span> deviceClassName: dranet-cloud |
| 119 | +</span></span><span style=display:flex><span> selectors: |
| 120 | +</span></span><span style=display:flex><span> - cel: |
| 121 | +</span></span><span style=display:flex><span> expression: device.attributes["dra.net"].cloudNetwork == "dra-1-vpc" |
121 | 122 | </span></span><span style=display:flex><span>--- |
122 | 123 | </span></span><span style=display:flex><span>apiVersion: v1 |
123 | 124 | </span></span><span style=display:flex><span>kind: Pod |
|
0 commit comments