3.0.20. This version is open-source and doesn’t require registry credentials. For NVIDIA’s paid Support-Entitled Release, see its registry credentials instructions.
Costs
Nebius AI Cloud charges you for the following billing items:- Managed Kubernetes cluster.
- Shared filesystem.
- Object Storage bucket for Terraform state.
- Managed Service for PostgreSQL® cluster if you use it instead of the PostgreSQL 16 database that the Run:ai installer deploys.
Prerequisites
-
Install and configure the tools:
- Install and configure the Nebius AI Cloud CLI.
- Install Terraform.
- Install kubectl and Helm version 3.14 or higher.
-
Install jq, which the k8s-training solution’s environment script uses to parse JSON data returned by the Nebius AI Cloud CLI:
- Prepare a domain name you control with access to its public DNS records.
Steps
Set up a Managed Kubernetes cluster
Use the k8s-training solution for Terraform to create a Managed Kubernetes cluster with:- A CPU node group with three nodes, each with 8 vCPUs and 32 GiB of RAM.
- A GPU node group with one node. The solution selects the GPU platform and preset for your region.
- A shared filesystem mounted on the nodes.
- NVIDIA GPU Operator.
- NVIDIA Network Operator.
-
Clone the solution repository and go to the
k8s-trainingdirectory: - Generate an SSH key pair.
-
Create
terraform.tfvarswith the following configuration:This configuration creates three CPU nodes with 8 vCPUs and 32 GiB of RAM each, one GPU node, and a mounted 100 GiB shared filesystem. It also enables GPU Operator to manage the GPU driver and Container Toolkit. -
Create
runai_override.tfin the same directory:This Terraform override file enables the NVIDIA Data Center GPU Manager (DCGM) exporter in the solution’s existing GPU Operator module. -
Set the following environment variables for the solution and your Run:ai deployment:
-
NEBIUS_TENANT_ID: Tenant ID. -
NEBIUS_PROJECT_ID: Project ID. -
NEBIUS_REGION: Project region, as displayed in the list of projects in the web console. You can configure a Managed Service for PostgreSQL cluster if you don’t want to use the PostgreSQL database the Run:ai installer deploys in your Kubernetes cluster. In that case, choose a project in a supported region and use that region. -
DOMAIN_NAME: Domain for the Run:ai web interface and workload subdomains. -
NEBIUS_VPC_SUBNET_ID(optional): Subnet ID for the cluster nodes. If you don’t set it, the solution’s environment script selects the default subnet in the project’s default network.
NEBIUS_*variables configure the solution’s Terraform environment.DOMAIN_NAMEspecifies the domain for Run:ai DNS and TLS configuration. -
-
Load the Terraform environment:
The script uses the subnet from
NEBIUS_VPC_SUBNET_IDor, if the variable isn’t set, selects the default subnet. It then prepares an Object Storage bucket for Terraform state and creates thek8s-training-saservice account. It adds the service account to theeditorsgroup in the tenant and sets the Terraform inputs from the environment variables. -
Initialize Terraform in the working directory:
-
Apply the changes:
-
Connect to the
k8s-trainingcluster:The command adds the cluster to your kubeconfig and selects it as the current context. Thekubectl,helm, andrunai-installercommands in the rest of this tutorial run against this cluster.
Install an ingress controller and configure DNS
Run:ai requires an ingress controller. This tutorial uses HAProxy Kubernetes Ingress Controller, following NVIDIA’s networking setup.-
Install HAProxy with a Service of type
LoadBalancer:Managed Kubernetes allocates a public IP address for the load balancer. The ingress class ishaproxy; you will reference it in the installer configuration. -
Get the load balancer’s IP address from the
EXTERNAL-IPcolumn:Wait until an address appears. -
In your DNS provider, create public DNS records pointing to this IP address for both your domain (
<domain_name>) and its wildcard (*.<domain_name>). If you want to enable Knative inference endpoints to let applications outside the cluster send requests to your models, also configure a wildcard inference domain, for example*.runai-inference.<domain_name>, pointing to the same address. Allow time for the DNS changes to propagate before running the installer.
Prepare TLS certificates
The installer reads local PEM files and creates TLS Secrets for Run:ai. The certificate must cover both your domain (<domain_name>) and its wildcard (*.<domain_name>). The example installer configuration in this tutorial uses this certificate for both the control plane and cluster, including host-based workload routing.
For details, see NVIDIA’s domain and certificate requirements.
To prepare the certificate files:
-
Get the certificate chain and matching private key files in PEM format. Use existing certificate files, or obtain them with cert-manager.
(Optional) Obtain certificate files with cert-manager
- Install cert-manager with Helm.
-
Configure a DNS-01 solver for your DNS provider and request a certificate covering both
<domain_name>and*.<domain_name>. HTTP-01 validation can’t issue wildcard certificates. -
Wait until the certificate is ready, then export its certificate chain and private key from the secret to local PEM files:
Replace
<certificate_secret_name>with the certificate’sspec.secretNameand<namespace>with its namespace.
- Save the files on the local machine where you will run the Run:ai installer. If a private certificate authority signed your certificates, also save its certificate authority chain file.
- (Optional) If you enable Knative inference endpoints for access from outside the cluster, also obtain a certificate covering the wildcard inference domain.
(Optional) Configure a Managed PostgreSQL cluster
By default, the Run:ai installer deploys a PostgreSQL 16 database inside the Kubernetes cluster for the Run:ai control plane. Alternatively, you can create your own Nebius Managed PostgreSQL cluster. To deploy a Managed PostgreSQL cluster and prepare its credentials for Run:ai:- Install the postgresql package.
-
Get the ID of the network that includes the Managed Kubernetes cluster’s subnet:
-
Create a Managed PostgreSQL cluster in the same network. In the command, set
<network_ID>to the ID you received in the previous step:The command creates a PostgreSQL 16 cluster, the only version Run:ai supports, with therunaidatabase and user for Run:ai. -
Get the private read-write endpoint and save it to
PG_ENDPOINT: -
Create a namespace and a Secret with the password that the cluster creation command saved to
PG_PASSWORD:
Install Run:ai
Download the installer
In thek8s-training directory, download the Run:ai installer for your operating system and architecture.
To follow the commands in this tutorial, rename the downloaded binary to runai-installer:
<os> with linux or darwin, and <arch> with amd64 or arm64, matching the filename you downloaded.
Prepare the installer configuration
Create a configuration that installs Run:ai on the Managed Kubernetes cluster, uses your TLS certificates, and installs Prometheus. GPU Operator is already installed by the k8s-training solution.To use GPU fractions, the installed GPU Operator, driver, and Container Toolkit must meet NVIDIA’s GPU fractions requirements. Check that your configuration meets the requirements separately from the basic setup for workloads that use whole GPUs.
config.yaml:
config.yaml
config.yaml
controlPlane.domain: Domain name you saved toDOMAIN_NAMEin Set up a Managed Kubernetes cluster.tls.certPath: Absolute path to the certificate chain file from Prepare TLS certificates.tls.keyPath: Absolute path to the matching private key file from Prepare TLS certificates.tls.caChainPath: If a private certificate authority issued your certificate, add this parameter and set it to the absolute path to the certificate authority chain file from Prepare TLS certificates.
(Optional) Use Managed PostgreSQL
(Optional) Use Managed PostgreSQL
If you created a Managed PostgreSQL cluster, replace
controlPlane.customHelmValues: {} with the following map under controlPlane. Replace <postgresql_endpoint> with the value of PG_ENDPOINT:postgresql.enabled: false disables the bundled PostgreSQL database. The global.postgresql.auth.* settings connect Run:ai to the Managed PostgreSQL cluster. For SSL configuration, see NVIDIA’s PostgreSQL configuration reference. Run:ai doesn’t support PostgreSQL SSL mode prefer.(Optional) Enable inference endpoints with Knative
(Optional) Enable inference endpoints with Knative
Knative Serving enables standard single-node inference workloads. To expose these workloads externally, replace the Add the following For details, see NVIDIA’s networking setup.
features block with:inference block under cluster, by using the wildcard inference domain you configured in DNS and the absolute paths to its certificate and key:Run the installer
Run the following commands from the directory containingrunai-installer and config.yaml.
-
Validate the configuration against the cluster and run preflight checks:
-
Review the installation plan without applying changes:
-
Run the installation:
The installer deploys Run:ai into the Managed Kubernetes cluster you connected to earlier. It installs prerequisites, enabled features, the control plane, and cluster components, and registers the
k8s-trainingcluster with the control plane. During installation, it generates the credentials that are required to log in to Run:ai. -
Check the Pods:
Wait until each Pod is
Runningwith a completeREADYcount or has finished with statusCompleted.
Log in to Run:ai
-
Retrieve the administrator username and password the Run:ai installer generated:
-
Open
https://<domain_name>in your browser, replacing<domain_name>with your domain. The UI can take up to 15 minutes to become reachable. - Log in with the credentials and change the password.
-
Verify that the
k8s-trainingcluster shows Connected in the control plane. If it doesn’t, see NVIDIA’s cluster troubleshooting guide.
How to delete the created resources
Some of the created resources are chargeable. If you don’t need them, delete these resources, so Nebius AI Cloud doesn’t charge for them. Theterraform destroy command deletes only the resources that Terraform created: the Managed Kubernetes cluster, its node groups, and the shared filesystem. The environment.sh script creates the bucket by using the Nebius AI Cloud CLI, and the cluster creates disks for Run:ai persistent volumes. The following steps delete all of these resources:
-
Uninstall HAProxy:
Wait for the command to complete before continuing. It deletes the HAProxy
LoadBalancerService so that Managed Kubernetes can remove the load balancer and its automatically managed public IP allocation. -
Go to the
k8s-trainingdirectory of the cloned repository and run theenvironment.shscript again:Terraform reads the project and subnet IDs, the IAM access token, and the access key to the bucket with the Terraform state from environment variables that the script sets. These variables exist only in the terminal session where you ran the script, and the token and the key expire. The script sets the variables again. -
Get the ID of the Managed Kubernetes cluster:
Save the received ID. The disks of the Run:ai persistent volumes have the cluster ID in their labels. After Terraform deletes the cluster, use this ID to find these disks.
-
Delete the resources that Terraform created:
If the command fails while uninstalling a Helm release, run it again.
-
Get the IDs of the disks that the cluster created for Run:ai persistent volumes:
- Delete the disks with these IDs.
- Delete the Managed PostgreSQL cluster if you used it.
-
Delete the bucket that stores the Terraform state. Its name starts with
tfstate-k8s-training-.
Postgres, PostgreSQL and the Slonik Logo are trademarks or registered trademarks of the PostgreSQL Community Association of Canada, and used with their permission.