skydns not able to find nginxsvc

11/9/2015

I am following the example in here: http://kubernetes.io/v1.0/docs/user-guide/connecting-applications.html#environment-variables. Although the dns seems to be enabled:

skwok-wpc-3:1.0 skwok$ kubectl get services kube-dns --namespace=kube-system
NAME       LABELS                                                                           SELECTOR           IP(S)       PORT(S)
kube-dns   k8s-app=kube-dns,kubernetes.io/cluster-service=true,kubernetes.io/name=KubeDNS   k8s-app=kube-dns   10.0.0.10   53/UDP
                                                                                                                       53/TCP

and the service is up

$ kubectl get svc
NAME         LABELS                                    SELECTOR    IP(S)          PORT(S)
kubernetes   component=apiserver,provider=kubernetes   <none>      10.0.0.1       443/TCP
nginxsvc     app=nginx                                 app=nginx   10.0.128.194   80/TCP

Following the example, I cannot use the curlpod to look up the service:

$ kubectl exec curlpod -- nslookup nginxsvc
Server:    10.0.0.10
Address 1: 10.0.0.10 ip-10-0-0-10.us-west-2.compute.internal

nslookup: can't resolve 'nginxsvc'

Did I miss anything? I am using aws and I use export KUBERNETES_PROVIDER=aws; curl -sS https://get.k8s.io | bash to start my cluster. Thank you.

-- skwokie
amazon-web-services
kubernetes

1 Answer

11/12/2015

Please see: http://kubernetes.io/v1.0/docs/user-guide/debugging-services.html, and make sure nginx is running and serving within your pod. I would also suggest something like:

$ kubectl get ep nginxsvc   
$ kubectl exec -it curlpod /bin/sh    
pod$ curl ip-from-kubectl-get-ep
pod$ traceroute ip-from-kubectl-get-ep

If that doesn't work, please reply or jump on the Kubernetes slack channel

-- Prashanth B
Source: StackOverflow