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
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
kubernetes ClusterIP <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 UG 0 0 0 eth0 * U 0 0 0 eth0
# cannot ping svc by ip either
$ timeout 10s kubectl exec -ti $POD_NAME -- ping
PING ( 56 data bytes
# container is able to ping Google DNS
$ timeout 3s kubectl exec -ti $POD_NAME -- ping
PING ( 56 data bytes
64 bytes from seq=0 ttl=113 time=0.858 ms
64 bytes from seq=1 ttl=113 time=0.655 ms
64 bytes from seq=2 ttl=113 time=0.788 ms

  • post-author-pic
    Michael M


    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