<p>I have hard time getting this working with NLB using ingress controller :
<a href="https://kubernetes.github.io/ingress-nginx/deploy/#network-load-balancer-nlb" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/deploy/#network-load-balancer-nlb</a></p>

<p>Even subnets are not taking effect here , its not passing my configurations in the API that creates the NLB:</p>

<pre><code>================================
kind: Service
apiVersion: v1
metadata:
  name: ingress-nginx
  namespace: ingress-nginx
  labels:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-type: nlb
    service.beta.kubernetes.io/aws-load-balancer-eip-allocations: "eipalloc- 
    07e3afcd4b7b5d644,eipalloc-0d9cb0154be5ab55d,eipalloc-0e4e5ec3df81aa3ea"
    service.beta.kubernetes.io/aws-load-balancer-subnets: "subnet- 
    061f4a497621a7179,subnet-001c2e5df9cc93960"
spec:
  type: LoadBalancer
  selector:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
  ports:
  - name: http
    port: 80
    targetPort: http
  - name: https
    port: 443
    targetPort: https
</code></pre>

amit
<p>The number of <a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/guide/service/annotations/#eip-allocations" rel="nofollow noreferrer">eip allocations</a> must match the number of subnets in the <a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/guide/service/annotations/#subnets" rel="nofollow noreferrer">subnet annotation</a>.</p>
<p><code>service.beta.kubernetes.io/aws-load-balancer-eip-allocations: eipalloc-xyz, eipalloc-zzz</code></p>
<p><code>service.beta.kubernetes.io/aws-load-balancer-subnets: subnet-xxxx, mySubnet</code></p>
<p>You have 3 allocations but only 2 subnets.</p>
<p>In addition, the annotation</p>
<p><code>service.beta.kubernetes.io/aws-load-balancer-scheme: &quot;internet-facing&quot;</code>
is missing.</p>
<p>By default this will use scheme &quot;internal&quot;.</p>
<p>I assume since you are allocating elastic IP addresses that you might want &quot;internet-facing&quot;.</p>
<p>Also, you are using annotations that are meant for &quot;AWS Load Balancer Controller&quot; but you are using an &quot;AWS cloud provider load balancer controller&quot;</p>
<blockquote>
<p>The external value for aws-load-balancer-type is what causes the AWS
Load Balancer Controller, rather than the AWS cloud provider load
balancer controller, to create the Network Load Balancer.
<a href="https://docs.aws.amazon.com/eks/latest/userguide/network-load-balancing.html#nlb-sample-app-verify-deployment" rel="nofollow noreferrer">docs</a></p>
</blockquote>
<p>You are using <code>service.beta.kubernetes.io/aws-load-balancer-type: nlb</code>
which means that none of the links provided earlier in this answer pertain to your Load Balancer. <code>nlb</code> type is an &quot;AWS cloud provider load balancer controller&quot; not an &quot;AWS Load Balancer Controller&quot;</p>
<p>For &quot;AWS cloud provider load balancer controller&quot; all <a href="https://docs.aws.amazon.com/eks/latest/userguide/network-load-balancing.html" rel="nofollow noreferrer">the docs</a> reference is <a href="https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer" rel="nofollow noreferrer">this</a>.</p>
