How to access minikube machine from outside?

2/17/2019

I have a server running on ubuntu where I need to expose my app using kubernetes tools. I created a cluster using minikube with virtualbox machine and with the command kubectl expose deployment I was able tu expose my app... but only in my local network. It's mean that when I run minikube ip I receive a local ip. My question is how can I access my minikube machine from outside ? I think the answer will be "port-forwarding".But how can I do that ?

-- David Gahnassia
kubernetes
minikube

2 Answers

2/17/2019

If you mean to access your machine from the internet, then the answer is yes "port-forwarding" and use the external ip address [https://www.whatismyip.com/]. The configurations go into your router settings. Check your router manual.

-- Vishrant
Source: StackOverflow

2/17/2019

You can use SSH port forwarding to access your services from host machine in the following way:

ssh -R 30000:127.0.0.1:8001 $USER@192.168.0.20

In which 8001 is port on which your service is exposed, 192.168.0.20 is minikube IP.

Now you'll be able to access your application from your laptop pointing the browser to http://192.168.0.20:30000

-- Prafull Ladha
Source: StackOverflow