Azure DevOps Fails to Create Pipeline to AKS Cluster Due to Remote Name Resolution

Chris Sheridan 0 Reputation points
2024-01-17T23:17:32.65+00:00

I am unable to build an Azure DevOps pipeline to a private AKS cluster. When it tries to create the pipeline, it errors out with the message:

The remote name could not be resolved: '

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
42,737 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Chris Sheridan 0 Reputation points
    2024-02-01T17:15:53.2533333+00:00

    This is relevant for Azure DevOps, GitHub Actions, or using kubectl via the CLI to interact with a private AKS cluster. I received an error message stating, "Unable to connect to the server: dial tcp: lookup <Cluster Name>-dns-rrxn45oq.19568f79-2d23-4df0-8d3e-f7e3e690d17b.privatelink.eastus.azmk8s.io on <Private DNS IP>:53: no such host"

    I figured this out. If anyone is getting this error running kubectl from a vnet different than the cluster's vnet, you need to ensure the following:

    • The vnets are peered. I tried otherwise but the nslookup showed it was lost in trying to resolve the IP address, especially if IPs overlap.
    • The Private DNS zone created by the AKS cluster installation has a Virtual Network Link to the vnet where you run kubectl. To do this, perform the following:
      • Select to Private DNS zones from your Azure Portal Homepage (for me, it was: https://portal.azure.com/#view/HubsExtension/BrowseResource/resourceType/Microsoft.Network%2FprivateDnsZones).
      • Click on the Private DNS zone AKS created. In my case, it was "19568f79-2d23-4df0-8d3e-f7e3e690d17b.privatelink.eastus.azmk8s.io".
      • Click on Virtual network links (under Settings in left-side pane).
      • Click on the "+Add" button.
      • Complete the form with your link name and select the virtual network you want to run kubectl (or Azure DevOps or your private GitHub Actions runner) from.
      • Once completed, you can test running kubectl from a VM inside the vnet (you first need to run az aks get-credentials first).
      Good luck!
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.