HPA tự tăng/giảm số replicas dựa trên metrics như CPU, memory hoặc custom/external metrics. Nó cần Deployment/scale target, metrics pipeline và requests phù hợp để tính utilization có nghĩa.
Ví dụ:
bash
kubectl autoscale deployment api --cpu-percent=70 --min=2 --max=10HPA không tự giải quyết cold start, DB bottleneck hoặc queue backlog nếu metric sai.
Với queue-based workloads, custom metrics như queue length thường tốt hơn CPU.