#azure (2021-03)
Archive: https://archive.sweetops.com/azure/
2021-03-08

hi all, does anyone know if its possible to set AKS node autoscaling configs in the terraform resource?

seem not yet

Hello @Padarn, it is
default_node_pool {
availability_zones = []
enable_auto_scaling = true
enable_node_public_ip = false
max_count = 3
max_pods = 30
min_count = 2
name = "${var.prefix}${var.env}kubo"
node_count = var.agent_count
node_taints = []
node_labels = {
env = var.env
}
and it will set you default values that you can then customize
auto_scaler_profile {
balance_similar_node_groups = (known after apply)
max_graceful_termination_sec = (known after apply)
scale_down_delay_after_add = (known after apply)
scale_down_delay_after_delete = (known after apply)
scale_down_delay_after_failure = (known after apply)
scale_down_unneeded = (known after apply)
scale_down_unready = (known after apply)
scale_down_utilization_threshold = (known after apply)
scan_interval = (known after apply)
}

also as your number of node will scale you need to prevent terraform to change node value back to the code with:
lifecycle {
ignore_changes = [
default_node_pool[0].node_count
]
}

thanks @Pierre-Yves unfortunately the expander
config is not in the TF provider yet

(maybe just merged)

and this is the only one we wants

you will not have to wait for long ! https://github.com/terraform-providers/terraform-provider-azurerm/pull/10777

@Padarn it seems your are lucky https://github.com/terraform-providers/terraform-provider-azurerm/releases/tag/v2.51.0
FEATURES: New Resource: azurerm_purview_account (#10395) New Resource: azurerm_data_factory_dataset_parquet (#10852) New Resource: azurerm_security_center_server_vulnerability_assessment (#10030) …

does your plan is to use expander with price strategy and spot nodes ?

I have found some tips here https://github.com/Azure/AKS/issues/1931
According to the documentation AKS currently supports only: most-pods, random, least-waste values for expander. It would be great to be able to pick priority and manually provide kube-system/cluste…

thanks @Pierre-Yves

I actually found that this didn’t work (I managed to apply it). I spoke to microsoft support but they were not helpful at all

I’ve resorted to running the cluster-autoscaler myself (it was actually quite easy) and its working great now

your goal is to take advantage of spot instances ?

No actually my goal was to do bin packing with GPU machines

ok i see