nvidia.com/gpu: 1. Kubernetes schedules the Pod on a node with enough available GPUs. With DRA, a workload can request devices from a DeviceClass and specify requirements for their properties and configuration. Kubernetes selects suitable devices, schedules the Pod on a node that can access them and asks the device driver to prepare them for the container.
Managed Service for Kubernetes supports DRA for two kinds of devices:
This guide explains how to enable DRA on a node group and use it to allocate resources to a workload.
Prerequisites
- Create a Managed Kubernetes cluster that runs Kubernetes 1.34 or later, or upgrade an existing cluster. Kubernetes 1.34 is the first version in which the DRA API,
resource.k8s.io/v1, is stable. For the versions available in Managed Kubernetes, see Kubernetes versions. - Install kubectl and connect to the cluster.
- Install jq.
- Install Helm.
How to enable DRA on a node group
Enable DRA in the GPU settings of the node group. The legacy NVIDIA device plug-in and the NVIDIA DRA driver must not manage the same GPUs. This setting prepares the nodes for GPU DRA and disables the legacy plug-in on that group. When you use a preinstalled NVIDIA driver, select a driver preset. Otherwise, install the NVIDIA GPU Operator and, for InfiniBand, the NVIDIA Network Operator. When installing GPU Operator, setdevicePlugin.enabled=false so the Operator does not start the legacy plug-in. For the commands and installation order, see How to install the drivers and components on existing node groups.
Use one of the following:
-
To create a node group, add the DRA settings in the create request:
- CLI
- Terraform
- Go SDK
- Python SDK
- JavaScript SDK
Add--template-gpu-settings-dra=trueto the create command:Set<driver_preset>when you use a preinstalled driver. Otherwise, omit--template-gpu-settings-drivers-preset. - To enable DRA on an existing node group, add the same settings when you update the node group.
Allocating a GPU
Managed Kubernetes does not install the NVIDIA DRA driver. Install and maintain the driver yourself.Install the NVIDIA DRA driver
-
Add the NVIDIA chart repository:
-
Install the supported NVIDIA DRA driver version:
For other chart values required by your node image, see the NVIDIA DRA driver for GPUs documentation.
Check the NVIDIA DRA driver
-
Check that the driver Pods are ready:
The output lists one controller Pod and one kubelet plugin Pod for each GPU node. All Pods are
Running, with all containers ready: -
Check that the driver has created the GPU DeviceClass:
The expected output is:
-
Check that the driver has published the GPU inventory:
The output lists every target GPU node with its GPUs, for example:
Request a GPU
-
Save the following manifest as
gpu-workload.yaml. Replace<tested_cuda_image>with a container image that includesnvidia-smi. The Pod command runsnvidia-smito confirm the GPU. For example,nvidia/cuda:13.1.1-runtime-ubuntu24.04. -
Create the ResourceClaimTemplate and Pod:
-
Wait until the Pod is running:
-
Check that the GPU is visible in the container:
The output lists one allocated GPU.
Allocating an RDMA or InfiniBand interface
How managed DRANet works
When you enable DRA on a node group in a GPU cluster, Managed Kubernetes installs and maintains the DRANet driver for you. You don’t need to install it yourself. Managed Kubernetes:- Runs the
dranetDaemonSet in thekube-systemnamespace on nodes labelednebius.com/dranet-rdma-capable=true. - Discovers the RDMA-capable network interfaces on those nodes.
- Publishes the discovered interfaces to Kubernetes as ResourceSlices.
- Provides DeviceClasses that workloads can use to request an RDMA or InfiniBand interface.
Check managed DRANet
-
Check that the
dranetDaemonSet is running:The expected output is:The DaemonSet is in thekube-systemnamespace. The ready count matches the number of eligible nodes, and the node selector isnebius.com/dranet-rdma-capable=true. -
Check that Managed Kubernetes has created the network DeviceClasses:
The expected output is:The DeviceClasses select the following interfaces:
-
Check that DRANet has published the network-device inventory:
Each device lists its name and attributes. Confirm that the interface is RDMA-capable.
Don’t request both
rdma.networking.nebius.ai and ib.networking.nebius.ai when the workload needs only one network device. Kubernetes treats them as independent device requests and allocates two separate devices.- Use
ib.networking.nebius.aiwhen the workload specifically requires an InfiniBand interface. InfiniBand interfaces are RDMA-capable, so you don’t need an additional request forrdma.networking.nebius.ai. - Use
rdma.networking.nebius.aiwhen the workload can use any RDMA-capable interface, including either InfiniBand or Ethernet-based RDMA.
Request an InfiniBand interface
The following example requests one interface from theib.networking.nebius.ai DeviceClass. To request any RDMA-capable interface instead, use rdma.networking.nebius.ai.
-
Save the following manifest as
ib-workload.yaml. Replace<container_image_with_rdma_tools>with a container image that includes the RDMA user-space tools you use to test the allocated interface.countspecifies the number of interfaces to allocate. It does not change the bandwidth of an individual interface. If you omitcount, the default is 1. -
Create the ResourceClaimTemplate and the Pod:
-
Wait until the Pod is running:
Verify the network allocation
-
Get the generated claim name from the Pod:
-
Inspect the generated ResourceClaim. Replace
<claim_name>with the name from the previous command:Instatus.allocation.devices.results, the allocation contains the DRANet driver, device pool and allocated device: -
Check that the allocated interface is visible inside the container:
In addition to the default interfaces, the output contains the allocated interface:
-
Check that the RDMA devices are visible to the container:
The output contains the associated RDMA device, for example:
See also
- Working with GPUs
- Interconnecting GPUs with InfiniBand
- Dynamic Resource Allocation in the Kubernetes documentation, including DeviceClasses and ResourceClaims
InfiniBand and InfiniBand Trade Association are registered trademarks of the InfiniBand Trade Association.