vLLM Helm Overview #
GitHub Repository: https://github.com/vllm-project/production-stack Documentation: https://docs.vllm.ai/projects/production-stack/en/latest/deployment/helm.html
# Add Helm repository
helm repo add vllm https://vllm-project.github.io/production-stack &&
helm repo update
# List available versions of the chart
helm search repo vllm
# Shell output:
NAME CHART VERSION APP VERSION DESCRIPTION
vllm/vllm-stack 0.1.14 The stack deployment of vLLM
# Save Helm chart values
helm show values vllm/vllm-stack --version 0.1.14 > vllm-stack-values-0.1.14.yml
Ansible / Installation #
Playbook #
# Create vLLM API Key:
openssl rand -hex 32
# Shell output
458ec49c7d702f8d45202870eab1b4a00c03597d505cbe6e43d52e25f7900dfb
---
- name: vLLM Helm installation
hosts: localhost
connection: local
gather_facts: false
become: false
environment:
KUBECONFIG: "{{ lookup('env', 'HOME') }}/.kube/k3spc1.yaml"
vars:
# Helm Configuration
helm_repo_url: "https://vllm-project.github.io/production-stack"
helm_repo_name: "vllm"
helm_chart: "vllm/vllm-stack"
helm_chart_version: "0.1.14"
helm_release_name: "vllm"
kubernetes_namespace: "vllm"
# Storage Configuration
kubernetes_storage_class: "local-path"
kubernetes_pvc_size: "30Gi"
# Routing Configuration
vllm_hostname: "vllm.jklug.work"
gateway_name: "kgateway-metallb"
gateway_namespace: "kgateway-infra"
gateway_section: "https"
vllm_route_timeout: "600s"
# vLLM Engine Image
vllm_image_repository: "vllm/vllm-openai"
vllm_image_tag: "v0.34.0" # https://hub.docker.com/r/vllm/vllm-openai/tags
vllm_image_pull_policy: "IfNotPresent"
# GPU Runtime
vllm_runtime_class: "nvidia"
# Monitoring
vllm_service_monitor_enabled: false
# vLLM Configuration
vllm_router_routing_logic: "roundrobin"
vllm_api_key: "458ec49c7d702f8d45202870eab1b4a00c03597d505cbe6e43d52e25f7900dfb"
# LLMs
vllm_models:
- name: "qwen38-27b"
enabled: true
model_url: "unsloth/Qwen3.8-27B-NVFP4" # ~21 GB weights, NVFP4/FP8 mixed (native on Blackwell)
gpus: 2 # tensor parallel across both RTX 5070 Ti GPUs
max_model_len: 32768
gpu_memory_utilization: 0.92
max_num_seqs: 8
cpu_request: 8
memory_request: "16Gi"
memory_limit: "32Gi"
shm_size: "8Gi"
pvc_size: "50Gi"
enable_tool_calling: true # OpenAI "tools" support (e.g. LibreChat agents)
tool_call_parser: "qwen3_coder"
extra_args:
- "--reasoning-parser" # thinking output goes to "reasoning_content"
- "qwen3"
- "--kv-cache-dtype"
- "fp8"
- "--language-model-only" # text only, skips the vision tower / remove to send images
roles:
- k8s_vllm
# Run Ansible playbook:
ansible-playbook playbooks/k8s_vllm.yml
Tasks #
k8s_vllm/tasks/main.yml
- name: Create namespace
kubernetes.core.k8s:
state: present
definition:
apiVersion: v1
kind: Namespace
metadata:
name: "{{ kubernetes_namespace }}"
- name: Create secret with vLLM API key and Hugging Face token
kubernetes.core.k8s:
state: present
definition:
apiVersion: v1
kind: Secret
metadata:
name: vllm-stack-credentials
namespace: "{{ kubernetes_namespace }}"
type: Opaque
stringData:
VLLM_API_KEY: "{{ vllm_api_key }}"
no_log: true
- name: Build modelSpec list for the Helm values
ansible.builtin.set_fact:
vllm_model_spec: "{{ (vllm_model_spec | default([])) + [model_entry] }}"
vars:
model_entry:
name: "{{ item.name }}"
enabled: "{{ item.enabled | default(true) | bool }}"
repository: "{{ vllm_image_repository }}"
tag: "{{ vllm_image_tag }}"
modelURL: "{{ item.model_url }}"
replicaCount: 1
# Resources
requestCPU: "{{ item.cpu_request | int }}"
requestMemory: "{{ item.memory_request }}"
limitMemory: "{{ item.memory_limit }}"
requestGPU: "{{ item.gpus | int }}"
# Model cache (HF_HOME=/data)
pvcStorage: "{{ item.pvc_size | default(kubernetes_pvc_size) }}"
storageClass: "{{ kubernetes_storage_class }}"
pvcAccessMode:
- ReadWriteOnce
shmSize: "{{ item.shm_size | default('2Gi') }}"
# Features
enableLoRA: false
enableTool: "{{ item.enable_tool_calling | default(false) | bool }}"
toolCallParser: "{{ item.tool_call_parser | default('') }}"
# vLLM engine arguments
vllmConfig:
enablePrefixCaching: true
enableChunkedPrefill: true
maxModelLen: "{{ item.max_model_len | int }}"
tensorParallelSize: "{{ item.gpus | int }}"
maxNumSeqs: "{{ item.max_num_seqs | default(16) | int }}"
gpuMemoryUtilization: "{{ item.gpu_memory_utilization | default(0.90) | float }}"
extraArgs: "{{ item.extra_args | default([]) }}"
loop: "{{ vllm_models }}"
loop_control:
label: "{{ item.name }} ({{ item.model_url }})"
- name: Add Helm repository
kubernetes.core.helm_repository:
name: "{{ helm_repo_name }}"
repo_url: "{{ helm_repo_url }}"
force_update: true
- name: Deploy vLLM Production Stack
kubernetes.core.helm:
name: "{{ helm_release_name }}"
chart_ref: "{{ helm_chart }}"
chart_version: "{{ helm_chart_version }}"
release_namespace: "{{ kubernetes_namespace }}"
create_namespace: false
wait: false
wait_timeout: 5m0s
atomic: false
values: "{{ lookup('template', 'helm-values.yml.j2') | from_yaml }}"
- name: Wait for model deployments (first start downloads the model weights)
kubernetes.core.k8s_info:
kind: Deployment
name: "{{ helm_release_name }}-{{ item.name }}-deployment-vllm"
namespace: "{{ kubernetes_namespace }}"
wait: true
wait_condition:
type: Available
status: "True"
wait_timeout: 1800
loop: "{{ vllm_models | selectattr('enabled', 'equalto', true) | list }}"
loop_control:
label: "{{ item.name }}"
Templates / Values #
k8s_vllm/templates/helm-values.yml.j2
servingEngineSpec:
enableEngine: true
runtimeClassName: "{{ vllm_runtime_class }}"
imagePullPolicy: "{{ vllm_image_pull_policy }}"
vllmApiKey:
secretName: vllm-stack-credentials
secretKey: "VLLM_API_KEY"
modelSpec: {{ vllm_model_spec | to_json }}
startupProbe:
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 180
httpGet:
path: /health
port: 8000
serviceMonitor:
enabled: {{ vllm_service_monitor_enabled | bool | to_json }}
# Router (single OpenAI-compatible endpoint for all models)
routerSpec:
enableRouter: true
replicaCount: 1
serviceType: ClusterIP
routingLogic: "{{ vllm_router_routing_logic }}"
vllmApiKey:
secretName: vllm-stack-credentials
secretKey: "VLLM_API_KEY"
serviceMonitor:
enabled: {{ vllm_service_monitor_enabled | bool | to_json }}
ingress:
enabled: false
route:
main:
enabled: true
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
hostnames:
- "{{ vllm_hostname }}"
parentRefs:
- name: "{{ gateway_name }}"
namespace: "{{ gateway_namespace }}"
sectionName: "{{ gateway_section }}"
# Chart's built-in rule: only /health is public (no timeout needed)
matches:
- path:
type: Exact
value: /health
# OpenAI API (/v1/...) with a long request timeout for streaming answers
additionalRules:
- matches:
- path:
type: PathPrefix
value: /v1
timeouts:
request: "{{ vllm_route_timeout }}"
backendRefs:
- name: "{{ helm_release_name }}-router-service"
port: 80
# Optional components
cacheserverSpec:
enabled: false
loraController:
enableLoraController: false
sharedPvcStorage:
enabled: false
grafanaDashboards:
enabled: false
kube-prometheus-stack:
enabled: false
prometheus-adapter:
enabled: false
Kubernetes Resources #
List Resources #
# List default resources
kubectl -n vllm get all
# Shell output:
NAME READY STATUS RESTARTS AGE
pod/vllm-deployment-router-77d957d878-txwj7 1/1 Running 0 23m
pod/vllm-qwen38-27b-deployment-vllm-774f6bf88f-7rzh2 1/1 Running 0 9m10s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/vllm-qwen38-27b-engine-service ClusterIP 10.201.72.15 <none> 80/TCP,55555/TCP,9999/TCP 23m
service/vllm-router-service ClusterIP 10.201.204.115 <none> 80/TCP,9000/TCP 23m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/vllm-deployment-router 1/1 1 1 23m
deployment.apps/vllm-qwen38-27b-deployment-vllm 1/1 1 1 23m
NAME DESIRED CURRENT READY AGE
replicaset.apps/vllm-deployment-router-77d957d878 1 1 1 23m
replicaset.apps/vllm-qwen38-27b-deployment-vllm-774f6bf88f 1 1 1 23m
# List PVC
kubectl -n vllm get pvc
# Shell output:
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE
vllm-qwen38-27b-storage-claim Bound pvc-82e02e07-2672-4f6a-b191-19e2ef0b67dd 50Gi RWO local-path <unset> 23m
# List HTTPRoute
kubectl -n vllm get httproute
# Shell output:
NAME HOSTNAMES AGE
vllm-router ["vllm.jklug.work"] 23m
List Logs #
# List serving enginle logs
kubectl -n vllm logs -f deploy/vllm-qwen38-27b-deployment-vllm
vLLM API #
# Export vLLM auth variables
export VLLM_URL="https://vllm.jklug.work"
export VLLM_API_KEY="458ec49c7d702f8d45202870eab1b4a00c03597d505cbe6e43d52e25f7900dfb"
Check Health #
# Check status
curl -s -w "\nHTTP %{http_code}\n" "$VLLM_URL/health"
# Shell output:
{"status":"healthy"}
HTTP 200
List Models #
# List currently served models
curl -s "$VLLM_URL/v1/models" \
-H "Authorization: Bearer $VLLM_API_KEY" | jq -r '.data[].id'
# Shell output:
unsloth/Qwen3.8-27B-NVFP4
GPU Usage #
# Verify GPU usage
nvidia-smi
# Shell output:
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 595.112.07 Driver Version: 595.112.07 CUDA Version: 13.2 |
+-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 5070 Ti On | 00000000:01:00.0 Off | N/A |
| 30% 51C P1 167W / 300W | 13370MiB / 16303MiB | 99% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
| 1 NVIDIA GeForce RTX 5070 Ti On | 00000000:16:00.0 Off | N/A |
| 30% 48C P1 158W / 300W | 13370MiB / 16303MiB | 96% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| 0 N/A N/A 27937 C VLLM::Worker_TP0 13360MiB |
| 1 N/A N/A 27938 C VLLM::Worker_TP1 13360MiB |
+-----------------------------------------------------------------------------------------+
Scale Down and Up #
# Scale down
kubectl -n vllm scale deploy --all --replicas=0
# Scale up
kubectl -n vllm scale deploy --all --replicas=1
kubectl -n vllm rollout status deploy/vllm-qwen38-27b-deployment-vllm --timeout=30m