Hi. Hoping you can asist with an AKS comms issue. I am new to Kubernetes. I can successfully deploy an AKS private cluster using Terraform, from a self-hosted Azure DevOps agent, but when the Terraform attempts to add Kubernetes namespaces, it fails to connect to the cluster DNS name on port 443, however it can communicate to the private IP address of the cluster on 443.
The Terraform works 100% when run locally, however fails when run from the ADO Agent:
Error: Post "https://<MYCLUSTERNAME>.privatelink.northeurope.azmk8s.io:443/api/v1/namespaces": dial tcp: lookup <MYCLUSTERNAME>.privatelink.northeurope.azmk8s.io: no such host
Test-NetConnection to the FQDN on 443 fails, however, Test-NetConnection to the private IP address on 443 passes
Is there a specific Azure IP range/subnet, that I need to open 443 from the ADO Agent in order to reach the AKS Cluster?
I have tried some manual steps to test connectivity:
az login
-- I can login successfully via CLI
az aks get-credentials --name <MYCLUSTERNAME> --resource-group <CLUSTERRESOURCEGROUP>
-- Credentials successfully loaded into .kube/config
kubectl get nodes
-- I login with the Microsoft Device Code login, but then receive an error: Unable to connect to the server: dial tcp: lookup <MYCLUSTERNAME>.privatelink.northeurope.azmk8s.io: no such host
Any advice will be appreciated.
Thanks
Darren

