Is this a BUG REPORT or FEATURE REQUEST? (choose one):
BUG REPORT
Please provide the following details:
Environment:
Minikube version (use minikube version):v0.23.0
cat ~/.minikube/machines/minikube/config.json | grep DriverName):nonecat ~/.minikube/machines/minikube/config.json | grep -i ISO or minikube ssh cat /etc/VERSION):What happened:
minikube ip is always return 127.0.0.1 that NodePort type service can't be accessble from host machine when minikube runs on vms.
What you expected to happen:
when it runs on vms node ip should be routable from host machine
The none driver is not for running inside VMs. To run a cluster inside a VM, you should let minikube manage the VM lifecycle by using one of the hypervisor drivers (kvm, virtualbox, etc.)
I've found that issue is in docker iptables rules. You can add this rule to your vm:
sudo iptables -A DOCKER -j ACCEPT
With this, kubernetes services exposed with NodePort and external ip inside vm becomes available from host machine.
Better way is to uncomment line net.ipv4.ip_forward=1 in /etc/sysctl.conf and reboot.
That's true, I am resolved previously
sudo iptables -P FORWARD ACCEPT
Another way is to run an ssh tunnel. In my case, I have an http web service with NodePort 30003, and I make it available on port 80 externally by running:
sudo ssh -v -i ~/.ssh/id_rsa -N -L 0.0.0.0:80:localhost:30003 ${USER}@$(hostname)
Most helpful comment
I've found that issue is in docker iptables rules. You can add this rule to your vm:
With this, kubernetes services exposed with NodePort and external ip inside vm becomes available from host machine.