KTHW: cannot ping kubernetes service after installing kube-dns

I have installed kube-dns and it seems to be running, but following the lab, the POD is unable to ping the kubernetes service. Any ideas on what to check?
# kube-dns Running
$ k get pods -n kube-system
NAME READY STATUS RESTARTS AGE
kube-dns-598d7bf7d4-xxr9s 3/3 Running 0 15h
weave-net-9jhkr 2/2 Running 0 15h
weave-net-pttpd 2/2 Running 0 15h
# confirming kubernetes service exists
$ k get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.32.0.1 <none> 443/TCP 15h
# attempting to ping kubernetes service times out
$ timeout 10s kubectl exec -ti $POD_NAME -- ping kubernetes
# FYI: showing route table inside the busybox container
$ kubectl exec -ti $POD_NAME -- route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.22.0.1 0.0.0.0 UG 0 0 0 eth0
10.22.0.0 * 255.255.0.0 U 0 0 0 eth0
# cannot ping svc by ip either
$ timeout 10s kubectl exec -ti $POD_NAME -- ping 10.32.0.1
PING 10.32.0.1 (10.32.0.1): 56 data bytes
# container is able to ping Google DNS
$ timeout 3s kubectl exec -ti $POD_NAME -- ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=113 time=0.858 ms
64 bytes from 8.8.8.8: seq=1 ttl=113 time=0.655 ms
64 bytes from 8.8.8.8: seq=2 ttl=113 time=0.788 ms

  • post-author-pic
    Michael M
    12-31-2018

    Hello,


    There are a couple of things that I can think of that might be contributing to the issue that you are seeing.
    Try to exec into the kubernetes  pod and make sure that all is well. 
    Check the DNS resolver for correct entries.
    Ensure that the recolv.conf is set correctly.
    Validate that the correct routes exist on the Nodes.
    Validate that the kubelet service is running correctly. 

    Once all that is validated, if the issue is not resolved let us know and we can proceed from there. 

Looking For Team Training?

Learn More