Kubernetes newbie (or rather basic networking) question: Installed single node minikube (0.23 release) on a ubuntu box running in my lan (on IP address 192.168.0.20) with virtualbox.
minikube start command completes successfully as well
minikube start
Starting local Kubernetes v1.8.0 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.
minikube dashboard also comes up successfully. (running on 192.168.99.100:30000)
what i want to do is access minikube dashboard from my macbook (running on 192.168.0.11) in the same LAN.
Also I want to access the same minikube dashboard from the internet.
For LAN Access: Now from what i understand i am using virtualbox (the default vm option), i can change the networking type (to NAT with port forwarding) using vboxnet command
VBoxManage modifyvm "VM name" --natpf1 "guestssh,tcp,,2222,,22"
as listed here
In my case it will be something like this
VBoxManage modifyvm "VM name" --natpf1 "guesthttp,http,,30000,,8080"
Am i thinking along the right lines here?
Also for remotely accessing the same minikube dashboard address, i can setup a no-ip.com like service. They asked to install their utility on linux box and also setup port forwarding in the router settings which will port forward from host port to guest port. Is that about right? Am i missing something here?
Jeff Prouty added useful answer:
But for me it didn't worked initially.
I run this command on the CentOS 7 machine with running kubectl (local IP: 192.168.0.20).
When I tried to access dashboard from another computer (which was in LAN obviously):
then only timeout was in my web browser.
The solution for my case is that in CentOS 7 (and probably other distros) you need to open port
8001
in your OS firewall.So in my case I need to run in CentOS 7 terminal:
And after that. It works! :)
Of course you need to be aware that this is not safe solution, because anybody have access to your dashbord now. But I think that for local lab testing it will be sufficient.
In other linux distros, command for opening ports in firewall can be different. Please use google for that.
@Jeff provided the perfect answer, put more hints for newbies.
Start a proxy using @Jeff's script, as default it will open a proxy on '0.0.0.0:8001'.
Visit the dashboard via the link below:
More details please refer to the officially doc.
Thanks for your valuable answers, If you have to use the kubectl proxy command unable to view permanently, using the below "Service" object in YAML file able to view remotely until you stopped it. Create a new yaml file
minikube-dashboard.yaml
and write the code manually, I don't recommend copy and paste it.Execute the command,
Finally, open the URL: http://your-public-ip-address:30000/#!/persistentvolume?namespace=default
Slight variation on the approach above.
I have an http web service with NodePort 30003. 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)
I had the same problem recently and solved it as follows:
bridge
network mode. For me, this was done through modifying the minikube VM in the VirtualBox UI and required VM stop/start. Not sure how this would work if you're using hyperkit. Don't muck with the default network adapters configured by minikube: minikube depends on these. https://github.com/kubernetes/minikube/issues/1471Add a cluster and associated config to the
~/.kube/config
as below, modifying the server IP address to match your newly exposed VM IP. Names can also be modified if desired. Note that theinsecure-skip-tls-verify: true
is needed because the https certificate generated by minikube is only valid for the internal IP addresses of the VM.Copy the
~/.minikube/client.*
files referenced in the config from your linux minikube host. These are the security key files required for access.Set your kubectl context:
kubectl config set-context mykubevm
. At this point, your minikube cluster should be accessible (trykubectl cluster-info
).Run
kubectl proxy http://localhost:8000
to create a local proxy for access to the dashboard. Navigate to that address in your browser.It's also possible to ssh to the minikube VM. Copy the ssh key pair from
~/.minikube/machines/minikube/id_rsa*
to your .ssh directory (renaming to avoid blowing away other keys, e.g.mykubevm
&mykubevm.pub
). Thenssh -i ~/.ssh/mykubevm docker@<kubevm-IP>
I was able to get running with something as simple as: