Search code examples
azureload-balancingazure-aksdiagnostics

How to enable diagnostics in both AKS load balancers after AKS creation in Terraform?


I'm using Terraform to create an AKS cluster.

During the creation, only the Azure external load balancer, called "kubernetes" is set up, so I can get its ID and enable diagnostics on it.

However, the Azure internal load balancer is only created after the first k8s LoadBalancer service with the proper annotation is set up, so I can't enable diagnostics on it programmatically from the beginning.

Is there any way to achieve this? (Other than creating a dummy service and configuring the internal load balancer after that)

Thanks


Solution

  • If you are looking for creating AKS clusture with Internal Load Balancer without or before creating the load balancer. So, its not possible.

    Terraform Code for creating AKS clusture,you can see that its set the network_profile of the AKS cluster like this:

    network_profile {
    
        network_plugin = "azure"
    
        service_cidr = "172.100.0.0/24"
    
        dns_service_ip = "172.100.0.10"
    
        docker_bridge_cidr = "172.101.0.1/16"
    
        load_balancer_sku = "standard"
    
      }
    

    And you set the property load_balancer_sku, it will create a standard type Load Balancer for you. And this property only can use the value basic and standard. So it seems it's impossible to create the AKS cluster without a Load Balancer. And you can see the issue in Github. As it said, the newest CLI also cannot help you achieve that.

    You can refer this thread in which other user has encourter same kind of issue.