Skip to main content
Version: 6.13.0

Setting up Cluster Autoscaler per node group

SmoothGlue has the capability to automatically scale up node groups to handle increased load as well as scale down node groups when the load reduces. By, default, when automatic scaling is enabled, all node groups will automatically scale according to load.

SmoothGlue will allow you to specify which node groups you want to automatically be scaled according to load. For example, you can set the primary node group to be a specific, static size and an additional node group dedicated to GitLab runners to be autoscaling based upon runner demand.

Node Group Configuration

When setting up node groups, you must specify a name for the node group. Here we are specifying an additional node group to be created, gitlab-runners.

locals {
cluster_inputs = {
additional_eks_managed_node_groups = {
gitlab-runners = {
# node group configuration
}
}
}
}

The default behavior is to automatically scale ALL node groups, so you will only need to set cluster_autoscaler_enabled to true:

locals {
cluster_inputs = {
cluster_autoscaler_enabled = true
}
}

To completely disable autoscaling, set cluster_autoscaler_enabled to false:

locals {
cluster_inputs = {
cluster_autoscaler_enabled = false
}
}

If you want to selectively autoscale ONLY specific node groups, enable autoscaling and then identify each node group you wish to autoscale. The default node group's name is structsure-nodes.

locals {
cluster_inputs = {
cluster_autoscaler_enabled = true

cluster_autoscaler_asgs = ['gitlab-runners'] # only scale the gitlab-runners node group
cluster_autoscaler_asgs = ['structsure-nodes'] # only scale the default node group
}
}

If you wish to disable the default node group (i.e. because you have specified one with a different configuration you would like to use), you can set the disable_default_node_groups option to true

Terragrunt Apply

Once the necessary configuration values are updated in the HCL config files, you will need to run terragrunt to update the actual infrastructure. First run terragrunt init and then terragrunt apply in with the same process and values as when initially creating the cluster.

In the change set for the terragrunt apply, node group ASG tags will be created or updated based upon the value for cluster_autoscaler_enabled and the values in cluster_autoscaler_asgs