<p>I would like to know, which are the endpoints correctly configured for a certain ingress.</p>

<p>For instance I have the following ingress:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: dictionary
spec:
  tls:
  - hosts:
    - dictionary.juan.com
    secretName: microsyn-secret
  backend:
    serviceName: microsyn
    servicePort: 8080
  rules:
    - host: dictionary.juan.com
      http:
        paths:
        - path: /synonyms/*
          backend:
            serviceName: microsyn
            servicePort: 8080
</code></pre>

<p>that is working the following service:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: microsyn
spec:
  ports:
  - port: 8080
    targetPort: 8080
    protocol: TCP
    name: http
  selector:
    app: microsyn
</code></pre>

<p>This service is exposing this deployment:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: microsyn
spec:
  replicas: 1
  selector:
    matchLabels:
      app: microsyn
  template:
    metadata:
      labels:
        app: microsyn
    spec:
      containers:
      - name: microsyn
        image: microsynonyms
        imagePullPolicy: Never
        ports:
        - containerPort: 8080
</code></pre>

<p>The application is a nodejs app listening on port 8080, that says hello for path '/', in a docker image I just created locally, that's the reason it has a imagePullPolicy: Never, it is just for testing purposes and learn how to create an ingress.</p>

<p>So I created the ingress from nginx-ingress and it is up and running with a nodeport for local environment test, later I will take it to a deployment with load balancer:</p>

<p><a href="https://github.com/nginxinc/kubernetes-ingress/tree/master/examples/complete-example" rel="nofollow noreferrer">https://github.com/nginxinc/kubernetes-ingress/tree/master/examples/complete-example</a></p>

<p>So I do the following:</p>

<p><code>minikube service list</code></p>

<p><code>
|---------------|----------------------|--------------------------------|
|   NAMESPACE   |         NAME         |              URL               |
|---------------|----------------------|--------------------------------|
| default       | kubernetes           | No node port                   |
| default       | microsyn             | No node port                   |
| kube-system   | default-http-backend | http://192.168.99.100:30001    |
| kube-system   | kube-dns             | No node port                   |
| kube-system   | kubernetes-dashboard | http://192.168.99.100:30000    |
| nginx-ingress | nginx-ingress        | http://192.168.99.100:31253    |
|               |                      | http://192.168.99.100:31229    |
|---------------|----------------------|--------------------------------|
</code></p>

<p>Brilliant I can do:</p>

<p><code>curl http://192.168.99.100:31253/synonyms</code></p>

<p>But then I get a:</p>

<pre><code>&lt;html&gt;
  &lt;head&gt;&lt;title&gt;404 Not Found&lt;/title&gt;&lt;/head&gt;
  &lt;body bgcolor="white"&gt;
    &lt;center&gt;&lt;h1&gt;404 Not Found&lt;/h1&gt;&lt;/center&gt;
    &lt;hr&gt;&lt;center&gt;nginx/1.15.2&lt;/center&gt;
  &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>So the only nginx I have is the one from this minikube, and it is working fine. But I cannot see which are the endpoints configured for this ingress...</p>

<p>I see the logs that says:</p>

<pre><code>2018/08/11 16:07:05 [notice] 117#117: signal process started
I0811 16:07:05.313037       1 event.go:218] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"default", Name:"dictionary", UID:"9728e826-9d80-11e8-9caa-0800270091d8", APIVersion:"extensions", ResourceVersion:"57014", FieldPath:""}): type: 'Normal' reason: 'AddedOrUpdated' Configuration for default/dictionary was added or updated
W0811 16:15:05.826537       1 reflector.go:341] github.com/nginxinc/kubernetes-ingress/nginx-controller/controller/controller.go:413: watch of *v1.ConfigMap ended with: too old resource version: 56348 (56655)
</code></pre>

<p>So that means that the dictionary ingress has being processed without errors.</p>

<p>But then Why I get a 404?</p>

<p>Where can I see the endpoints that are configured for this ingress??</p>

<p>I would like to run a command that says nginx --> which endpoints are you listening to?</p>

<blockquote>
  <p>But then Why I get a 404?</p>
</blockquote>

<p>Ingress resources -- or certainly the one you showed in your question -- use virtual-host routing, so one must set the <code>host:</code> header when interacting with that URL:</p>

<pre><code>curl -H 'host: dictionary.juan.com' http://192.168.99.100:31253/synonyms/something
</code></pre>

<p>I would have to look up the <code>path:</code> syntax to know if <code>/synonyms/*</code> matches <code>/synonyms</code>, which is why I included the slash and extra content in <code>curl</code>.</p>

<p>For interacting with it in a non-<code>curl</code> way, you can either change the <code>host:</code> in the <code>Ingress</code> to temporarily be 192.168.99.100 or use <a href="http://www.thekelleys.org.uk/dnsmasq/doc.html" rel="nofollow noreferrer">dnsmasq</a> to create a local nameserver where you can override <code>dictionary.juan.com</code> to always return <code>192.168.99.100</code>, and then Chrome will send the correct <code>host:</code> header by itself.</p>

<blockquote>
  <p>Where can I see the endpoints that are configured for this ingress??</p>
</blockquote>

<p>The question is slightly inaccurate in that <code>Endpoint</code> is a formal resource, and not related to an <code>Ingress</code>, but the answer is:</p>

<pre><code>kubectl get endpoints microsyn
</code></pre>

<blockquote>
  <p>I would like to run a command that says nginx --> which endpoints are you listening to?</p>
</blockquote>

<p>First, look up the name of the nginx-ingress Pod (any one of them should do, if you have multiple), and then look at the <code>nginx.conf</code> from the Pod to know exactly what rules it has converted the <code>Ingress</code> resource into:</p>

<pre><code>kubectl exec $ingress_pod cat /etc/nginx/nginx.conf
</code></pre>
