Search code examples
amazon-web-serviceskubernetes-ingressamazon-eksnginx-ingressnlb

nginx ingress controller type nlb with static ip giving error "AllocationIdNotFound"


I am creating nginx ingress controller of type nlb with static ips, but for static ips I am getting this error AllocationIdNotFound. Although this allocation id is valid and eip with this id is present in the same region. Here are the annotations that I am using with nginx ingress controller service

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
      service.beta.kubernetes.io/aws-load-balancer-subnets: "subnet-xxxxxxxxxx, subnet-xxxxxxxxxx"
      service.beta.kubernetes.io/aws-load-balancer-eip-allocations: "eipalloc-xxxxxxxxxx, eipalloc-xxxxxxxxxx"

If I comment service.beta.kubernetes.io/aws-load-balancer-eip-allocations annotation, load balancer gets created successfully but without eips.

What am I doing wrong here ?


Solution

  • You're not doing anything wrong, I have just encountered the same issue.

    There seems to be a bug in the way the service interprets the service.beta.kubernetes.io/aws-load-balancer-eip-allocations annotation. If you remove the space after the comma it should work.

    Try this:

    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
          service.beta.kubernetes.io/aws-load-balancer-subnets: "subnet-xxxxxxxxxx, subnet-xxxxxxxxxx"
          service.beta.kubernetes.io/aws-load-balancer-eip-allocations: "eipalloc-xxxxxxxxxx,eipalloc-xxxxxxxxxx"