Ensure that auto-scaling is enabled for Azure Kubernetes Cluster

MEDIUM

Description

Azure Kubernetes Cluster has auto-scaling disabled, this may make infrastructure less resilient.

Remediation

In Azure Console -

  1. Open the Azure Portal and go to Kubernetes Services.
  2. Choose the cluster you wish to edit.
  3. Under Settings, choose Node pools.
  4. Select the node pool you wish to edit.
  5. Select the Scale node pool button.
  6. Set Scale Method to Autoscale and set the minimum and maximum node count as needed.
  7. Select Apply.

In Terraform -

  1. In the azurerm_kubernetes_cluster resource, create a default_node_pool block.
  2. Set the field default_node_pool.enable_auto_scaling to true.
  3. Set the max_count and min_count fields as needed.

References:
https://learn.microsoft.com/en-us/azure/aks/cluster-autoscaler
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster#enable_auto_scaling

Policy Details

Rule Reference ID: AC_AZURE_0223
CSP: Azure
Remediation Available: Yes
Domain: Resilience
Resource Category: Compute

Frameworks