Azure / AKS

Azure Kubernetes Service
https://azure.github.io/AKS/
1.96k stars 306 forks source link

Feature request: Support for setting multiple expanders for AKS autoscaler #2610

Open yaraskm opened 2 years ago

yaraskm commented 2 years ago

The Cluster Autoscaler allows multiple expander profiles to be used at once, so that if the first expander matches more than one Node Pool, the next expander is used to narrow down the selection.

Currently however, the REST API requires that only one expander can be set:

"expander": {
              "type": "string",
              "enum": [
                "least-waste",
                "most-pods",
                "priority",
                "random"
              ],
              "x-ms-enum": {
                "name": "expander",
                "modelAsString": true,
                "values": [
                  {
                    "value": "least-waste",
                    "description": "Selects the node group that will have the least idle CPU (if tied, unused memory) after scale-up. This is useful when you have different classes of nodes, for example, high CPU or high memory nodes, and only want to expand those when there are pending pods that need a lot of those resources."
                  },
                  {
                    "value": "most-pods",
                    "description": "Selects the node group that would be able to schedule the most pods when scaling up. This is useful when you are using nodeSelector to make sure certain pods land on certain nodes. Note that this won't cause the autoscaler to select bigger nodes vs. smaller, as it can add multiple smaller nodes at once."
                  },
                  {
                    "value": "priority",
                    "description": "Selects the node group that has the highest priority assigned by the user. It's configuration is described in more details [here](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/expander/priority/readme.md)."
                  },
                  {
                    "value": "random",
                    "description": "Used when you don't have a particular need for the node groups to scale differently."
                  }
                ]
              },
              "title": "The expander to use when scaling up",
              "description": "If not specified, the default is 'random'. See [expanders](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders) for more information."
            },

This API should be expanded to allow a list of profiles to be active at once.

This came up through a feature request on the azurerm Terraform provider

ghost commented 2 years ago

Hi yaraskm, AKS bot here :wave: Thank you for posting on the AKS Repo, I'll do my best to get a kind human from the AKS team to assist you.

I might be just a bot, but I'm told my suggestions are normally quite good, as such: 1) If this case is urgent, please open a Support Request so that our 24/7 support team may help you faster. 2) Please abide by the AKS repo Guidelines and Code of Conduct. 3) If you're having an issue, could it be described on the AKS Troubleshooting guides or AKS Diagnostics? 4) Make sure your subscribed to the AKS Release Notes to keep up to date with all that's new on AKS. 5) Make sure there isn't a duplicate of this issue already reported. If there is, feel free to close this one and '+1' the existing issue. 6) If you have a question, do take a look at our AKS FAQ. We place the most common ones there!

ghost commented 2 years ago

Triage required from @Azure/aks-pm

ghost commented 2 years ago

Action required from @Azure/aks-pm

phillebaba commented 2 years ago

Could we get some eyes on this? Not having the ability to set multiple expanders makes the use of spot instances a lot more difficult.

ghost commented 2 years ago

Action required from @Azure/aks-pm

ghost commented 2 years ago

Issue needing attention of @Azure/aks-leads

ghost commented 2 years ago

Issue needing attention of @Azure/aks-leads

ghost commented 2 years ago

Issue needing attention of @Azure/aks-leads

MattKotsenas commented 1 year ago

Hi there! Commenting to also voice our request for this feature. In our case we'd like to minimize cost by using --expander=priority,least-waste. Without combining expanders, we either end up with underutilized nodes (by just using priority) or choosing more expensive over cheaper SKUs (which we're encoding via priority).

If you have any questions or concerns about the scenario, I'm happy to discuss. Thanks!