Kubernetes HPA Not Scaling: 6 Causes and Exact Fixes
HorizontalPodAutoscaler not scaling up or stuck at min replicas? These 6 fixes cover missing Metrics Server, wrong metric name, resource requests not set, and cooldown periods — with exact kubectl commands.
HPA (HorizontalPodAutoscaler) not scaling is one of those issues where nothing looks wrong but replicas stay at minimum. Here are the six most common causes, from most to least common.
Quick Diagnosis
# Check HPA status
kubectl describe hpa <hpa-name> -n <namespace>Cause 1: Metrics Server Not Installed
HPA for CPU/memory requires Metrics Server.
Fix:
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
kubectl top podsCause 2: Resource Requests Not Set
HPA calculates CPU utilization as actual_usage / requested. No request = formula breaks.
Fix:
resources:
requests:
cpu: "200m"
memory: "256Mi"
limits:
cpu: "1000m"
memory: "512Mi"Cause 3: HPA Cooldown Period
Default scale-down cooldown is 5 minutes.
behavior:
scaleDown:
stabilizationWindowSeconds: 60
scaleUp:
stabilizationWindowSeconds: 0Cause 4: Metric Below Target
kubectl get hpa -n production
# 40%/70% → no scale needed, HPA is working correctlyCause 5: Wrong Custom Metric Name
kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1/" | jq '.resources[].name'Cause 6: MaxReplicas Reached
kubectl patch hpa myapp-hpa -n production --type='json' \
-p='[{"op": "replace", "path": "/spec/maxReplicas", "value": 50}]'Correct HPA (autoscaling/v2)
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: myapp-hpa
namespace: production
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: myapp
minReplicas: 2
maxReplicas: 30
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80More Kubernetes autoscaling? Read our KEDA event-driven autoscaling guide and Kubernetes VPA vs HPA vs KEDA comparison.
Today I Fixed
Short real fixes from production — posted daily
Stay ahead of the curve
Get the latest DevOps, Kubernetes, AWS, and AI/ML guides delivered straight to your inbox. No spam — just practical engineering content.
Related Articles
Grafana Dashboard Panels Not Loading or Showing No Data Fix
Fix Grafana panels stuck on 'No data' or spinning forever. Covers datasource issues, time range mismatches, variable resolution failures, Prometheus scrape interval mismatches, and broken panel JSON.
Kubernetes HPA Not Scaling on Custom Metrics Fix
HPA scales on CPU but ignores your Prometheus or SQS custom metrics? Learn how the custom metrics adapter works, fix common errors, and use KEDA as a drop-in alternative.
Prometheus Alerts Not Firing: Every Cause and Fix
Your Prometheus alert should have fired 30 minutes ago but nothing happened. Here's every reason alerts silently fail — routing, inhibition, receivers, and rule syntax.