How to resolve Kubernetes API from minikube?

875 views Asked by At

I can't seem to be able to find the Kubernetes API IP address from within the minikube machine, using minikube ssh.

nslookup kubernetes.default.svc.cluster.local 10.0.0.1
Server:    10.0.0.1
Address 1: 10.0.0.1

nslookup: can't resolve 'kubernetes.default.svc.cluster.local'

Same thing happens with just kubernetes. This happens even though it seems that the kube-dns pods are up-and-running just fine:

# kubectl -n kube-system get pods
NAME                          READY     STATUS    RESTARTS   AGE
kube-addon-manager-minikube   1/1       Running   0          9m
kube-dns-910330662-16bvw      3/3       Running   0          8m
kubernetes-dashboard-vbn9m    1/1       Running   0          8m

There is no KubeDNS info in cluster-info (but nothing major in the dump):

# kubectl cluster-info
Kubernetes master is running at https://192.168.64.26:8443

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

Version for kubectl:

# kubectl version
Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.5", GitCommit:"17d7182a7ccbb167074be7a87f0a68bd00d58d97", GitTreeState:"clean", BuildDate:"2017-08-31T09:14:02Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.0", GitCommit:"d3ada0119e776222f11ec7945e6d860061339aad", GitTreeState:"clean", BuildDate:"2017-07-26T00:12:31Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}

and minikube:

# minikube version
minikube version: v0.21.0

This happens on OSX and both with xhyve and virtualbox as drivers.

There are quite a few minikube/dns issues in the minikube issue tracker, but none of them quite like this. What should the kubectl cluster-info output look like for minikube that has kube-dns working? What about the nslookup, shouldn't that work?

EDIT. It seems like kubectl cluster-info for minikube is returning what it should, but I can't even resolve kubernetes from inside the kube-dns pod either:

# kubectl -n kube-system exec -it kube-dns-910330662-1n64f -c kubedns -- nslookup kubernetes.default.svc.cluster.local localhost
Server:    127.0.0.1
Address 1: 127.0.0.1 localhost

nslookup: can't resolve 'kubernetes.default.svc.cluster.local': Name does not resolve

which really should work?

0

There are 0 answers