azurerm_kubernetes_cluster currently supports SystemAssigned identities and service principals for AKS clusters. There is a new AKS preview feature that supports BYO identity: https://docs.microsoft.com/en-us/azure/aks/use-managed-identity#bring-your-own-control-plane-mi-preview which is a prerequisit for BYO routing table without service principals.
In an enterprise context this closes the loop of deploying AKS in a VNET with UDRs without the hassle of dealing with a service principal (and its credentials).
resource "azurerm_user_assigned_identity" "aks_identity" {
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
name = "aks_identity"
}
resource "azurerm_kubernetes_cluster" "example" {
name = "example-aks1"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
dns_prefix = "exampleaks1"
default_node_pool {
name = "default"
node_count = 1
vm_size = "Standard_D2_v2"
}
identity {
type = "UserAssigned"
id = azurerm_user_assigned_identity.aks_identity.id
}
tags = {
Environment = "Production"
}
}
I had a quick look at it. Initial dependency seems to be:
@flo-02-mu just a heads up that unfortunately we're blocked from using v45 of the Azure SDK since it's broken (and it appears we'll be blocked from using v46 too) - so we're blocked from upgrading to that API version (by nature of being blocked upgrading to the SDK) at present
@tombuildsstuff is there an upstream issue or azurerm issue that can be tracked/helped with if this is still blocked? It looks like a new SDK version was vendored recently that should allow this functionality to be added now?
I think the needed upgrade was released with https://github.com/terraform-providers/terraform-provider-azurerm/pull/8411 in 2.29.0
@tombuildsstuff Since the api and sdk are upgraded: Could you please remove the two labels?
is it still the case that this is blocked..?
Also, I believe this is now GA and not preview: https://github.com/Azure/AKS/releases/tag/2020-11-30
@jemag the docs mention as GA except for gov and China.
https://github.com/terraform-providers/terraform-provider-azurerm/issues/7979
Most helpful comment
is it still the case that this is blocked..?
Also, I believe this is now GA and not preview: https://github.com/Azure/AKS/releases/tag/2020-11-30