feat: add multi-ALB load balancing for scope ingress#164
Merged
Conversation
4b4fac7 to
65e580a
Compare
javi-null
previously approved these changes
Apr 9, 2026
The merge-base changed after approval.
0b85c26 to
5dceeb1
Compare
pilundain
approved these changes
Apr 9, 2026
javi-null
approved these changes
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
k8s/scope/build_contextinto a dedicatedk8s/scope/networking/resolve_balancerscriptadditional_public_balancersandadditional_private_balancers, distributing scopes across ALBs by selecting the one with the fewest HTTPS listener rulesProblem
ALBs have a limit of ~100 rules per listener. When a cluster hosts many scopes on a single ALB, it fills up. Additionally, the ALB is resolved independently during scope creation (Route53 record) and deployment (ingress), which can produce different results if rule counts change between the two — leading to DNS pointing to ALB-A while the ingress is on ALB-B.
Solution
Multi-ALB load balancing (scope creation)
When
additional_public_balancersoradditional_private_balancersare configured in thescope-configurationsprovider, the script:Deployment-time consistency
When running in a deployment context (vs scope creation), the script skips recalculation and instead looks up the ALB already in use:
alb.ingress.kubernetes.io/load-balancer-nameannotation from existing ingress for the scopeProvider configuration
{ "scope-configurations": { "networking": { "additional_public_balancers": ["alb-public-2", "alb-public-3"], "additional_private_balancers": ["alb-private-2", "alb-private-3"] } } }When these arrays are not configured, the script behaves exactly as before (single ALB, no AWS API calls for rule counts).
AWS Permissions
New permission required (only when using additional balancers at deployment time):
route53:ListResourceRecordSetsget_alb_from_route53The following permissions are already required by existing scripts (
verify_ingress_reconciliation,route53/manage_route):elasticloadbalancing:DescribeLoadBalancersverify_ingress_reconciliation,route53/manage_routeelasticloadbalancing:DescribeListenersverify_ingress_reconciliationelasticloadbalancing:DescribeRulesverify_ingress_reconciliationFiles changed
k8s/scope/networking/resolve_balancerk8s/scope/build_contextsourcecallk8s/scope/tests/networking/resolve_balancer.batsCHANGELOG.mdTest plan
resolve_balancercovering:scope-configurations>container-orchestration)build_contexttests pass (no regression)deployment/build_contexttests pass (no regression)