Skip to main content
GPU autoscaling in a Kubernetes cluster combines four components: NVIDIA GPU Operator for resource management, KEDA for event-driven pod scaling, Prometheus for metrics collection, and Gcore Cluster Autoscaler for node provisioning. When GPU utilization exceeds the configured threshold, KEDA creates additional pods — Cluster Autoscaler then provisions new GPU Bare Metal nodes to meet the demand.
Gcore Managed Kubernetes includes native autoscaling based on CPU and memory only. To scale workloads based on GPU utilization, KEDA must be manually installed and configured.

Prepare the cluster

Create a Kubernetes cluster with a GPU Bare Metal worker pool and verify that nodes are ready before installing GPU software.

Step 1. Create a Kubernetes cluster

Add a new Managed Kubernetes cluster with a Bare Metal worker pool:
  1. In the Gcore Customer Portal, navigate to Cloud > Kubernetes.
  2. Click Create Cluster.
  3. Select a region — the location of the data center where the cluster will be deployed.
  4. Select the Kubernetes cluster version: v1.28.6 or higher.
  5. Configure Bare Metal pools:
  • Pool name: Enter a unique and descriptive name for the resource pool.
  • Minimum nodes and Maximum nodes: Specify how many nodes can be allocated to the pool during traffic fluctuations. The maximum number of nodes must be greater than the minimum to allow the cluster to scale up in response to increased demand.
  • Type: Select GPU Bare metal instances.
  • Infrastructure: Select the needed GPU-optimized flavor. At least one node with GPU support must be added to the worker pool.
Pools configuration section on the Create Kubernetes cluster page
  1. (Optional) Add labels to include additional node metadata. Add taints to define which Kubernetes pods can be scheduled on these nodes.
  2. Disable the Autohealing nodes toggle.
  3. (Optional) Enable the Public IPv4 address option to assign public IPv4 addresses to cluster nodes.
  4. To add more pools, click Add pool and configure each according to the previous steps.
A list of toggles with configurations for steps 6-9
  1. Complete the remaining cluster settings starting from step 5 in the cluster creation guide.

Step 2. Verify the Kubernetes configuration

  1. In the Customer Portal, navigate to Cloud > Kubernetes.
  2. Find the cluster created in the previous step and click its name to open it.
  3. Check the pool status: it should be Running. If the status shows Scaling up, wait until all resources are allocated and the cluster is ready to use.
  4. Download the .config file by clicking Kubernetes config in the top-right corner of the screen.
Kubernetes cluster overview page
  1. Export Kubernetes configuration locally:
  1. Verify that the node is ready:
The expected output looks similar to this:

Install dependencies

Install the GPU Operator to expose GPU resources, then KEDA and Prometheus to drive utilization-based scaling decisions.

Step 3. Install GPU Operator

Use Helm to install the GPU Operator — the official Helm docs cover installation for all platforms.
  1. Add the NVIDIA Helm repository and update it:
  1. Install the GPU Operator. Use version v23.9.1 for Kubernetes 1.28.x or v23.9.2 for Kubernetes 1.29.x:
Once installation completes, verify that GPUs are visible to Kubernetes before continuing.

Step 4. Verify GPU allocation

  1. Run kubectl describe node <node-name> and check the Allocatable section. The nvidia.com/gpu value must match the GPU count specified in the Bare Metal flavor.
  1. Check that all GPU Operator pods have READY status:
The expected output looks similar to this:
  1. Run a test GPU application using the NVIDIA CUDA vectorAdd example. Deploy the example workload and confirm it completes successfully before continuing.

Step 5. Install KEDA

With GPU resources confirmed, install KEDA — it reads Prometheus metrics to determine when to create additional pods.
  1. Add the KEDA Helm repository:
  1. Update the repository:
  1. Install KEDA into its own namespace:

Step 6. Install kube-prometheus-stack

KEDA relies on Prometheus metrics to trigger GPU-based scaling decisions. Install the kube-prometheus-stack to collect and expose those metrics.
  1. Add the Prometheus Helm repository, update it, and save the default values:
  1. Create the values-overrides.yaml file with the following content:
  1. Install kube-prometheus-stack:
The values-overrides.yaml overrides the default Prometheus configuration to define a scrape job that collects DCGM metrics from the gpu-operator namespace.

Configure autoscaling

With metrics collection in place, create the workload and the ScaledObject that tells KEDA how to scale it.

Step 7. Deploy the workload and ScaledObject

Deploy the GPU workload and the KEDA ScaledObject that controls its scaling. Apply both manifests to the cluster. Workload Deployment
ScaledObject
The DCGM_FI_DEV_GPU_UTIL metric measures real-time GPU core utilization and is collected by the nvidia-dcgm-exporter installed in Step 3. Any metric from the DCGM exporter can be used in the query field instead.
The {pod=~"gpu-workload.*"} selector in the query filters metrics by pod name prefix. Update gpu-workload to match the actual workload name.

Parameters

Replace the example values in both manifests:

Verify scaling

Deploy the workload and confirm that KEDA, Cluster Autoscaler, and new GPU nodes respond correctly to GPU utilization changes.

Step 8. Verify autoscaling

The autoscaling sequence has three phases: KEDA monitors GPU utilization and scales pods via the HPA, Cluster Autoscaler provisions new nodes when GPU capacity runs out, then new nodes join the cluster.
  1. Monitor HPA in real time:
The expected output looks similar to this:
The system created eight pods to match the eight GPUs available on the server.
  1. When pods exceed GPU capacity, Cluster Autoscaler requests new nodes. Run kubectl get events -w to observe provisioning events — node provisioning takes up to 20–25 minutes.
  1. Once the new node is ready, check pod status:
The expected output looks similar to this:
Eight pods are running, and several have a Pending status while the new node initializes. After it is ready, the system scales up to the maxReplicaCount value.
After provisioning, it might take up to five minutes for NVIDIA GPU resources to become available in the cluster.
  1. Check that the new node has joined the cluster:
  1. Verify the final HPA status:
The expected output looks similar to this:
When the utilization metric crosses the configured threshold — 60% in the example above — KEDA creates new pods up to the maxReplicaCount limit. If all GPUs are in use and no free resources are available, Kubernetes keeps the pods in Pending state, and Cluster Autoscaler provisions new nodes. Once new nodes are ready and GPUs are initialized (which might take 5 to 10 minutes), the pending pods start running.