Reputation: 1136
while using both HPA and Cluster Autoscaler in Kubernetes, I have this scenario below.
Maximum 3 pods can fit into a single node. I have setup HPA min replica as 15, and max as 39. So, at first, I only had total 5 nodes which can accomodate all 15 pods. However, as load increases, more than 15 pods have spun up, triggering Cluster Autoscaler. When the peak time passed, HPA downsized pod number back to 15. Here, I originally hoped that HPA removes the pods in nodes where there were only 1 pod left, and hoped that Cluster (Node) size would return to 5. However, I found that total 9 nodes were left (6 nodes with 2 pods, and 3 nodes with 1 pod). For cost efficiency, I want 5 nodes to accomodate all 15 nodes.
Would this be possible? Thank you.
Upvotes: 1
Views: 173
Reputation: 5625
I think this is known about. Some projects such as https://github.com/kubernetes-sigs/descheduler have spun up to try to reoptimise spreads. I haven't checked out the descheduler yet, but it does sound like something that may help you.
Upvotes: 1