skip to Main Content

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 ?

2

Answers


  1. You need to manually create eips either through cli or console and add there allocation id as comma separated in the annotation, it’ll get created. Make sure to have same number of subnets and eips as your availability zones.

    Login or Signup to reply.
  2. 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"
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search