Lab 6: Run vLLM on HAMi GPU Shares
This lab demonstrates how to install HAMi on a Kubernetes cluster that already has NVIDIA GPUs, and use HAMi to schedule vLLM inference services. Upon completion, you will have an OpenAI-compatible model service that can be verified through /v1/models and /v1/chat/completions.
This guide uses an Alibaba Cloud ACK GPU cluster as the reference environment, but the steps are not tied to ACK. As long as your Kubernetes cluster has available NVIDIA GPUs, NVIDIA drivers, and container runtime support, you can reproduce the same setup. Cloud vendor-specific LoadBalancer and ALB Ingress configurations can be replaced with your own exposure method.
Learning Objectives
- Verify that an existing GPU Kubernetes cluster meets the prerequisites for HAMi and vLLM
- Install HAMi scheduler and device plugin
- Add labels required by the HAMi DaemonSet to GPU nodes
- Run vLLM using HAMi's
nvidia.com/gpu,nvidia.com/gpumem, andnvidia.com/gpucoresresources - Test the vLLM OpenAI-compatible API via public LoadBalancer or port forwarding
Lab Overview
Deployment Architecture
Prerequisites
You need to prepare in advance:
- A working Kubernetes cluster
- At least 1 NVIDIA GPU node; this guide uses 3 NVIDIA A10 nodes
kubectlconnected to the clusterhelm3.x- GPU nodes with NVIDIA drivers and container runtime support installed
- The cluster can pull vLLM images and model files
The configuration files for this guide are:
| File | Purpose |
|---|---|
hami-values-ack.yaml | ACK example HAMi values, using DaoCloud image proxy and matching ACK GPU node labels. |
vllm-qwen25-7b.yaml | vLLM Deployment and vllm-qwen25-7b-engine-service ClusterIP Service. |
vllm-public-service-aliyun.yaml | Alibaba Cloud public LoadBalancer Service example. |
vllm-ingress-aliyun.yaml | Alibaba Cloud ALB Ingress example. |
If you are not running on ACK, you can still use
vllm-qwen25-7b.yaml. Just change the image, node labels, and service exposure method to match your environment.
Example Cluster State
Below is the ACK cluster state used to verify this guide. This cluster is in cn-hangzhou with 3 GPU nodes, each being an ecs.gn7i-c8g1.2xlarge with 1 NVIDIA A10.
kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP OS-IMAGE CONTAINER-RUNTIME
cn-hangzhou.10.10.1.73 Ready <none> 17h v1.36.1-aliyun.1 10.10.1.73 Alibaba Cloud Linux 3.2104 U13.1 (OpenAnolis Edition) containerd://1.6.28
cn-hangzhou.10.10.1.74 Ready <none> 17h v1.36.1-aliyun.1 10.10.1.74 Alibaba Cloud Linux 3.2104 U13.1 (OpenAnolis Edition) containerd://1.6.28
cn-hangzhou.10.10.1.75 Ready <none> 17h v1.36.1-aliyun.1 10.10.1.75 Alibaba Cloud Linux 3.2104 U13.1 (OpenAnolis Edition) containerd://1.6.28
Check GPU node labels and HAMi-exposed GPU resources:
kubectl get nodes -L gpu,aliyun.accelerator/xpu_type \
-o 'custom-columns=NAME:.metadata.name,GPU_LABEL:.metadata.labels.gpu,XPU:.metadata.labels.aliyun\.accelerator/xpu_type,ALLOC_GPU:.status.allocatable.nvidia\.com/gpu'
NAME GPU_LABEL XPU ALLOC_GPU
cn-hangzhou.10.10.1.73 on nvidia 10
cn-hangzhou.10.10.1.74 on nvidia 10
cn-hangzhou.10.10.1.75 on nvidia 10
Each physical A10 is registered by HAMi as 10 schedulable GPU shares. The nvidia.com/gpu: 10 here means this node can allocate up to 10 HAMi GPU device shares. The actual memory and compute each workload can use depends on the nvidia.com/gpumem and nvidia.com/gpucores it requests simultaneously. You can also see cloud vendor-provided GPU labels on the node:
aliyun.accelerator/nvidia_count=1
aliyun.accelerator/nvidia_mem=23028MiB
aliyun.accelerator/nvidia_name=NVIDIA-A10
aliyun.accelerator/xpu_type=nvidia
node.kubernetes.io/instance-type=ecs.gn7i-c8g1.2xlarge
The NVIDIA A10 is a 24 GB-class GPU. In this ACK cluster, the node labels report available memory as 23028MiB or 24564MiB. Check the node labels and nvidia-smi inside the container for the exact values.
Current Helm releases in the cluster:
helm list -A
NAME NAMESPACE STATUS CHART
ack-nvidia-device-plugin kube-system deployed ack-nvidia-device-plugin-0.7.0
hami kube-system deployed hami-2.9.0
vllm vllm deployed vllm-stack-0.1.11
HAMi component status:
kubectl get pods -n kube-system -l app.kubernetes.io/instance=hami -o wide
kubectl get ds hami-device-plugin -n kube-system -o wide
NAME READY STATUS NODE
hami-device-plugin-8jz8x 2/2 Running cn-hangzhou.10.10.1.73
hami-device-plugin-whtkm 2/2 Running cn-hangzhou.10.10.1.74
hami-device-plugin-9db54 2/2 Running cn-hangzhou.10.10.1.75
hami-scheduler-... 2/2 Running cn-hangzhou.10.10.1.75
NAME DESIRED CURRENT READY NODE SELECTOR
hami-device-plugin 3 3 3 aliyun.accelerator/xpu_type=nvidia,gpu=on
vLLM runtime status:
kubectl get pods,svc,ingress -n vllm -o wide
NAME READY STATUS NODE
pod/vllm-qwen25-7b-deployment-...-g8gct 1/1 Running cn-hangzhou.10.10.1.73
pod/vllm-qwen25-7b-deployment-...-znpb5 1/1 Running cn-hangzhou.10.10.1.74
NAME TYPE EXTERNAL-IP PORT(S)
service/vllm-qwen25-7b-public LoadBalancer 120.27.251.192 80:30835/TCP
service/vllm-qwen25-7b-engine-service ClusterIP <none> 80/TCP
NAME CLASS HOSTS ADDRESS
ingress.networking.k8s.io/vllm-qwen25-7b alb llm.kubecon.ai alb-aqaj06ms8ogcxwg16o.cn-hangzhou.alb.aliyuncsslb.com
The vLLM service already running in this reference cluster was deployed using the vLLM Production Stack Helm chart, with explicit use of hami-scheduler, nvidia.com/gpumem: "22000", and nvidia.com/gpucores: "100". The lab below uses standalone manifests to deploy a similar service, preserving these key configurations so you can directly observe whether HAMi resource constraints are in effect.