My issue is exactly the same as this. But replication the question again for your reference::
I am facing the problem which is that I could not access the Minikube Ingress on the Browser using it's IP. I have installed Minikube on Windows 10 Home, and starting the minikube with docker driver(minikube start --driver=docker
).
System info:
Windows 10 Home
Minikube(v1.18.1)
Docker(driver for minikube) - Docker engine version 20.10.5
I am following this official document - https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/
First I created the deployment by running this below command on Minikube.
kubectl create deployment web --image=gcr.io/google-samples/hello-app:1.0
The deployment get created which can be seen on the below image: enter image description here
Next, I exposed the deployment that I created above. For this I ran the below command.
kubectl expose deployment web --type=NodePort --port=8080
This created a service which can be seen by running the below command:
kubectl get service web
The screenshot of the service is shown below:
minikube service web
In the below screenshot you can see I am able to view it on the browser.
kubectl apply -f https://k8s.io/examples/service/networking/example-ingress.yaml
The ingress gets created and I can verify it by running the below command:
kubectl get ingress
The screenshot for this is given below:
The ingress ip is listed as 192.168.49.2. So that means if I should open it in the browser then it should open, but unfortunately not. It is showing site can't be reached. See the below screenshot.
What is the problem. Please provide me a solution for it?
I also added the mappings on etc\hosts file.
192.168.49.2 hello-world.info
Then I also tried opening hello-world.info on the browser but no luck.
In the below picture I have done ping to hello-world.info which is going to IP address 192.168.49.2. This shows etc\hosts mapping is correct:
I also did curl to minikube ip and to hello-world.info and both get timeout. See below image:
The kubectl describe services web
provides the following details:
Name: web
Namespace: default
Labels: app=web
Annotations: <none>
Selector: app=web
Type: NodePort
IP: 10.100.184.92
Port: <unset> 8080/TCP
TargetPort: 8080/TCP
NodePort: <unset> 31880/TCP
Endpoints: 172.17.0.4:8080
Session Affinity: None
External Traffic Policy: Cluster
Events: <none>
The kubectl describe ingress example-ingress
gives the following output:
Name: example-ingress
Namespace: default
Address: 192.168.49.2
Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
Rules:
Host Path Backends
---- ---- --------
hello-world.info
/ web:8080 172.17.0.4:8080)
Annotations: nginx.ingress.kubernetes.io/rewrite-target: /$1
Events: <none>
The issue seems to have been resolved there, by following the below instructions(as posted in the comments):
Once you setup the ingress with necessary change, i guess you are in the powershell of windows with minikube running right? Make sure you ‘enable addons ingress’ and have a separate console running ‘minikube tunnel’ as well. Also, add the hostname and ip address to windows’ host table. Then type ‘minikue ssh’ in powershell, it gives you command line. Then you can ‘curl myapp.com’ then you should get response as expected.
Nevertheless, in my case, the minikube tunnel is not responding upon giving the minikube tunnel
command. :
I am not able to curl hello-world.info
even through minikube ssh
. Kindly help!
On Windows
After some decent amount of time, I came to the conclusion that ingress has some conflicts to work with Docker on Windows10-Home. Things are working fine if we want to expose a service of NodePort type but Ingress is troublesome.
Further, I tried to set up WSL 2 with Ubuntu in Windows 10 but no luck.
Finally, the following worked for Ingress of Minikube on Windows10 Home:
Control Panel -> Programs -> Turn Windows Features on and off (under Programs and Features)
and then click ok. Restart your computer if prompted to.minikube delete
minikube start --driver=virtualbox
if minikube start --driver=virtualbox
doesn't work, then use minikube start --driver=virtualbox --no-vtx-check
.
This process solved my problem and ingress is working fine on my Windows 10 Home Minikube.
On Ubuntu
Finally, Docker on Ubuntu is inherently supporting Minikube Ingress seamlessly without any glitch.