AWS EKS: load balancer service stuck in external ip pending

I have a EKS cluster (1.19) with a public and private subnets. I deployed ingress nginx with the following annotations:

service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp
service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "true"
service.beta.kubernetes.io/aws-load-balancer-type: nlb

It worked fine – the load balancer was created but I needed a static IP for the load balancer. After reading the documentation I've allocated two elastic IPs and specified them along with my public subnets in the annotations:

service.beta.kubernetes.io/aws-load-balancer-eip-allocations: eipalloc1,eipalloc2
service.beta.kubernetes.io/aws-load-balancer-subnets: subnet1,subnet2

Now the service is stuck in in EXTERNAL-IP: pending state. What am I doing wrong?

P.S. I also use one of the IPs for the NAT gateway used in private subnets but I don't think that's the issue.


Solution 1:

Surprisingly, this happened exactly because I used the same Elastic IP in NAT gateway