'Connecting Azure Container instances with AKS pods via the AKS dns

I am not able to reach the DNS server in k8s from Azure Container instances

context:

I have 2 pods in an Azure AKS Kubernetes cluster.

Pod1: name = pod1, internal IP = 10.34.33.112

Pod2: name = pod2, internal IP = 10.34.33.155, Cluster IP = 10.34.104.109

AKS DNS Service ip = 10.34.96.58

So, from pod1, I expect that nslookup pod2 would return

(this works as expected)

/ # nslookup pod2
Server:     10.34.96.58
Address:    10.34.96.58:53

Name:   pod2.default.svc.cluster.local
Address: 10.34.104.109

Azure Container Instances: When I am running commands from the Container Instance a ping to pod2's internal IP works.

This is because they are in the same Virtual network via a Network Profile

# ping 10.34.33.155
PING 10.34.33.155 (10.34.33.155): 56 data bytes
64 bytes from 10.34.33.155: seq=0 ttl=63 time=2.208 ms
64 bytes from 10.34.33.155: seq=1 ttl=63 time=1.101 ms

However,

# nslookup pod2.default.svc.cluster.local 10.34.96.42
;; connection timed out; no servers could be reached

Even if I specify the nameserver, and the full url for the pod, It cannot be reached. I am not able to identify where the block is occurring.

any ideas? or Best Practices?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source