<p>I've set up a Kubernetes ingress with minikube, on a virtual machine of CentOS 7.6.
It finally works well in that machine, described as below:</p>
<pre><code>Name:             my-ingress
Namespace:        default
Address:          172.17.0.2
Default backend:  default-http-backend:80 (&lt;error: endpoints &quot;default-http-backend&quot; not found&gt;)
Rules:
  Host        Path  Backends
  ----        ----  --------
  localhost
              /route1/?(.*)   service1 (172.18.0.4:80)
              /route2/?(.*)   service2 (172.18.0.4:80)
Annotations:  kubernetes.io/ingress.class: nginx
              nginx.ingress.kubernetes.io/rewrite-target: /$1
</code></pre>
<p>And I made my <code>/etc/hosts</code> as follow</p>
<pre><code>172.17.0.2      localhost
172.17.0.2      0.0.0.0
</code></pre>
<p>Which works fine on the virtual machine, that I can successfully access my API through <code>curl localhost/route1/api/values</code>.</p>
<p>But here I would like to access this on other machine for developing.  My thought was to see the same successful result through <code>curl 192.168.2.21/route1/api/values</code> on other machine, with <code>192.168.2.21</code> the IP address of the virtual machine with Kubernetes.  But it failed with message &quot;empty reply from server&quot;.</p>
<p>Is there other method that I can make this happen, accessing the result of ingress on other machine?</p>
<p>What I tried was to install <a href="https://github.com/jnewland/local-dev-with-docker-for-mac-kubernetes" rel="nofollow noreferrer">local-dev-with-docker-for-mac-kubernetes</a>, but didn't help.
And also saw some other suggestions to work around services, but for I would have to work with a lot of services, afraid that may be hard to manage if I have to avoid any port duplicated.  So am looking for result workaround Ingress mainly.</p>

Ellie Wu
<p>Your config specifying host as localhost, so only incoming traffic with localhost got handled. You can verify this with <code>curl 172.17.0.2/route1/api/values</code> from the same machine. Should get the same empty reply message.</p>
<p>To fix this, you can omit the host setting so ingress controller will handle all incoming HTTP traffics. <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-rules" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-rules</a></p>
<p><strong>UPDATE</strong></p>
<p>minimal ingress example:</p>
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: test-ingress
spec:
  backend:
    serviceName: testsvc
    servicePort: 80
</code></pre>
