VOOZH about

URL: https://thenewstack.io/install-a-nvidia-gpu-operator-on-rke2-kubernetes-cluster/

⇱ Install a Nvidia GPU Operator on RKE2 Kubernetes Cluster - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2021-11-09 05:00:59
Install a Nvidia GPU Operator on RKE2 Kubernetes Cluster
tutorial,
Edge Computing / Kubernetes

Install a Nvidia GPU Operator on RKE2 Kubernetes Cluster

In this tutorial, we will walk you through the steps of installing the NVIDIA GPU Operator on Rancher’s RKE2 Kubernetes distribution.
Nov 9th, 2021 5:00am by Janakiram MSV
👁 Featued image for: Install a Nvidia GPU Operator on RKE2 Kubernetes Cluster
Feature image: The Nvidia Container Toolkit.

In a typical GPU-based Kubernetes installation, such as for machine learning, each node needs to be configured with the correct version of Nvidia graphics driver, CUDA runtime, and cuDNN libraries followed by a container runtime such as Docker Engine, containerd, podman, or CRI-O.

Then, the Nvidia Container Toolkit is deployed to provide GPU access to the containerized applications. Nvidia device plugin for Kubernetes bridges the gap between the GPU and the container orchestrator. Finally, Kubernetes is installed, which will interact with the chosen container runtime to manage the lifecycle of workloads.

The Nvidia GPU Operator dramatically simplifies the process without manually installing the drivers, CUDA runtime, cuDNN libraries, or the Nvidia Container Toolkit. It can be installed on any Kubernetes cluster that meets specific hardware and software requirements.

When compared to the installation on the upstream Kubernetes distribution, the installation on RKE2 is slightly different. The key difference is that RKE2 comes with an embedded containerd that needs to be tweaked a bit to support the Nvidia Container Toolkit.

Once RKE2 is configured with the GPU Operator, you can run workloads such as Kubeflow and Triton Inference Server that can exploit the GPU for AI acceleration.

In this tutorial, I will walk you through all the steps of installing the Nvidia GPU Operator on Rancher’s RKE2 Kubernetes distribution.

For this setup, I am using an Ubuntu 20.04 Server running on Google Compute Engine. The VM is of type a2-highgpu-1g powered by an Nvidia Tesla A100 GPU. It has been tested with v1.21.5+rke2r2 version of RKE2 distribution. But you can use this guide on bare metal or IaaS environments that have access to an Nvidia GPU.

Step 1: Install RKE2

SSH into the instance and create the file /etc/rancher/rke2/config.yaml with the below contents:

This file contains the configuration required by RKE2 Server. Don’t forget to replace the tls-san section with the hostname, internal IP, and the external IP address of the GCE instance.

Download and run the install script for RKE2. Once it’s done, activate and enable the service to start at boot time.

Add the directory containing the Kubernetes binaries to the path, and run the kubectl command to check the status of the server.

👁 Checking the status of the Kubernetes server.

Step 2: Install Helm and Patch Containerd Configuration

Since we will deploy the GPU operator through the Helm Chart, let’s first install Helm 3.

The next step is most crucial for deploying Nvidia GPU Operator. We will patch the configuration file to enable v2 support without which the Nvidia Container Toolkit will not run.

Restart RKE2 Server to make sure everything is intact.

systemctl restart rke2-server

Step 3: Deploy Nvidia GPU Operator on RKE2

We have everything in place to deploy the GPU operator.

Let’s add the Nvidia Helm Chart Repo, refresh Helm and install the GPU operator.

Refer to the Nvidia GPU Operator documentation for details on customizing the Helm chart values. In this case, we are essentially pointing the GPU operator to the custom container runtime class, configuration, and endpoint.

👁 Modifying a Halm chart to accommodate GPUs

The complete installation of the GPU operator will take a few minutes. Be patient!

Step 4: Verifying and Testing the Installation of Nvidia GPU Operator

The Helm chart has created a new namespace called gpu-operator-resources

👁 Image

Wait for the pods in the gpu-operator-resources namespace to become ready.

👁 Waiting for the namespace.

Finally, let’s run the famous nvidia-smi command to check if a Kubernetes pod can access the GPU.

👁 Checking if the Kubernetes pod can access the GPU

As we can see from the output, the GPU operator has successfully installed and configured the Nvidia driver, CUDA runtime, and the Container Toolkit without any manual intervention.

TRENDING STORIES
Janakiram MSV (Jani) is a practicing architect, research analyst, and advisor to Silicon Valley startups. He focuses on the convergence of modern infrastructure powered by cloud-native technology and machine intelligence driven by generative AI. Before becoming an entrepreneur, he spent...
Read more from Janakiram MSV
SHARE THIS STORY
TRENDING STORIES
TNS owner Insight Partners is an investor in: Docker.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.