You hit the exact reason GPU SM utilization is useless for LLM autoscaling: decode is memory-bandwidth bound, so 1 concurrent sequence saturates SM cycles just like 32 sequences.
The production standard for vLLM Kubernetes HPA is exposing vLLM's built-in /metrics endpoint via Prometheus Adapter and scaling on vllm:num_requests_waiting (queue depth) + vllm:gpu_cache_usage_perc (KV-cache pressure).
1. Configure prometheus-adapter Custom Metric Rules
Map vLLM's native Prometheus gauges to Kubernetes custom.metrics.k8s.io/v1beta1:
# prometheus-adapter values.yaml
rules:
custom:
- seriesQuery: 'vllm:num_requests_waiting{namespace!="",pod!=""}'
resources:
overrides:
namespace: {resource: "namespace"}
pod: {resource: "pod"}
name:
matches: "^vllm:num_requests_waiting$"
as: "vllm_requests_waiting"
metricsQuery: 'avg_over_time(<<.Series>>{<<.LabelMatchers>>}[1m])'
- seriesQuery: 'vllm:gpu_cache_usage_perc{namespace!="",pod!=""}'
resources:
overrides:
namespace: {resource: "namespace"}
pod: {resource: "pod"}
name:
matches: "^vllm:gpu_cache_usage_perc$"
as: "vllm_gpu_cache_usage_perc"
metricsQuery: 'avg_over_time(<<.Series>>{<<.LabelMatchers>>}[1m])'
(Using avg_over_time(...[1m]) prevents micro-bursts from triggering premature GPU pod spin-ups.)
2. HPA Manifest with Asymmetric Scale-Down Stabilization
Because vLLM pods take 45–90 seconds to load 70B weights into VRAM, always set a generous stabilizationWindowSeconds: 600 on scaleDown so you don't evict warm pods right before the next request wave:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: vllm-llama-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: vllm-llama-70b
minReplicas: 2
maxReplicas: 10
behavior:
scaleUp:
stabilizationWindowSeconds: 30
policies:
- type: Pods
value: 2
periodSeconds: 60
scaleDown:
stabilizationWindowSeconds: 600 # Keep warm GPU weights for 10 mins
policies:
- type: Pods
value: 1
periodSeconds: 180
metrics:
- type: Pods
pods:
metric:
name: vllm_requests_waiting
target:
type: AverageValue
averageValue: "3" # Scale up when >3 requests wait per pod
- type: Pods
pods:
metric:
name: vllm_gpu_cache_usage_perc
target:
type: AverageValue
averageValue: "750m" # 0.75 (75% KV-cache saturation)
With vllm_requests_waiting + vllm_gpu_cache_usage_perc and a 10-minute scale-down window, your cluster scales cleanly ahead of KV-cache exhaustion with zero oscillation.