<p>I am facing the problem which is that I could not access the Kubernetes Ingress on the Browser using it's IP. I have installed K8s and Minikube on Windows 10 Home.</p>
<p>I am following this official document - <a href="https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/" rel="noreferrer">https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/</a></p>
<ol>
<li><p>First I created the deployment by running this below command on Minikube.</p>
<p>kubectl create deployment web --image=gcr.io/google-samples/hello-app:1.0</p>
</li>
</ol>
<p>The deployment get created which can be seen on the below image:
<a href="https://i.stack.imgur.com/RnXrR.png" rel="noreferrer"><img src="https://i.stack.imgur.com/RnXrR.png" alt="enter image description here" /></a></p>
<ol start="2">
<li><p>Next, I exposed the deployment that I created above. For this I ran the below command.</p>
<p>kubectl expose deployment web --type=NodePort --port=8080</p>
</li>
</ol>
<p>This created a service which can be seen by running the below command:</p>
<pre><code>kubectl get service web
</code></pre>
<p>The screenshot of the service is shown below:
<a href="https://i.stack.imgur.com/FD24O.png" rel="noreferrer"><img src="https://i.stack.imgur.com/FD24O.png" alt="enter image description here" /></a></p>
<ol start="3">
<li><p>I can now able to visit the service on the browser by running the below command:</p>
<p>minikube service web</p>
</li>
</ol>
<p>In the below screenshot you can see I am able to view it on the browser.
<a href="https://i.stack.imgur.com/fLqzA.png" rel="noreferrer"><img src="https://i.stack.imgur.com/fLqzA.png" alt="enter image description here" /></a></p>
<ol start="4">
<li><p>Next, I created an Ingress by running the below command:</p>
<p>kubectl apply -f <a href="https://k8s.io/examples/service/networking/example-ingress.yaml" rel="noreferrer">https://k8s.io/examples/service/networking/example-ingress.yaml</a></p>
</li>
</ol>
<p>By the way the ingress yaml code is:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: example-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$1
    spec:
      rules:
        - host: hello-world.info
          http:
            paths:
              - path: /
                pathType: Prefix
                backend:
                  service:
                    name: web
                    port:
                      number: 8080
</code></pre>
<p>The ingress gets created and I can verify it by running the below command:</p>
<pre><code>kubectl get ingress
</code></pre>
<p>The screenshot for this is given below:
<a href="https://i.stack.imgur.com/tb0yt.png" rel="noreferrer"><img src="https://i.stack.imgur.com/tb0yt.png" alt="enter image description here" /></a></p>
<p>The ingress ip is listed as <code>192.168.49.2</code>. 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 screeshot.</p>
<p><a href="https://i.stack.imgur.com/MrIko.png" rel="noreferrer"><img src="https://i.stack.imgur.com/MrIko.png" alt="enter image description here" /></a></p>
<p>What is the problem. Please provide me a solution for it?</p>
<p>I also added the mappings on etc\hosts file.</p>
<pre><code>192.168.49.2 hello-world.info
</code></pre>
<p>Then I also tried opening hello-world.info on the browser but no luck.</p>
<p>In the below picture I have done ping to <code>hello-world.info</code> which is going to IP address 192.168.49.2. This shows etc\hosts mapping is correct:</p>
<p><a href="https://i.stack.imgur.com/bSdsR.png" rel="noreferrer"><img src="https://i.stack.imgur.com/bSdsR.png" alt="enter image description here" /></a></p>
<p>I also did curl to minikube ip and to <code>hello-world.info</code> and both get timeout. See below image:
<a href="https://i.stack.imgur.com/r61ey.png" rel="noreferrer"><img src="https://i.stack.imgur.com/r61ey.png" alt="enter image description here" /></a></p>
<p>The <code>kubectl describe services web</code> provides the following details:</p>
<pre><code>Name:                     web
Namespace:                default
Labels:                   app=web
Annotations:              &lt;none&gt;
Selector:                 app=web
Type:                     NodePort
IP:                       10.100.184.92
Port:                     &lt;unset&gt;  8080/TCP
TargetPort:               8080/TCP
NodePort:                 &lt;unset&gt;  31880/TCP
Endpoints:                172.17.0.4:8080
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   &lt;none&gt;
</code></pre>
<p>The <code>kubectl describe ingress example-ingress</code> gives the following output:</p>
<pre><code>Name:             example-ingress
Namespace:        default
Address:          192.168.49.2
Default backend:  default-http-backend:80 (&lt;error: endpoints &quot;default-http-backend&quot; not found&gt;)
Rules:
  Host              Path  Backends
  ----              ----  --------
  hello-world.info
                    /   web:8080   172.17.0.4:8080)
Annotations:        nginx.ingress.kubernetes.io/rewrite-target: /$1
Events:             &lt;none&gt;
</code></pre>
<p>Kindly help. Thank you.</p>

yogihosting
<p>Having same issue as OP and things only work in <code>minikube ssh</code>, sharing the ingress.yaml below.</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: frontend-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
  defaultBackend:
    service:
      name: default-http-backend
      port:
        number: 80
  rules:
    - host: myapp-com # domain (i.e. need to change host table)
      http:
        paths: # specified path below, only be working when there is more than 1 path; If only having 1 path, it's always using / as path
          - path: /
            pathType: Prefix
            backend:
              service: 
                name: frontend-service # internal service
                port: 
                  number: 8080 # port number that internal service exposes
          - path: /e($|/)(.*)
            pathType: Prefix
            backend:
              service: 
                name: express-service # internal service
                port: 
                  number: 3000 # port number that internal service exposes

</code></pre>
