-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Describe the feature you are requesting
Add support for adopting existing ALBs when Gateway API and Ingress resources target the same load balancer name. Currently, when a Gateway resource is configured to use an ALB name that already exists (managed by an Ingress or a different stack), the controller attempts to call CreateLoadBalancer instead of recognizing the existing ALB, resulting in:
DuplicateLoadBalancerNameException: A load balancer with the same name 'my-alb' exists, but with different settings
The controller should detect existing ALBs by name and either adopt them (update tags and reconcile) or provide a clear error message explaining the conflict.
Motivation
This feature is critical for users migrating from Ingress to Gateway API. The current behavior forces users to either:
- Use different ALB names and manage a complex DNS cutover
- Delete all Ingress resources first, causing downtime
- Manually orchestrate the transition outside the controller
A seamless migration path would allow teams to:
- Gradually migrate routes from Ingress to Gateway API while sharing the same ALB
- Avoid provisioning duplicate load balancers during transition periods
- Reduce migration risk and downtime
A similar issue has been reported before (see #3338 and #228) but a solution hasn't been provided Gateway API. The Gateway API beta release makes this increasingly important as more users will attempt Ingress → Gateway migrations.
Describe the proposed solution you'd like
Modify loadBalancerSynthesizer.Synthesize() in pkg/deploy/elbv2/load_balancer_synthesizer.go to check for existing ALBs by name before calling Create():
- Add a new method
findExistingLoadBalancerByName()that usesDescribeLoadBalancerswith theNamesparameter - Before creating an "unmatched" resource LB, check if an ALB with that name already exists
- If it exists, adopt it by:
- Adding/updating the tracking tags (
elbv2.k8s.aws/cluster,gateway.k8s.aws.alb/stack, etc.) - Calling
Update()instead ofCreate()to reconcile the desired state
- Adding/updating the tracking tags (
- If adoption fails due to incompatible settings (e.g., different scheme, VPC), provide a clear error message
This would enable both Ingress and Gateway API resources to share ownership of the same ALB when they specify the same loadBalancerName.
Describe alternatives you've considered
-
Fail-fast with helpful error: Instead of adopting, detect the conflict and return a descriptive error explaining why the ALB can't be created and suggesting remediation steps. This is safer but doesn't solve the migration use case.
-
Manual tag pre-seeding: Document a workaround where users manually add Gateway API tracking tags to existing ALBs before deploying Gateway resources. This is error-prone and requires AWS console/CLI access.
-
Parallel ALBs during migration: Use different ALB names and manage DNS cutover. This works but increases cost, complexity, and migration risk.
Contribution Intention (Optional)
- Yes, I am willing to contribute a PR to implement this feature
- No, I cannot work on a PR at this time