Kubernetes pods unable to resolve host :

11/19/2019

I have setup an Azure Kubernetes Cluster using kubenet plugin. All pods and services are running. Also, when I do a kubectl get pods -n kube-system all pods are running.

The issue I have is, the pods are unable to connect to other pods via hostnames. However, if I use the pod ip addresses : portname, they are able to connect.

When I am logged into a pod and do a curl ex: pod-x$ curl http://my-pod-y:2000/analysis

I get the error:

could not resolve host http://my-pod-y

But when I delete all the coredns pods with kube-system namespaces, and retry the curl commands within the pod, they are able to access the other pods using hostnames!

But when I try after 10 mins it gives the could not resolve host error.

Any pointers on this will be much appreciated.

-- jack
azure-aks
coredns
kubernetes

0 Answers