How does one install the kube-dns addon for minikube?

l p picture l p · Apr 1, 2017 · Viewed 8.2k times · Source

Can someone please detail the steps necessary to install the kube-dns addon? I've downloaded the nearly 400MB git repo in the previous link and run make as instructed but get Nothing to be done for 'all'.

The docs aren't clear what form add-ons exist in, and how to install them. The "Administrators guide" link there takes me to this unhelpful page.

I've tried https://stackoverflow.com/a/42315074/4978821, but got an error validating data message. Even if this worked, it seems like it'd be an unofficial and awkward solution.

Answers like this are also too vague: https://stackoverflow.com/a/36105547/4978821.

I'd be happy to create a pull request to improve the documentation, once I have a solution.

Updated to clarify my issue:

As mentioned by Aaron, the dns addon is enabled in minikube by default. Running minikube addons list shows that it is enabled. However, if I get into a bash shell for a running pod, like such kubectl exec -it node-controller-poqsl bash and try to reach my mongo service using ping, for example, it resolves to a public URL, rather than the kubernetes service IP.

Answer

aaron-prindle picture aaron-prindle · Apr 1, 2017

The kube-dns addon should be enabled by default in minikube. You can run kubectl get po -n kube-system to check if the pod the addon-manager launches is there. If you don't see the pod listed, make sure that the addon is enabled in minikube by running minikube addons list and verifying that kube-dns is enabled

Edit: For me kubectl get po -n kube-system is a valid command, here is the output:

$ kubectl get po -n kube-system
NAME                          READY     STATUS    RESTARTS   AGE
kube-addon-manager-minikube   1/1       Running   2          5d
kube-dns-v20-7ddvt            3/3       Running   6          5d
kubernetes-dashboard-rn54g    1/1       Running   2          5d

You can see from this that the kube-dns pods are running correctly. Can you verify that your kube-dns pods are in the Running state?