Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

access external ip from outside network #5812

Closed
BaerSy opened this issue Nov 1, 2019 · 9 comments
Closed

access external ip from outside network #5812

BaerSy opened this issue Nov 1, 2019 · 9 comments
Labels
area/networking networking issues kind/feature Categorizes issue or PR as related to a new feature. kind/support Categorizes issue or PR as a support question.

Comments

@BaerSy
Copy link

BaerSy commented Nov 1, 2019

I tried to use minikube to deploy an IOT application in local to test edge devices. My laptop is windows 10 which use VMWare workstation or Virtual box to host an Ubuntu 18.04. minikube was installed in Ubuntu and start as a bare-Metal. I checked services as below outcomes.

All external IPs are none or pending. How can I enable external IP of some services and my devices can connect to this service? The external IP is my laptop IP or VM up?

I tried few possible ways, never got an external IP for other computer or devices to connect together.

Appreciate very much if you could offer some advices.

mmexport1572620655123

@medyagh
Copy link
Member

medyagh commented Nov 4, 2019

I wonder if you have already seen minikube tunnel ?

@BobOntario do you need to access the ip outside the machine that minikube runs on it ?

if that is the case you would need to use some sort of port forawrding or ssh forawrding !

@medyagh medyagh added area/networking networking issues triage/needs-information Indicates an issue needs more information in order to work on it. labels Nov 4, 2019
@BaerSy
Copy link
Author

BaerSy commented Nov 5, 2019

Tried minikube tunnel, it doesn't resolve my issue. Yes, I need access to IP outside the machine that minikube running on it. One use case is that the other computers or devices can access to the services that provides by minikube .

@medyagh
Copy link
Member

medyagh commented Nov 6, 2019

Tried minikube tunnel, it doesn't resolve my issue. Yes, I need access to IP outside the machine that minikube running on it. One use case is that the other computers or devices can access to the services that provides by minikube .

I bet you can make that work, that would be something you would need to do on your host machine to port-forwart to outside world.

if you actually make it work, this would be a great tutorial for other users to be put on minikube website.

@medyagh medyagh added kind/support Categorizes issue or PR as a support question. and removed triage/needs-information Indicates an issue needs more information in order to work on it. labels Nov 6, 2019
@medyagh medyagh changed the title External Ip access external ip from outside network Nov 6, 2019
@brainfull
Copy link

brainfull commented Nov 6, 2019

Here is what I did on my side. I understand your setup is different and my solution may not fit your needs. My setup is Hyper-V on Windows 10 Pro. I hope it gives you some food for thought as a minimum.

  1. Use internal VM Switch. You can set it up easily with the following powershell. It will take care of creating the VM switch if it doesn't exist and establish ICS between your internet connection and the internal VM Switch.
    Set-ICS.ps1.txt
    Open Powershell and call the script. In the following example it creates a VM Switch named 'minikube':
    ./Set-ICS.ps1 -VMSwitch minikube Enabled

  2. Create your minikube VM. Open Powershell and call the following command. In the following example it creates a VM named 'minikube' using the VM switch named 'minikube':
    minikube start --vm-driver hyperv --hyperv-virtual-switch minikube

  3. From that point on, your VM 'minikube' is available internally in your computer under the hostname (VM Name).mshome.net, if you followed the previous instructions that is 'minikube.mshome.net'. It is ICS DHCP server that takes care of defining that hostname under C:\Windows\System32\drivers\etc\hosts.ics

  4. Expose a service on a predefined Nodeport. Here is an example of a yaml that expose the port 22 of a container on Nodeport 30022, if you followed the previous instructions that is 'minikube.mshome.net:30022'. In my case this is an Open-SSH listening on port 22 so it allows me to SSH in my container.
    dev-service-bekno-worker-debug.yaml.txt

  5. Then you can open the port on your laptop which has its own external IP address and own external hostname on your network. One way to do it in Powershell is the following:
    netsh interface portproxy add v4tov4 listenaddress=127.0.0.1 listenport=2222 connectaddress=minikube.mshome.net connectport=30022

  6. F**k yeah! In my case I can open SSH connection on port 2222 from another computer. That opens up an SSH connection to a container within minikube!!! You may have to change your firewall rules to allow incoming connection on port 2222. If the port 2222 or 30022 are not available because of other services running on it, the previous steps may fail, in which case you need to change the ports.

I hope it gets you to a working solution for your setup. Definitely there is a lack of support about minikube on Windows. But I am committed to use it since it allows for greater productivity overall.

Have a look at this issue if you wonder why I use an internal VM Switch #5072 .

@BaerSy
Copy link
Author

BaerSy commented Nov 6, 2019

@brainfull your solution looks interesting. Will try later. You run minikube directly on Windows. My case is that I run minikube on Ubuntu within a VM which is under VMWare Workstation or Virtual box. I start minikube with -- vm-driver=none. This is because my apps can't be deployed in Windows, but Linux only.

@brainfull
Copy link

brainfull commented Nov 7, 2019

@brainfull your solution looks interesting. Will try later. You run minikube directly on Windows. My case is that I run minikube on Ubuntu within a VM which is under VMWare Workstation or Virtual box. I start minikube with -- vm-driver=none. This is because my apps can't be deployed in Windows, but Linux only.

You're right, I use Hyper-V in Windows 10. I use chocolatey to install minikube, kubernetes-cli and docker-cli. All my docker images are 'FROM ubuntu:bionic'. In my case I deploy multiple linux containers with Python, Mono, MongoDB, Redis... I tried to leverage the Minkube VM for some linux shell automation but was very disappointed by the linux version within Minikibe VM, it is very limited, so I ended up running linux shell automation directly in one of my container that has Open-SSH installed. This way I know that I can redo all that in production even if the production cluster is running kubernetes on linux.

@munayamjine
Copy link

Bangladesh

@medyagh medyagh added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 29, 2020
@medyagh
Copy link
Member

medyagh commented Jan 29, 2020

I label this as a feteaure request, while meanikube provides minikube tunnel and ips for each service. I dont think it is in the scope for minikube to provide external IPs, that would require you and your internet provider to setup port-forwarding. but I wouldn't oppose any PR or addons that would help with this feature. but I don't think this will be on our road map in the near term.

@cglacet
Copy link

cglacet commented Aug 4, 2020

I don't understand why minikube doesn't provide this service. It seems essential to me. For example, in my case I have a react native application running on 2 phones connected to the local network. I usually use docker-compose which automatically make my services available to my phones. This is very handy and saves me the headaches of port forwarding (which will very likely be dependent on the host machine). Maybe I'm missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking networking issues kind/feature Categorizes issue or PR as related to a new feature. kind/support Categorizes issue or PR as a support question.
Projects
None yet
Development

No branches or pull requests

5 participants