<p>Currently, my <strong>kubernetes</strong> cluster (sitting on <strong>AWS</strong>) has a simple setup with a <code>Deployment</code>, which has a web container listens on <strong>80</strong> and <strong>443</strong>. </p>

<p>The cluster also has a <code>NodePort</code> service, which exposes the traffic to public on ports <strong>30080</strong> and <strong>30443</strong>. I am trying to figure out a way to accept public traffic on <strong>80</strong> and <strong>443</strong>. </p>

<p>What could be a good way to do that?</p>

<p><strong>My thoughts about possible solutions</strong>:</p>

<ol>
<li><p>Manually configure a <strong>ELB</strong> on AWS, which could map <strong>80</strong> and <strong>443</strong> traffic to <strong>30080</strong> and <strong>30443</strong> ports. </p></li>
<li><p>Use <code>LoadBalancer</code> supported by <strong>kubernetes</strong>, but I have some issues of integrating my cluster with <strong>AWS</strong> <a href="https://stackoverflow.com/questions/51254530/aws-load-balancer-is-not-registered-with-instances">described here</a>. I'd rather try other possible solutions than being stuck on this one. </p></li>
<li><p>I've seen many posts talking about <code>Ingress</code> service, but various posts have totally different setup. 
I wonder what could be a good use case for <code>Ingress</code> in my setup. 
Is <code>Ingress</code> supposed to replace my <code>NodePort</code> service in my case?</p></li>
</ol>

<p>Thanks</p>

<p>As soon as the <em>NodePort</em> service is bound to specified ports on all cluster nodes, you just need to deliver traffic to any of these nodes, or to all of them. Sometimes it could lead to additional delay, but from the connectivity perspective, it should work fine.</p>

<p>You can configure <em>Load Balancer</em> manually, then add all cluster nodes to its pool and configure health checks for them to exclude a node from the pool when a particular node fails.</p>

<p><em>Ingress</em> actually works in a similar way. All traffic that comes to a specific port of any node is forwarded to the <em>Ingress pod</em>. 
<em>Ingress controller</em> looks for created <em>Ingress objects</em> and configures the <em>Ingress pod</em> according to the specifications in these objects. 
Actually, <em>Ingress controller</em> and <em>Ingress pod</em> in my example are the same thing.  </p>

<p>Ingress can provide additional logic for managing the traffic on the HTTP level, like path based routing, adjusting the request before sending it to the service, serving like SSL endpoint, etc.<br>
But anyway, you should deliver external traffic to the nodes somehow. At this point, we are returning to the <em>Load Balancer</em> configuration.  </p>

<p>In some cases, when your cluster is deployed on the cloud that provides <em>Load Balancer</em> service, Ingress controller takes care about creating cloud <em>Load Balancer</em> also.</p>

<p>Did you use <a href="https://kubernetes.io/docs/setup/custom-cloud/kops/" rel="nofollow noreferrer">kops</a> to deploy your Kubernetes cluster on AWS?  </p>

<p>Usually, kops create a cluster that integrates with AWS without any problems, so you can use the LoadBalancer type of Service. Doing everything manually you can make small configuration mistake that would be hard to find and correct.</p>

<p>Please check out the very good article: </p>

<ul>
<li><a href="https://medium.com/google-cloud/kubernetes-nodeport-vs-loadbalancer-vs-ingress-when-should-i-use-what-922f010849e0" rel="nofollow noreferrer">Kubernetes NodePort vs LoadBalancer vs Ingress? When should I use what?</a></li>
</ul>

<p>How to create Ingress on AWS:</p>

<ul>
<li><a href="https://medium.com/kokster/how-to-setup-nginx-ingress-controller-on-aws-clusters-7bd244278509" rel="nofollow noreferrer">How to setup NGINX ingress controller on AWS clusters</a> </li>
<li><a href="http://kubernetes-on-aws.readthedocs.io/en/latest/user-guide/ingress.html" rel="nofollow noreferrer">Ingress</a></li>
<li><a href="https://github.com/kubernetes/kops/tree/master/addons/kube-ingress-aws-controller" rel="nofollow noreferrer">Creating ingress with kube-ingress-aws-controller and skipper</a></li>
</ul>
