kubernetes-sigs / aws-load-balancer-controller

A Kubernetes controller for Elastic Load Balancers
https://kubernetes-sigs.github.io/aws-load-balancer-controller/
Apache License 2.0
3.9k stars 1.45k forks source link

Explicitly set subnet and not use auto discovery #3878

Open ketozhang opened 1 day ago

ketozhang commented 1 day ago

Is your feature request related to a problem? https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.1/deploy/subnet_discovery/

Currently assigning subnets to your ALB requires access to adding tags to the VPC. This introduces challenges in permission (users does not control VPC, but only EKS) and organization (in IaC, should this action be performed by VPC stack, the EKS stack, or Helm stack)?

Describe the solution you'd like Define the desired subnet(s) in Kubernetes files (Services and Ingress). Could this be possible with annotations? Can't we already specify subnets when creating ALBs through the ELB service?

ketozhang commented 1 day ago

There is already an annotation for this... https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.2/guide/service/annotations/#subnets https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.2/guide/ingress/annotations/#subnets

..., but not reference in any of the tutorials. Searching subnet in the service or ingress page only leads you to auto-discovery method.