update annotation azure-dns-label-name of azure load balance service

dalaszidane 1 Reputation point
2022-06-27T08:28:56.177+00:00

I have setup a load balance service in my aks, and set annotation: service.beta.kubernetes.io/azure-dns-label-name: test
This is work, I could visit my service via test.westus3.cloudapp.azure.com.

serviceTemplates:  
       - name: chi-service-template  
         metadata:  
           annotations:  
              service.beta.kubernetes.io/azure-dns-label-name: test  
         spec:  
           ports:  
             - name: https  
               port: 8443  
           type: LoadBalancer  

And Then, I wanted to update azure-dns-label-name to "prod", so I update and rerun my yaml

 serviceTemplates:  
           - name: chi-service-template  
             metadata:  
               annotations:  
                  service.beta.kubernetes.io/azure-dns-label-name: prod  
             spec:  
               ports:  
                 - name: https  
                   port: 8443  
               type: LoadBalancer  

And I found annotation of the load-balance has changed to "prod" in azure portal, but dns didnot update.

I use "nslookup prod.west3.cloudapp.azure.com" , it return "ip4.network.microsoft.com can't find prod.westus3.cloudapp.azure.com: Non-existent domain"

and "nslookup test.west3.cloudapp.azure.com" still works return ip of my loadbalance service.

so my question is how to make dns name update work?

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,119 questions
Azure Load Balancer
Azure Load Balancer
An Azure service that delivers high availability and network performance to applications.
252 questions
Azure DNS
Azure DNS
An Azure service that enables hosting Domain Name System (DNS) domains in Azure.
395 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Knipper, David 6 Reputation points
    2022-07-26T16:15:55.367+00:00

    I had the same issue. Here's the solution.

    1. In the Azure Portal, go to your AKS resource.
    2. Click Properties.
    3. Click on the Infrastructure Resource Group.
    4. Find the public IP address for your AKS service and open it.
    5. Click Configuration.
    6. Change the DNS name label field.

    This won't update the annotation in the service, but at this point you probably don't need it anyway. However, I added it to save any future confusion.

    No comments