aws eks ALB, NLB error: service Failed build model due to unable to resolve at least one subnet

2023. 8. 10. 15:36Dev/EKS

728x90
반응형

EKS AWS LBC is not able to auto-discover subnets

 

 

https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.5/deploy/subnet_discovery/

---

Public subnets¶
Public subnets are used for internet-facing load balancers. These subnets must have the following tags:

Key Value
kubernetes.io/role/elb 1 or ``

 

Private subnets¶
Private subnets are used for internal load balancers. These subnets must have the following tags:

Key Value
kubernetes.io/role/internal-elb 1 or ``

 

Common tag¶
In version v2.1.1 and older of the LBC, both the public and private subnets must be tagged with the cluster name as follows:

Key Value
kubernetes.io/cluster/${cluster-name} owned or shared

 

But the subnet tags are already well set up.

and i finally find below answer.

 

https://stackoverflow.com/questions/66039501/eks-alb-is-not-to-able-to-auto-discover-subnets

 

kubectl get deployment -n kube-system aws-load-balancer-controller -oyaml |grep "cluster-name"

...

when install aws loadbalancer controller with helm, didn't update current eks-cluster-name

 

kubectl edit deployment -n kube-system aws-load-balancer-controller

or

helm upgrade ~

 

 

Events:
  Type     Reason                  Age                  From     Message
  ----     ------                  ----                 ----     -------
  Warning  FailedBuildModel        9m15s (x2 over 14m)  service  Failed build model due to unable to resolve at least one subnet
  Normal   SuccessfullyReconciled  7m3s                 service  Successfully reconciled

 


---

other issue

https://keyhyuk-kim.medium.com/aws-eks%EC%97%90%EC%84%9C-subnet-cidr%EC%9D%84-%EC%9E%91%EA%B2%8C-%EC%9E%A1%EC%9C%BC%EB%A9%B4-%EC%83%9D%EA%B8%B0%EB%8A%94-%EB%B2%84%EA%B7%B8-unable-to-discover-at-least-one-subnet-5ef6aef361af

 

AWS ALB, subnet CIDR 범위로 인한 문제(unable to discover at least one subnet)

위 패키지를 이용해서 ALB ingress를 사용하고 있다.

keyhyuk-kim.medium.com

 

subnet cidr is too small

 

1. Confirm that you have at least two subnets in two different Availability Zones, which is a requirement for creating an Application Load Balancer.Note: You can create a Network Load Balancer with a single subnet.

2. For each subnet, specify a CIDR block with at least a /27 bitmask (for example: 10.0.0.0/27) and at least eight free IP addresses.

3. Confirm that the tags on the subnets are formatted correctly. For example, the tags must not have any leading or trailing spaces.