Minikube LAB in VMware Workstation, Red Hat variants with podman

I am running minikube inside of an Oracle Linux 9.4 VM on VMware Workstation 17.5.1 .

I created the service for the hello-node to expose the port
both of the below attempts, (I deleted first service before trying second attempt)
kubectl expose deployment hello-node --type=LoadBalancer --port=8080
and
kubectl expose deployment hello-node --type=NodePort --port 8080

both attempts worked but when I tried to open URL from Desktop VMware Workstation is running on as well as another VM with same network, it timed out

VM with minikube 192.168.137.50 (Oracle 9.4 server multi-user non-GUI)
VM within environment 192.168.137.3 (Oracle Linux 9.4 GUI with Firefox)
Service URL returned was 192.168.49.2:30808
Desktop - Network shared is 192.168.137.1 (Gateway for VMs)
I can ping VM to VM, VM to Desktop, VM to Internet
I cannot ping from Desktop to VM

I have vmnet(8) setup as Nat to 192.168.137.0 network

Is there an issue with the network or accessing a service in minikube deployment in this environment? I can do direct contact for further clarification if needed. Any assistance is greatly appreciated.

Also this is my first time using kodekloud and Discord. If there is a better way to post a question or a way to direct question to instructor etc. please let me know.

Update: Here is my routes in the VM with minikube
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.137.1 0.0.0.0 UG 100 0 0 ens160
192.168.49.0 0.0.0.0 255.255.255.0 U 0 0 0 podman1
192.168.137.0 0.0.0.0 255.255.255.0 U 100 0 0 ens160

Posting a question here is fine; this is about the best place to do so, in fact.

I’ll admit I don’t know much about how to configure networking with VMWare-Workstation, which is probably the root of your problems. Several points:

  • If I understand your set up, the virtual system is VMWare, running an Oracle Linux.
  • You’re running a linux build of minikube in the virtual.
  • Not clear what driver you are using for minikube; this will affect how it networks.

Let’s assume that you’re using the version of the service using NodePort; most likely, the LoadBalancer service will not work on minikube. If I understand what you mean by “service URL” – I’m going to guess that it’s what’s returned by minikube service --url hello-node – then you should be able to do this in the virtual’s terminal and get an appropriate response:

curl 192.168.49.2:30808

That’s assuming that hello-node really has a container port of 8080; I’m not familiar with the image, and don’t find an official hello-node image on Dockerhub.

I feel like an idiot. I didn’t think to simply use curl in the terminal window which shows it worked.

As for clarification- I have a desktop with Windows 11 - VMware Workstation installed on it - Oracle Linux 9 installed in VMware as the VM - I installed minikube the standard way and am have podman which I can use as regular user by adding the the entry with visudo of username ALL=(ALL) NOPASSWD: /usr/bin/podman at the end of the file (where username is my user).

So curl works inside the terminal but I can’t reach it from the desktop or another VM on same network. I am assuming its a routing thing with the podman device. Doing it this way is new to me. You can see the route above that was added by default, I am assuming from minikube when I created the service / exported the NodePort. Thank you for the response.

If you have any suggestion on route I will take it, otherwise it will be some trial and error. Broadcom messed the ability to research VMware issues by collapsing the old communities posts into new system that doesn’t work, yet.

No reason to feel foolish – figuring out how some of this stuff networks Even Fools The Wise :slight_smile:

minikube isn’t really intended to network out of a host in any case, so I’m not surprised that it won’t find its way out of the VM. I’m not sure how you do a port forward using VMWare, but that would be what to try.

I said it worked but curl gave me the below and not what the expected web page content the course showed in the video. Is below what I should see since I am curling via terminal?

curl 192.168.49.2:30130
NOW: 2024-05-13 20:49:39.705416328 +0000 UTC m=+5721.583679111[brian@minikube]$

Not knowing what hello-node is supposed to do, I can’t say that’s wrong. It gave output, and not an error, so that may well be what it’s supposed to do.

Last reply for this. hello-node is what I guess hello-minikube was to show its working. The course video is using the istructions from the Kubernetes Documentation | Kubernetes Tasks, Install section for minikube. The updated kubernetes site sends you to the minikube site for install and the instructions are different than course video. It was close enough for me to follow along. In the course he is using Ubuntu in Virtualbox, I am using Oracle Linux (RedHat variant) in VMware Workstation. In the video you can open the URL on the server / laptop hosting virtual box where I could not on my laptop hosting VMware Workstation. The output in the course video shows a bit of out put (couldn’t copy and paste) but it was a good bit of information. I will install Virtualbox and use Ubuntu to see if the results match up. I will also try Ubuntu in VMware Workstation but that shouldn’t be the issue.

I can also look to see if the hello-minikube still exists and try it instead of hello-node. But I will close this inquiry out. Thanks for all of your replies and support.

Good troubleshooting on your part. All the best.

I closed this but since I got it to work I thought I would update here.

I installed Ubuntu on Virtualbox and had similar issues.

What worked in the end. I had to install virtualbox itself as a package inside of the guest os. So inside of VMware Workstation - Ubuntu server 24.04 guest vm - I installed the package virtualbox. Then I started minikube with (minikube start --driver=virtualbox). Even though I am on VMware Workstation, this works. I tried on Virtualbox itself but I couldn’t get the vtx ungreyed on my guest vm settings even when shutdown (issue for another day).

It’s a turducken of virtualization, but if it works, it works. Good to hear.

Just FYI the below un-greyed the Enabled nested Vt-x and checked it. You have to also have Windows Security - Memory Integrity Core Isolation off (mine was by default).

