Make my app available from the outside in Minikube

9/22/2017

I was following a few tutorials on Kubernetes and on Minikube for three days now on my laptop, I was completely new to Kubernetes, Docker, Minikube, and got to the point where my deploys/replicas/services (I am still having a lot of confusion between them) are available to curl, both by using a "common" virtual IP and individual IP of each replica. But, unfortunately, I can only curl them from "inside the cluster" (if that is a correct term) in other words only after I type minikube ssh.

Now, how do I get my "hello world" app available from the outside, i.e. From the host machine or machines connected via LAN/WAN (for example that would be lovely to open the app URL in the phone's browser and see the JSON output).

-- exebook
kubernetes
minikube

1 Answer

9/22/2017

You can view the services in your minikube cluster via minikube service list. If you assigned a NodePort to a service there will be an URL displayed which you can access from your host, e.g. the Kubernetes dashboard:

 minikube service list
|-------------|----------------------|----------------------------|
|  NAMESPACE  |         NAME         |            URL             |
|-------------|----------------------|----------------------------|
| default     | kubernetes           | No node port               |
| kube-system | kube-dns             | No node port               |
| kube-system | kubernetes-dashboard | http://192.168.64.67:30000 |
|-------------|----------------------|----------------------------|

Access from the rest of your network is of course only possible when your virtual machine is bridged into it.

-- Simon Tesar
Source: StackOverflow