diff --git a/azurerm/_modules/aks/main.tf b/azurerm/_modules/aks/main.tf index 709de0bd..1caaa153 100644 --- a/azurerm/_modules/aks/main.tf +++ b/azurerm/_modules/aks/main.tf @@ -41,7 +41,6 @@ resource "azurerm_kubernetes_cluster" "current" { network_plugin = var.network_plugin network_policy = var.network_policy - docker_bridge_cidr = "172.17.0.1/16" service_cidr = var.service_cidr dns_service_ip = var.dns_service_ip pod_cidr = var.network_plugin == "azure" ? null : var.pod_cidr @@ -76,5 +75,10 @@ resource "azurerm_kubernetes_cluster" "current" { } } + workload_autoscaler_profile { + keda_enabled = var.keda_enabled + vertical_pod_autoscaler_enabled = var.vertical_pod_autoscaler_enabled + } + tags = var.metadata_labels } diff --git a/azurerm/_modules/aks/variables.tf b/azurerm/_modules/aks/variables.tf index ad217b45..1a9a0738 100644 --- a/azurerm/_modules/aks/variables.tf +++ b/azurerm/_modules/aks/variables.tf @@ -189,3 +189,16 @@ variable "availability_zones" { description = "The list of availability zones to create the node pool in" default = [] } + + +variable "keda_enabled" { + type = bool + description = "Whether KEDA Autoscaler should be enabled for the cluster." + default = false +} + +variable "vertical_pod_autoscaler_enabled" { + type = bool + description = "Whether Vertical Pod Autoscaler should be enabled for the cluster." + default = false +} \ No newline at end of file diff --git a/azurerm/cluster/configuration.tf b/azurerm/cluster/configuration.tf index ef95b794..0b81a2c3 100644 --- a/azurerm/cluster/configuration.tf +++ b/azurerm/cluster/configuration.tf @@ -66,4 +66,7 @@ locals { additional_metadata_labels_lookup = lookup(local.cfg, "additional_metadata_labels", "") additional_metadata_labels_tuples = [for t in split(",", local.additional_metadata_labels_lookup) : split("=", t)] additional_metadata_labels = { for t in local.additional_metadata_labels_tuples : t[0] => t[1] if length(t) == 2 } + + keda_enabled = lookup(local.cfg, "keda_enabled", false) + vertical_pod_autoscaler_enabled = lookup(local.cfg, "vertical_pod_autoscaler_enabled", false) } diff --git a/azurerm/cluster/main.tf b/azurerm/cluster/main.tf index 30cbd9db..a56b5425 100644 --- a/azurerm/cluster/main.tf +++ b/azurerm/cluster/main.tf @@ -66,4 +66,7 @@ module "cluster" { enable_log_analytics = local.enable_log_analytics availability_zones = local.availability_zones + + keda_enabled = local.keda_enabled + vertical_pod_autoscaler_enabled = local.vertical_pod_autoscaler_enabled }