<p>I try to test Kubernetes Ingress on Minikube. My OS is Windows 10. Minikube is installed successfully as well as Nginx ingress controller.</p>
<pre><code>&gt; minikube addons enable ingress
</code></pre>
<p>Below is my Kubernetes manifest file:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: test-ingress
  namespace: ingress-nginx
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
    kubernetes.io/ingress.class: 'nginx'
    nginx.ingress.kubernetes.io/default-backend: app-nginx-svc
spec:
  rules:
    - host: boot.aaa.com
      http:
        paths:
          - path: /path
            pathType: Prefix
            backend:
              service:
                name: app-nginx-svc
                port:
                  number: 80

---
apiVersion: v1
kind: Service
metadata:
  name: app-nginx-svc
  namespace: ingress-nginx
spec:
  type: NodePort  
  selector:
    app: test-nginx  
  ports:
  - name: http
    port: 80
    targetPort: 80
    nodePort: 30000

---
apiVersion: v1
kind: Pod
metadata:
  name: app-nginx
  namespace: ingress-nginx  
  labels:
    app: test-nginx
spec:
  containers:
  - name: nginx
    image: nginx
    ports: 
    - containerPort: 80
</code></pre>
<p>Kubernetes Pod and Service are generated on Minikube without errors. When I test service with the below commands, the pod shows the right values.</p>
<pre><code>&gt; minikube service -n ingress-nginx app-nginx-svc --url
* app-nginx-svc 서비스의 터널을 시작하는 중
|--------------------|---------------|-------------|------------------------|
|   NAMESPACE   |     NAME     | TARGET PORT |      URL           |
|--------------------|---------------|-------------|------------------------|
|  ingress-nginx  | app-nginx-svc |           | http://127.0.0.1:63623 |
|-------------------|---------------|-------------|------------------------|
http://127.0.0.1:63623
</code></pre>
<p>But the problem occurs in the Ingress object. The Minikube ingress generates the endpoint and host domain.</p>
<p><a href="https://i.stack.imgur.com/LpFyx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LpFyx.png" alt="enter image description here" /></a></p>
<p>I type in the domain mapping hostname in Windows 10 host file</p>
<pre><code>192.168.49.2       boot.aaa.com
</code></pre>
<p>But I can not receive any response from Nginx container:</p>
<p><a href="http://boot.aaa.com/path" rel="nofollow noreferrer">http://boot.aaa.com/path</a></p>
<p>The above URL does not work at all.</p>

Joseph Hwang
<p>When you try to access <a href="http://boot.aaa.com/path" rel="nofollow noreferrer">http://boot.aaa.com/path</a> - do you provide the port on which it listens? From what I see from the output of:</p>
<pre class="lang-sh prettyprint-override"><code>minikube service -n ingress-nginx app-nginx-svc --url
* app-nginx-svc 서비스의 터널을 시작하는 중
|--------------------|---------------|-------------|------------------------|
|   NAMESPACE        |      NAME     | TARGET PORT |          URL           |
|--------------------|---------------|-------------|------------------------|
|  ingress-nginx     | app-nginx-svc |             | http://127.0.0.1:63623 |
|--------------------|---------------|-------------|------------------------|
==&gt; http://127.0.0.1:63623 &lt;==

</code></pre>
<p>I think that you need to make request on: <strong><a href="http://boot.aaa.com:63623/path" rel="nofollow noreferrer">http://boot.aaa.com:63623/path</a></strong></p>
<p>If you don't want to use hostname in you Ingress, just remove it from manifest.</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: test-ingress
  namespace: ingress-nginx
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
    kubernetes.io/ingress.class: 'nginx'
    nginx.ingress.kubernetes.io/default-backend: app-nginx-svc
spec:
  rules:
    - http:
        paths:
          - path: /path
            pathType: Prefix
            backend:
              service:
                name: app-nginx-svc
                port:
                  number: 80
</code></pre>
<p>You should be able then to access your pod by only <strong>http://{IP}:{PORT}/path</strong></p>
<p>My additional questions:</p>
<ul>
<li>Are you trying to make request from the same OS where the minikube is installed?</li>
<li>Is the hostfile edited on the OS you are making requests from?</li>
<li>If yes, is the Windows firewall turned on?</li>
</ul>
<p>Also, I see that you <strong>Service</strong> expose a <strong>NodePort</strong> directly to your App on <strong>port 30000</strong> (it will not pass through Ingress controller).</p>
<p>Usually if we are setting up an Ingress endpoint to a Pod, we do it to avoid exposing it directly by the NodePort. Using <strong>ClusterIP</strong> service type will do so.</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: app-nginx-svc
  namespace: ingress-nginx
spec:
  type: ClusterIP
  selector:
    app: test-nginx  
  ports:
  - name: http
    port: 80
    targetPort: 80

</code></pre>
