Ungraded Lab: Intro to Kubernetes - needs tunneling?

Please correct me if I am wrong, but shouldn’t I really build a tunnel to service in kubernetes cluster?

I could complete lab only after enable tunneling with “minikube service to-serving-service” on the step of exposing the deployment through a service. Otherwise, I couldn’t connect to the server.

“minikube service tf-serving-service” builds tunnel on local IP with random port, then I could make Request to this port with a successful response.

Hi Alexander! Welcome to Discourse!

That will work for this setup but since Minikube is not available for other deployment settings, it is better to access the Nodeport using standard Kubernetes commands.

Did you also use Virtualbox as the VM runtime when you started Minikube? It seems you’re getting as the MInikube IP and I only got that when I tried Docker as the VM runtime. Ideally, you should have a local IP setup automatically. Can you open the VirtualBox UI, click on Minikube (requires that Minikube is running), then go to the Network Settings? Do you see something like this (ignore the “invalid settings” at the bottom of the screenshot. that is unrelated)?

If you can see that, close the window. Then click File -> Host Network Manager. In the menu click the name of the network (e.g. vboxnet2) then see if DHCP Server is enabled ?

If you don’t see anything set up in these steps, then maybe you can follow the instructions here to have a local network to communicate with the VM: Creating a New Host-Only Adapter in VirtualBox - School of Computer Science .

Hope this helps!

Yes, Chris, you’re right, I used docker VM runtime instead of VirtualBox. This may be the cause of a trick with tunneling. I couldn’t create minikube node on VirtualBox VM, I’ve got a driver error tried VirtualBox, and switch to docker.