#azure (2021-03)

azure

Archive: https://archive.sweetops.com/azure/

2021-03-28

2021-03-15

2021-03-13

2021-03-11

2021-03-10

2021-03-09

2021-03-08

Padarn avatar
Padarn

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

Padarn avatar
Padarn

seem not yet

Pierre-Yves avatar
Pierre-Yves

Hello @, 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)
    }
Pierre-Yves avatar
Pierre-Yves

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
    ]
  }
Padarn avatar
Padarn

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

Padarn avatar
Padarn

(maybe just merged)

Padarn avatar
Padarn

and this is the only one we wants

Pierre-Yves avatar
Pierre-Yves
Release v2.51.0 · terraform-providers/terraform-provider-azurerm

FEATURES: New Resource: azurerm_purview_account (#10395) New Resource: azurerm_data_factory_dataset_parquet (#10852) New Resource: azurerm_security_center_server_vulnerability_assessment (#10030) …

Pierre-Yves avatar
Pierre-Yves

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

Pierre-Yves avatar
Pierre-Yves

I have found some tips here https://github.com/Azure/AKS/issues/1931

Add support for priority based expander in cluster autoscaler · Issue #1931 · Azure/AKS

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…

Padarn avatar
Padarn

thanks @Pierre-Yves

Padarn avatar
Padarn

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

Padarn avatar
Padarn

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

Pierre-Yves avatar
Pierre-Yves

your goal is to take advantage of spot instances ?

Padarn avatar
Padarn

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

Pierre-Yves avatar
Pierre-Yves

ok i see

    keyboard_arrow_up