Search code examples
kuberneteskubernetes-helmamazon-eksautoscaling

Setting startup parameters for cluster-autoscaler in EKS


I have a kubernetes cluster running in AWS EKS, with the cluster-autoscaler [1] installed (using the helm provider for terraform [2]).

The cluster-autoscaler docs list a number of supported startup parameters[3], but it's not clear to me how to set them: can anybody point me in the right direction?

[1] https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler

[2] https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release

[3] https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-the-parameters-to-ca


Solution

  • Since you are deploying cluster-autoscaler with terraform helm provider you need to set additional parameters like you will do with helm chart.

    All parameters are passed here.

    Some example:

    resource "helm_release" "autoscaler" {
      name       = "cluster-autoscaler"
      repository = "https://kubernetes.github.io/autoscaler"
      chart      = "cluster-autoscaler"
    
      values = [
        "${file("values.yaml")}"
      ]
    
      set {
        name  = "extraArgs.leader-elect"
        value = "true"
      }
    
      set {
        name  = "extraArgs.scale-down-utilization-threshold"
        value = "0.8"
      }
    }
    

    As a bonus I would advise to move to Karpenter since it is much better option if you are on AWS.