<p>I am new to Kubernetes and AWS and exploring different AWS technologies for a project. One thing I am doing as part of that is to see how we can have routes in API Gateway connect to an EKS cluster (in a VPC).</p>

<p>This is what I have working:</p>

<ul>
<li>An EKS Cluster</li>
<li>In the EKS Cluster I have nginx ingress-controller running</li>
<li>I have an EC2 inside the VPC and verified that I can reach a service running in the cluster through EC2 by using the ingress-controller url</li>
</ul>

<p>This is what I am trying:</p>

<ul>
<li>I tried to create an API Gateway route to access the same service using the ingress-controller url -> To achieve that, I am trying the steps here (because my cluster is in a VPC): <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-nlb-for-vpclink-using-console.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-nlb-for-vpclink-using-console.html</a></li>
<li>One thing that is not clear to me is that, how do I specify the ingress-controller url as a target for the NLB? The only targets that I can specify are EC2 instances, but I want to direct the traffic through the ingress-controller (which is a service of type loadbalancer in K8s).</li>
</ul>

<p>If I am doing this wrong way, please advice the right way of exposing EKS cluster in API Gateway through the nginx ingress controller. Thanks!</p>

<p>I have found the problem. When using nginx-ingress-controller, I just had to specify the annotation that it is of type "nlb"</p>

<p>service.beta.kubernetes.io/aws-load-balancer-type: nlb</p>

<p>Once I deploy the ingress controller with this annotation, it automatically creates an nlb in aws and sets the target according to the ingress defined! I was creating a new nlb myself and then trying to point to the ingress-controller which is not needed (nor the right way).</p>
