Skip to content

Commit

Permalink
Fix for ACI connector
Browse files Browse the repository at this point in the history
  • Loading branch information
atiterlea committed Aug 15, 2023
1 parent d037816 commit e2735f3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion infra/live/azure/linux-public/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ inputs = {
priority = {
spot_enabled = false
}
labels = {
node_labels = {
"environment" = "build"
}
}
Expand Down
2 changes: 1 addition & 1 deletion infra/modules/azure/aks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ resource "azurerm_kubernetes_cluster_node_pool" "self" {
node_count = each.value.auto_scaler_profile.enabled ? null : each.value.node_count
max_count = each.value.auto_scaler_profile.enabled ? each.value.auto_scaler_profile.max_node_count : null
zones = each.value.zones
node_labels = each.value.labels
node_labels = each.value.node_labels
# enable_host_encryption = true <- not enabled at the subscription level
priority = each.value.priority.spot_enabled ? "Spot" : "Regular"
spot_max_price = each.value.priority.spot_enabled ? each.value.priority.spot_price : null
Expand Down
4 changes: 2 additions & 2 deletions infra/modules/azure/aks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ variable "additional_node_pools" {
spot_enabled = bool
spot_price = optional(number, -1)
})
zones = optional(list(string), ["1", "2", "3"])
labels = optional(map(string), {})
zones = optional(list(string), ["1", "2", "3"])
node_labels = map(string)
}))
default = {}
}
Expand Down
12 changes: 12 additions & 0 deletions infra/modules/azure/network/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ resource "azurerm_subnet" "self" {
resource_group_name = data.azurerm_resource_group.self.name
virtual_network_name = azurerm_virtual_network.self.name
address_prefixes = [var.subnets[count.index].address_prefix]

dynamic "delegation" {
for_each = var.subnets[count.index].name == "aci" ? [1] : []

content {
name = "aciDelegation"
service_delegation {
name = "Microsoft.ContainerInstance/containerGroups"
actions = ["Microsoft.Network/virtualNetworks/subnets/action"]
}
}
}
}

locals{ #ignore firewall and gateway subnets for security group association
Expand Down
3 changes: 2 additions & 1 deletion infra/src/azure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ variable "additional_node_pools" {
spot_enabled = bool
spot_price = optional(number, -1)
})
zones = optional(list(string), ["1", "2", "3"])
zones = optional(list(string), ["1", "2", "3"])
node_labels = map(string)
}))
description = "Additional node pools to create"

Expand Down

0 comments on commit e2735f3

Please sign in to comment.