Cannot install cluster autoscaler manually in an AKS cluster

AnonymousHeart 0 Reputation points
2023-05-08T09:31:57.1933333+00:00

I want to install Cluster AutoScaler for an AKS Cluster manually (not enable cluster autoscale) but it doesn't work.

I tied many ways: using helm chart, using yaml files, but no one works.

I referred to some examples here:

https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/azure/examples/cluster-autoscaler-vmss.yaml
https://www.djmolding.com/
https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/azure/examples/cluster-autoscaler-aks.yaml https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/azure/examples/cluster-autoscaler-autodiscover.yaml

I checked logs of cluster autoscaler pod, it has following messages:

Failed to scale up: Could not compute total resources: No node info for: agentpool

Is there any solution for this?

Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,447 questions
{count} votes

2 answers

Sort by: Most helpful
  1. vipullag-MSFT 26,487 Reputation points Moderator
    2023-05-11T04:29:18.83+00:00

    Hello AnonymousHeart

    Welcome to Microsoft Q&A Platform, thanks for posting your query here.

    As per the documentation (https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler/cloudprovider/azure#deployment-manifests), the only method supported by AKS is via "az aks" command:

    The first two options (vmss and standard) are for aks-engine, which a different product than AKS managed solution.

    User's image

    Hope that helps.

    0 comments No comments

  2. VasimTamboli 5,215 Reputation points
    2023-05-14T10:01:35.02+00:00

    The error message you're encountering, "Failed to scale up: Could not compute total resources: No node info for: agentpool," indicates that the Cluster Autoscaler is unable to retrieve information about the nodes in your AKS cluster. This can happen if there is an issue with the configuration or if the Cluster Autoscaler is not properly deployed.

    To troubleshoot this issue, you can follow these steps:

    Verify that the Cluster Autoscaler deployment is correctly configured with the appropriate parameters. Ensure that you have set the correct values for the minimum and maximum number of nodes, as well as any other required configuration options.

    Check if the Cluster Autoscaler is running as a pod in your cluster. You can use the following command to list all the pods in the cluster:

    sqlCopy code
    kubectl get pods --all-namespaces
    

    Look for a pod with a name like "cluster-autoscaler-xxxxx" and check its status and logs for any error messages:

    phpCopy code
    kubectl logs <pod-name> -n <namespace>
    

    Replace <pod-name> with the name of the Cluster Autoscaler pod and <namespace> with the namespace where it is deployed.

    Ensure that the Cluster Autoscaler has the necessary permissions to interact with the AKS cluster and scale nodes. The service principal used by the Cluster Autoscaler should have the appropriate RBAC roles assigned. Specifically, it should have the Reader role for the AKS cluster and the Virtual Machine Contributor role for the resource group containing the cluster.

    You can verify the roles assigned to the service principal using the Azure CLI:

    cssCopy code
    az role assignment list --assignee <service-principal-id>
    

    Replace <service-principal-id> with the ID of the service principal used by the Cluster Autoscaler.

    If you're using a virtual machine scale set (VMSS) for your AKS nodes, ensure that the VMSS is configured correctly and that it's associated with the AKS cluster. The Cluster Autoscaler relies on the VMSS for scaling nodes up and down.

    Double-check the configuration of the VMSS, such as the minimum and maximum number of instances, and ensure that it's in a healthy state.

    By going through these steps, you should be able to identify and resolve any issues preventing the Cluster Autoscaler from working correctly in your AKS cluster.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.