C:\Program Files\Oracle\VirtualBox>VBoxManage modifyvm minikubeu --nested-hw-virt on
Where minikubeu was the name of the VM.

Last update I promise. I installed Ubuntu Desktop, added the packages needed i.e. Docker, etc.

minikube started with Docker as its default option. I did not use the virtualbox flag because of other errors. The same message I got via curl is what showed up in Firefox. Other issues were all network related in and out of VMs to host and back. Just quirks in the way I am sharing my host network. If I set up bridge other than NAT it might work better outside of VM.

However, even with the steps I used the course needs updating. I know it is difficult to keep things current as fast as these technologies evolve.

Using VMWare is something we are only starting to support; this is complicated by the recent of acquisition of VMWare by Broadcom, which we are still trying to figure out from a support perspective. As bad as Virtualbox is as a product under Oracle, it’s still better known to folks like us than VMWare’s products are.

If you use our most recent tutorials from the CKA repo, then you can get a lot better networking with a Windows host – we support bridged networking, which is what you want for what you’re doing. This is actually extremely up to date: we revampped these tutorials over the last few months. They’re brand new.

Totally understandable - no shade from my perspective. I had to do work around just to get Virtualbox to let me enable vtx to get minikube up. The virtualbox flag for launchine minikube only worked after I installed it as a package, which I don’t think was the original goal.

The website referenced in course (kubernets site) changed from what the course showed which is outside of your control. The minikube site instructions changed, were close but referenced hello-node v/s hello-minikube etc.

I was also trying this on VM servers (no GUI). I installed GUI to get firefox launched for hello-node which worked. I am now researching best way to remote launch display to local machine (GUI) like the old $DISPLAY where you setenv DISPLAY=name:0.0 where name:0.0 is your local GUI display and xhost + etc. I used these on Solaris and xservers in the old days.

All fun…

No shade detected or suspected. And thanks for your detailed notes – other users will find them useful.

I wanted to post my notes after getting entire LAB to work in my environment for others that may use same tools (VMware Workstation 17 - Oracle Linux 9 Server - Red Hat variants)
Copying from Microsoft Word - hope it reads well

LAB – Minikube Setup

Windows 11 - Host

VMware Workstation Pro 17 

Bridged Network VMnet0

Oracle Linux 9 Server installed as VM

Install GUI for launching K8s Dashboard & launching hello-node or hello-minikube on local VM in Web
•	dnf groupinstall -y "Server with GUI" --skip-broken
•	systemctl set-default graphical.target
•	dnf update -y
•	sudo systemctl isolate graphical.target (start GUI without reboot) 

Install kubectl
https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#install-kubectl-binary-with-curl-on-linux 

curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"

sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

kubectl version --client  (to show kubectl is working)

Install minikube
https://minikube.sigs.k8s.io/docs/start/

Using Linux x86-64 Stable Binary Download

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube && rm minikube-linux-amd64

If using podman which is default in Oracle Linux 9 / Red Hat variants you will need to do the following to run it with sudo without a password

sudo visudo (add the below line at the bottom of the file changing username to the user that will run minikube)
username ALL=(ALL) NOPASSWD: /usr/bin/podman

sudo -k -n podman version (run this to confirm its working)

minikube start

Now that minikube is running – test kubectl command on cluster
•	kubectl cluster-info

Create a deployment
•	kubectl create deployment hello-node --image=registry.k8s.io/e2e-test-images/agnhost:2.39 -- /agnhost netexec --http-port=8080
•	kubectl get deployments

NAME         READY   UP-TO-DATE   AVAILABLE   AGE
hello-node   1/1     1            1           14s

•	kubectl get pods

NAME                          READY   STATUS    RESTARTS   AGE
hello-node-55fdcd95bf-8rdd5   1/1     Running   0          104s

Create a Service
•	kubectl expose deployment hello-node --type=LoadBalancer --port=8080
service/hello-node exposed
•	kubectl get services

NAME         	TYPE           	CLUSTER-IP     EXTERNAL-IP   	PORT(S)          		AGE
hello-node  	LoadBalancer   10.99.171.86   <pending>     	8080:32343/TCP   	74s
kubernetes   	ClusterIP      	10.96.0.1     	 <none>        	443/TCP          		42m

On Cloud Providers that support LoadBalancers, an external IP would be provisioned to access the service. On Minikube, the Load Balancer type makes the service accessible through the minikube service command
•	minikube service hello-node

|-----------------|----------------|-------------------|-----------------------------------|
| NAMESPACE |    NAME         | TARGET PORT  |                       URL                          |
|-----------------|----------------|-------------------|-----------------------------------|
| default             | hello-node  |      8080                | http://192.168.49.2:32343 |
|-----------------|----------------|-------------------|-----------------------------------|
🎉  Opening service default/hello-node in default browser...

This is what I saw in the browser
NOW: 2024-05-15 23:46:16.564593077 +0000 UTC m=+2142.880640931

Same message with curl, also confirmed with other sources this was correct output 

[brian@base ~]$ curl http://192.168.49.2:32343
NOW: 2024-05-15 23:47:32.502100061 +0000 UTC m=+2218.818147945

There are hello-minikube images as well, not sure why they changed what is used on minikube install site for test purposes

minikube dashboard & (use & when starting dashboard to run in background, will open in default browser)

Well done! This will help people who are interested in using VMWare for virtualization.

I wanted to edit the title to better reflect material but couldn’t

I thought it should say minikube LAB in VMware Workstation, Red Hat variants with podman

Luckily, I HAVE ABSOLUTE POWER. So done.

1 Like