Skip to content

feat: Give load balancers a public IPv6 address per location - #712

Merged
scotwells merged 1 commit into
codex/nlb-api-foundationfrom
codex/nlb-allocation
Oct 25, 2026
Merged

scotwells merged 1 commit into
codex/nlb-api-foundationfrom
codex/nlb-allocation

Conversation

@scotwells

@scotwells scotwells commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Each load balancer gets a public IPv6 address in every location where its backends run, or in the locations the customer chooses. Status lists the chosen locations, each address, and a stable hostname per location that customers can point DNS at. When an address changes or a location is dropped, the old address stays reserved until traffic and DNS for it have been withdrawn. Publishing DNS records and IPv4 addresses come later.

Test plan

  • Allocation tests cover 16 addresses across 65 locations
  • Tests cover the per-load-balancer limit and withdrawal of old addresses
  • Lint passes

One known gap: if someone deletes an address reservation directly, outside the load balancer, the address can be released before it's withdrawn.

Depends on #624. Replaces #626. Related to #611 and datum-cloud/enhancements#884

@scotwells
scotwells requested a review from a team as a code owner October 23, 2026 15:55
@scotwells
scotwells requested review from ecv and kevwilliams October 23, 2026 15:55
@scotwells scotwells self-assigned this Oct 23, 2026
@cla-assistant

cla-assistant Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Each load balancer gets one public IPv6 address in every location where its
backends run, or in the locations the customer chooses, so customers have a
stable per-location address and hostname to point DNS at.

Key changes:
- Reserve one IPv6 address per address request and selected location
- Report selected locations, addresses and per-location hostnames in status
- Hold an old address until traffic and DNS for it are withdrawn
- Refuse selections above the 1,024 endpoint limit before claiming addresses

@kevwilliams kevwilliams left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Adds the allocation controller that holds one public IPv6 IPClaim per load balancer, address request, location and family, with deterministic UID-scoped claim names, UID preconditions on release, and a finalizer that waits until announced, programmed or published addresses are withdrawn before releasing them. Build, vet and the new unit tests pass, and mutating the withdrawal gate, the orphan cleanup or the per-location claim identity makes those tests fail, so they test the logic for real. Non-blocking: the controller lists NetworkLoadBalancerRoutes without a route RBAC grant (#713 in this stack adds it), and with the default Backends source a single missing route or backend NetworkService resolves the whole request to zero locations, which releases its unannounced addresses. That second point is worth keeping in mind once addresses are announced.

@ecv ecv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approve.
Ran at 9d6ed42: the NetworkLoadBalancer controller tests pass with envtest 1.31.0 and the locations CRDs rendered, and go vet is clean.
internal/controller/networkloadbalancer_controller.go:54 lists RBAC markers for networks, locations and namespaces only, but the reconciler also lists NetworkLoadBalancerRoute, NetworkService and NetworkInterface.
Route read access only arrives in #713, so this commit alone fails the default Backends source under the shipped role.
Add the three resources to the markers here so each commit in the stack runs.
internal/controller/networkloadbalancer_controller.go:308 picks the winning route without the capability filter and UID tie-break that oldestRouteForListener applies in #713.
Reuse one function so address placement and route status cannot pick different routes.
internal/controller/networkloadbalancer_controller.go:129 sets allAllocated false when no route is attached, so a new load balancer reports Allocated=False with "One or more requested addresses are pending or awaiting withdrawal" (line 220).
Report a reason such as AwaitingRoute instead, since the proposal says placement is pending with no route.
Nit: the file carries 22 comment lines and the repo CLAUDE.md asks for none.
Stack: based on #624, merge after it.

@scotwells
scotwells merged commit c0bce97 into main Oct 25, 2026
10 checks passed
@scotwells
scotwells deleted the codex/nlb-allocation branch October 25, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants