Kubernetes Horizontal Pod Autoscaler (also HPA) automatically scales the number of pods in a replication controller, deployment or replica set based on observed resource metrics or custom metrics.
Questions tagged [kubernetes-hpa]
36 questions
17
votes
1 answer
How does pod replica scaling down work in Kubernetes Horizontal Pod Autoscaler?
My understanding is that in Kubernetes, when using the Horizontal Pod Autoscaler, if the targetCPUUtilizationPercentage field is set to 50%, and the average CPU utilization across all the pod's replicas is above that value, the HPA will create more…

pkout
- 6,430
- 2
- 45
- 55
8
votes
4 answers
HPA scale down not happening properly
I have created HPA for my deployment, it’s working fine for scaling up to max replicas (6 in my case), when load reduces its scale down to 5 but it supposed to come to my original state of replicas (1 in my case) as load becomes normal . I have…

Lakshmi Reddy
- 187
- 2
- 4
- 11
7
votes
4 answers
Horizontal pod Autoscaler scales custom metric too aggressively on GKE
I have the below Horizontal Pod Autoscaller configuration on Google Kubernetes Engine to scale a deployment by a custom metric - RabbitMQ messages ready count for a specific queue: foo-queue.
It picks up the metric value correctly.
When inserting 2…

Erez Ben Harush
- 833
- 9
- 26
6
votes
3 answers
Helm stable/nginx-ingress with autoscaling, HPA couldn't read CPU or memory metrics
I install the latest version (1.24.5) of stable/nginx-ingress with autoscaling: true on a GKE cluster.
After finish deploying, HPA said that unable to read all metrics.
Can you help me to debug and fix it? If there is any more detail/log do you…

Quoc-Anh Nguyen
- 4,798
- 1
- 22
- 34
3
votes
1 answer
Kubernetes HPA and Scaling Down
I have a kubernetes HPA set up in my cluster, and it works as expected scaling up and down instances of pods as the cpu/memory increases and decreases.
The only thing is that my pods handle web requests, so it occasionally scales down a pod that's…

harbinja
- 918
- 8
- 15
2
votes
0 answers
How can I control scale down of pods based on AZ zones in kubernetes HPA (Horizontal Pod Autoscaler)?
I am trying to load balance EKS cluster pods according to Availability Zones.
I have configured "topologySpreadConstraints" in deployment for pod scale-up which works fine
spec:
topologySpreadConstraints:
- maxSkew: 1
topologyKey:…

Nitesh Nayak
- 21
- 1
2
votes
1 answer
KEDA - how does redis listLength scale pods (in detail)
The docs for listLength in the redis trigger are quite confusing. From reading around and experimenting it seems like listLength is the threshold over which a new pod should be created. Ie. if the listLength is 16, a pod will be spun up when there…

Happy Machine
- 987
- 8
- 30
2
votes
3 answers
Kubernetes autoscaling policies not working
I've added some scaling policies to my HorizontalPodAutoscaler but they are not being applied. The scaleUp and scaleDown behaviours are being ignored. I need a way to stop pods scaling up and down every few minutes in response to small CPU spikes.…

Mikhail Janowski
- 4,209
- 7
- 28
- 40
2
votes
2 answers
Prevent K8S HPA from deleting pod after load is reduced
I have sidekiq custom metrics coming from prometheus adapter. Using thoes queue metrics from prometheus i have setup HPA. When jobs in queue in sidekiq goes above say 1000 jobs HPA triggers 10 new pods. Then each pod will execute 100 jobs in queue.…

Hb_1993
- 23
- 5
2
votes
0 answers
Prometheus Adapter empty custom metric items
I'm attempting to auto-scale a Kubernetes deployment with an HPA using Prometheus custom metrics with the Prometheus Adapter. These custom metrics are published to Prometheus via another deployment in another namespace which every minute queries a…

brad142
- 345
- 1
- 2
- 10
1
vote
1 answer
How to extract the active HPA in Kubernetes using go-lang
I am using a kube config file to fetch the pod CPU and MEM data using go-lang. I am stuck to fetch the HPA details, i.e I am trying to write the equivalent of "kubectl get hpa", so I can know I have applied hpa to known services or not.
Any help on…

abinash
- 13
- 3
1
vote
1 answer
Kubernetes scale down particular pod
I have a Kubernetes deployment which can have multiple replica pods. I wish to horizontally increase and decrease the pods based on some logic in my python application (not custom metrics in hpa).
I have two ways to this:
Using Horizontal Pod…

user5155835
- 4,392
- 4
- 53
- 97
1
vote
3 answers
Kubernetes HPA Auto Scaling Velocity
We have defined HPA for an application to have min 1 and max 4 replicas with 80% cpu as the threshold.
What we wanted was, if the pod cpu goes beyond 80%, the app needs to be scaled up 1 at a time.
Instead what is happening is the application is…

P Ekambaram
- 15,499
- 7
- 34
- 59
1
vote
2 answers
HPA using Kafka Exporter in on premise Kubernetes cluster
I had been trying to implement Kubernetes HPA using Metrics from Kafka-exporter. Hpa supports Prometheus, so we tried writing the metrics to prometheus instance. From there, we are unclear on the steps to do. Is there an article where it will…

Jagadheeswaran Mohan
- 339
- 1
- 3
- 18
1
vote
1 answer
What is most efficient way to keep "idempotentcy" when applying manifest files to deployments that have horizontal autoscalers applied to them?
Let's say you have a CI/CD pipeline, and as part of that pipeline you have a deployment manifest file where you change some values and redeploy.
On the other hand your deployment is also horizontally autoscaled which works by modifying your…

Ulukai
- 1,360
- 2
- 12
- 17