Reputation: 21
I recently created a kubernetes cluster of one master and one slave (2 laptops) running Ubuntu 18.04 using Kubeadm and flannel for the network. I was able to deploy 2 microservices as 2 pods and created 2 services for either of them. I was able to call both API of both services using the node IP and the service port. But the pods were unable to communicate with each other using the service domain name. Then I followed the debugging DNS issue page in official kubernetes website.
On running kubectl exec -ti dnsutils -- nslookup kubernetes.default
in the terminal
I keep getting
;; connection timed out; no servers could be reached. command terminated with exit code 1
All the rest of the steps in the above mentioned page works as expected. Towards the end, there is mention about the problem with resolv.conf in ubuntu and how to mitigate that. But I'm lost there and don't know how to implement that. Has anyone come accross this issue ? Can you help me fix it ?
Upvotes: 2
Views: 2199
Reputation: 44657
If you are accessing a service from different namespace then you need to add the namespace where the service is my-svc.my-namespace.svc.cluster.local
and if you are accessing it from same namespace then you can use my-svc.svc.cluster.local
without any need to mention namespace.
Upvotes: 1