Welcome to the Linux Foundation Forum!

DNS not getting Registered on Pod

This is in regard to Chapter#8.11, Verifying DNS registration. I have created a Pod same as in the example. However when I try to nslookup , it gives me the below error:

student@master-node:~$ kubectl exec -ti busybox -- nslookup nginx
Server: 10.96.0.10
Address: 10.96.0.10:53

Name: nginx.default.svc.cluster.local
Address: 10.98.6.50

*** Can't find nginx.svc.cluster.local: No answer
*** Can't find nginx.cluster.local: No answer
*** Can't find nginx.us-central1-a.c.buoyant-airport-241910.internal: No answer
*** Can't find nginx.c.buoyant-airport-241910.internal: No answer
*** Can't find nginx.google.internal: No answer
*** Can't find nginx.default.svc.cluster.local: No answer
*** Can't find nginx.svc.cluster.local: No answer
*** Can't find nginx.cluster.local: No answer
*** Can't find nginx.us-central1-a.c.buoyant-airport-241910.internal: No answer
*** Can't find nginx.c.buoyant-airport-241910.internal: No answer
*** Can't find nginx.google.internal: No answer

Please suggest what can be wrong!

Thanks in Advance!
Shubhasis

Comments

  • I just realized that my kube-dns pod does not even exist.

    kube-system calico-node-6qq59 2/2 Running 2 8d
    kube-system calico-node-rgqg2 2/2 Running 2 8d
    kube-system coredns-fb8b8dccf-c7w7f 1/1 Running 1 8d
    kube-system coredns-fb8b8dccf-cdtvd 1/1 Running 1 8d
    kube-system etcd-master-node 1/1 Running 1 8d
    kube-system kube-apiserver-master-node 1/1 Running 1 8d
    kube-system kube-controller-manager-master-node 1/1 Running 1 8d
    kube-system kube-proxy-54vp2 1/1 Running 1 8d
    kube-system kube-proxy-hxmbz 1/1 Running 1 8d
    kube-system kube-scheduler-master-node 1/1 Running 1 8d

    Please make me understand why it is not present at the first place? and how to make kube-dns pod working?
    It looks like the pod was never created , as there is no status other than the "running" pods.
    @serewicz , need your guidance please .

    Thanks in advance!
    Shubhasis

  • @serewicz , could you please check ?

  • chrispokorni
    chrispokorni Posts: 2,376

    Hi @shubhasismathur,
    From your second output above, you have coredns pods running, the default DNS server now. Kube-dns is no longer used, although you may see a kube-dns service in your cluster, which merely exposes the coredns pods (the name was kept for compatibility).
    More on DNS here.
    The first output seems to resolve the nginx service to the 10.98.x.x IP. And that should be the correct IP, so I do not see anything wrong there. Based on your DNS configuration, it also tries to resolve the nginx service against other entries in your resolver configuration file - and as expected, they all fail.

    Regards,
    -Chris

Categories

Upcoming Training