hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.6k stars 4.64k forks source link

Terraform created AKS Kubenet cluster doesn't link routetable to App gateway subnet #15307

Open rogerm-chen opened 2 years ago

rogerm-chen commented 2 years ago

Community Note

Terraform (and AzureRM Provider) Version

provider registry.terraform.io/hashicorp/azurerm v2.94.0 Terraform v1.0.4

Affected Resource(s)

Terraform Configuration Files

addon_profile { http_application_routing { enabled = var.http_application_routing_enabled }

azure_policy {
  enabled = var.azure_policy_enabled
}

oms_agent {
  enabled                    = var.monitoring_insights_enabled
  log_analytics_workspace_id = var.log_analytics_workspace_id
}

ingress_application_gateway {
  enabled      = var.ingress_application_gateway_enabled
  subnet_id    = var.ingress_agic_subnet == null ? null : data.azurerm_subnet.ingress_agic_subnet[0].id
  gateway_name = var.ingress_application_gateway_name
  gateway_id   = var.ingress_application_gateway_id

}

}

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp

Debug Output

Panic Output

Expected Behaviour

As per kubenet: associate route table to appgw subnet when creating AGIC for kubenet AKS, the routetable for AKS should be automatically linked to app gateway subnet.

Actual Behaviour

the AKS subnet routetable is not attached to APP gateway subnet, even they are in the same vnet

Steps to Reproduce

  1. terraform apply

Important Factoids

References

stephybun commented 8 months ago

Thanks for opening this issue @rogerm-chen.

Since this issue pertains to the last major version of the provider and the above config is no longer valid. Would you be able to confirm whether you still observe this behaviour with the latest version of the provider?

xQuai commented 3 months ago

Hi, I can confirm that the problem still exists. I have set up a Kubernetes cluster with the Kubenet and an application gateway with the corresponding Ingress controller in the cluster. I had to manually add the route table to the subnet of the application gateway.

I used the following versions: