<p>I'm having troubles setting up kubernetes ingress-nginx in order to expose my app externally. Here are the steps that I did:</p>

<p><strong>Application deployment:</strong></p>

<ol>
<li>Created namespace called ingress</li>
<li>Deployed statefulset set resource that describes my application (let's call it testapp) in ingress namespace</li>
<li>Created ClusterIP service that makes my app available in the kube cluster
(testapp) in ingress namespace</li>
</ol>

<p><strong>Ingress nginx setup:</strong></p>

<ol>
<li>Created ingress-nginx controller in namespace ingress</li>
<li>Created ingress-nginx service in namespace ingress </li>
</ol>

<blockquote>
<pre><code>ingress-nginx          NodePort    10.102.152.58   &lt;none&gt;      80:30692/TCP,443:32297/TCP   6d2h
</code></pre>
</blockquote>

<ol start="3">
<li>Created ingress resource type in ingress namespace that looks like this</li>
</ol>

<blockquote>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target:  /
  name: testappingress
spec:
  rules:
  - host: testapp.k8s.myorg.io
    http:
      paths:
      - backend:
          serviceName: testapp
          servicePort: 80
        path: /
</code></pre>
</blockquote>

<p>If I do describe of ingress resource, I get this:</p>

<pre><code>ubuntu@ip-10-0-20-81:~/ingress$ kubectl describe ingress testappingress -n ingress
Name:             testappingress
Namespace:        ingress
Address:
Default backend:  default-http-backend:80 (&lt;none&gt;)
Rules:
  Host                      Path  Backends
  ----                      ----  --------
  testapp.k8s.myorg.io
                            /   testapp:80 (&lt;none&gt;)
Annotations:
  kubernetes.io/ingress.class:                 nginx
  nginx.ingress.kubernetes.io/rewrite-target:  /
Events:
  Type    Reason  Age   From                      Message
  ----    ------  ----  ----                      -------
  Normal  CREATE  15m   nginx-ingress-controller  Ingress ingress/testappingress
  Normal  CREATE  15m   nginx-ingress-controller  Ingress ingress/testappingress
  Normal  UPDATE  14m   nginx-ingress-controller  Ingress ingress/testappingress
  Normal  UPDATE  14m   nginx-ingress-controller  Ingress ingress/testappingress
</code></pre>

<p>If I check logs from ingress-nginx controller, I get following:</p>

<pre><code>I0317 15:06:00.029706       6 event.go:221] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"ingress", Name:"testappingress", UID:"2c8db73f-48c6-11e9-ae46-12bdb9ac3010", APIVersion:"extensions/v1beta1", ResourceVersion:"1185441", FieldPath:""}): type: 'Normal' reason: 'CREATE' Ingress ingress/testappingress
I0317 15:06:00.039419       6 controller.go:177] Configuration changes detected, backend reload required.
I0317 15:06:00.508433       6 controller.go:195] Backend successfully reloaded.
I0317 15:06:00.568448       6 controller.go:212] Dynamic reconfiguration succeeded.
</code></pre>

<p><strong>Route53/ELB classic setup:</strong></p>

<ol>
<li>Created ELB classic which points to kubernetes cluster instances and exposes port 80</li>
<li>Created Route53 entry in existing hosted zone (CNAME) which points to ELB classic from above.</li>
<li>Setup Health Check on ELB to point to ingress-nginx NodePort service on port: <strong>30692</strong> which works.</li>
</ol>

<p>When I do:</p>

<pre><code>curl http://testapp.k8s.myorg.io
</code></pre>

<p>I don't get any response.</p>

<p><strong>Here is what I've tried to troubleshoot the problem:</strong></p>

<p>If I do:</p>

<pre><code>telnet testapp.k8s.myorg.io 80
</code></pre>

<p>It will resolve to my ELB classic DNS name</p>

<p>If I go into any container/pod that exist inside ingress namespace and do following:</p>

<pre><code>curl http://testapp 
</code></pre>

<p>I will get appropriate response.</p>

<p>From this I can conclude following:</p>

<ol>
<li><p>Application is correctly deployed and available through the service that is exposed (ClusterIP) from the inside of kubernetes cluster</p></li>
<li><p>DNS gets resolved properly to the ELB </p></li>
<li><p>HealthCheck on ELB works</p></li>
</ol>

<p>Not sure what else could I do to troubleshoot why I'm unable to access my service through Ingress? </p>

Bakir Jusufbegovic
<p>It was a mistake on my end. The missing part was following:</p>

<p>On the ELB, I didn't set listeners correctly. So basically, what was needed is to point 80/443 port from ELB to the NodePorts of Ingress Service. </p>

<pre><code>ingress-nginx   ingress-nginx          NodePort    10.96.249.168    &lt;none&gt;        80:32327/TCP,443:30313/TCP   25h
</code></pre>
