Prompt
Why is Kubernetes not scaling my pods?
Latest observation
There are a few common reasons Kubernetes won’t scale pods, and the exact cause depends on whether you mean HPA, Cluster Autoscaler, or a manual kubectl scale.
1) The Deployment/ReplicaSet is already at its configured replica count
If you set spec.replicas: 3, Kubernetes won’t increase it unless something else tells it to.
Check:
kubectl get deploy
kubectl describe deploy <name>
2) HPA is not configured, or it has no valid metrics
If you expect automatic pod scaling, an Horizontal Pod Autoscaler (HPA) must exist and be working.
Check:
kubectl get hpa
kubectl describe hpa <name>
Common issues:
- Metrics server is missing or broken
- CPU/memory requests are not set on the container
- No target metric is defined correctly
- HPA is in “unknown” or “unable to get metrics” state
3) Your pods don’t have resource requests
For CPU-based HPA, Kubernetes needs resources.requests.cpu to calculate utilization.
Example:
resources:
requests:
cpu: "100m"
memory: "128Mi"
Without requests, HPA often can’t scale properly.
4) Cluster Autoscaler can’t add nodes
If pods are pending because there’s no room, Kubernetes may try to add nodes only if Cluster Autoscaler is installed and cloud permissions are correct.
Check:
kubectl get pods -n kube-system
kubectl describe pod <pending-pod>
Look for:
Insufficient cpuInsufficient memory- Node group limits reached
- Autoscaler not installed or misconfigured
5) Pod anti-affinity, node selectors, taints, or tolerations block scheduling
Even if Kubernetes wants to create more pods, they may not schedule.
Check pod events:
kubectl describe pod <pod-name>
Look for:
node(s) didn't match Pod's node affinity/selectorhad taint ... that the pod didn't toleratedidn't match pod anti-affinity rules
6) HPA is being throttled by min/max limits
An HPA won’t scale beyond:
minReplicasmaxReplicas
Check:
kubectl describe hpa <name>
7) The workload type doesn’t support the scaling you expect
For example:
Deployment,ReplicaSet,StatefulSetscale differently- A
Jobis not meant for horizontal scaling the same way - A custom controller may be overwriting replica counts
8) There’s a delay
Scaling is not always immediate. HPA evaluates periodically, and new pods also need time to become ready.
Quick triage commands
Run these and look at the output:
kubectl get hpa
kubectl describe hpa <name>
kubectl get deploy <name> -o yaml
kubectl describe deploy <name>
kubectl get pods
kubectl describe pod <pod-name>
kubectl get events --sort-by=.metadata.creationTimestamp
If you want, I can help diagnose it
Paste the output of:
kubectl get hpa
kubectl describe hpa <name>
kubectl describe deploy <name>
kubectl get pods -o wide
kubectl get events --sort-by=.metadata.creationTimestamp | tail -50
and I’ll help pinpoint why it isn’t scaling.