Skip to content

Instantly share code, notes, and snippets.

@isaurssaurav
Last active January 18, 2023 18:04
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaurssaurav/aaea78d9355027dd1cd5aa49b0250139 to your computer and use it in GitHub Desktop.
Save isaurssaurav/aaea78d9355027dd1cd5aa49b0250139 to your computer and use it in GitHub Desktop.
Port forwarding of VM (minikube) to host machine
The ssh way
Assuming that you have ssh on your ubuntu box.
Minikube user: docker password: tcuser
First run kubectl proxy & to expose the dashboard on http://localhost:8001
Then expose the dashboard using ssh's port forwarding, executing:
ssh -R 30000:127.0.0.1:8001 $USER@192.168.0.20
OR
ssh -i ~/.minikube/machines/minikube/id_rsa docker@$(minikube ip) -L \*:<port>:0.0.0.0:<port>
Now you should access the dashboard from your macbook in your LAN pointing the browser to http://192.168.0.20:30000
To expose it from outside, just expose the port 30000 using no-ip.com, maybe change it to some standard port, like 80.
Note that isn't the simplest solution but in some places would work without having superuser rights ;) You can automate the login after restarts of the ubuntu box using a init script and setting public key for connection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment