Skip to content

Conversation

zac-nixon
Copy link
Collaborator

Issue

Description

This PR introduces subnet discovery for the Gateway API. It sets up some of the basic model builders to resolve the information needed to construct the ELB Subnets, such as the LB scheme and IP Address Type.

The goal here is to make re-usable logic for both NLB and ALB subnet creation; essentially adding, merging, and refactoring the existing subnet logic from the service and ingress packages.

https://github.com/kubernetes-sigs/aws-load-balancer-controller/blob/main/pkg/service/model_build_load_balancer.go#L323

https://github.com/kubernetes-sigs/aws-load-balancer-controller/blob/main/pkg/ingress/model_build_load_balancer.go#L200

The goal I have in mind is to prevent one big builder object like the Ingress and Service models currently have. Instead, I'd like to strive more granular pieces of the model builder.

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the docs directory)
  • Manually tested
  • Made sure the title of the PR is a good description that can go into the release notes

BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯

  • Backfilled missing tests for code in same general area 🎉
  • Refactored something and made the world a better place 🌟

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 9, 2025
@zac-nixon zac-nixon force-pushed the znixon/subnet-discovery-gw branch 2 times, most recently from 6cd5f05 to 8189323 Compare April 10, 2025 01:21
}

for i, elbSubnet := range elbSubnets {
fmt.Println("HERE!")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: leftover log

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix

return nil
}

if len(elbSubnets) != len(subnetConfig) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is common error among all the mutators, lets check this once before starting the mutators for each config to avoid duplicate code.

Copy link
Collaborator Author

@zac-nixon zac-nixon Apr 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. I did this on purpose because I wanted the mutators to be agnostic of each other. This was to future proof these mutators where we might run a subset of them in the future.

@wweiwei-li
Copy link
Collaborator

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 17, 2025
@zac-nixon zac-nixon force-pushed the znixon/subnet-discovery-gw branch from 3441e11 to d87084c Compare April 17, 2025 21:39
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 17, 2025
@zac-nixon zac-nixon force-pushed the znixon/subnet-discovery-gw branch from d87084c to 3c6f92a Compare April 17, 2025 21:54
Copy link
Collaborator

@shraddhabang shraddhabang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 17, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: shraddhabang, zac-nixon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [shraddhabang,zac-nixon]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@zac-nixon zac-nixon merged commit 5997205 into kubernetes-sigs:main Apr 17, 2025
7 of 9 checks passed
@zac-nixon zac-nixon deleted the znixon/subnet-discovery-gw branch April 17, 2025 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants