M Hamza Razzaq
M Hamza Razzaq

Reputation: 472

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 ?

Upvotes: 5

Views: 1960

Answers (3)

JGutierrezC
JGutierrezC

Reputation: 4532

In case someone else is having this issue, having extra annotations like these make the IP Address to always show as PENDING

service.beta.kubernetes.io/aws-load-balancer-type: "external"
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: "ip"
service.beta.kubernetes.io/aws-load-balancer-scheme: "internet-facing"

Make sure to only have the annotations as @dev-rowbot stated

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"

Upvotes: 0

dev-rowbot
dev-rowbot

Reputation: 488

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"

Upvotes: 5

Zakaria Jawwad
Zakaria Jawwad

Reputation: 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.

Upvotes: 0

Related Questions