Skip to content

feat: take a VPC identifier from the network - #16

Merged
scotwells merged 2 commits into
mainfrom
feat/vpc-from-fabric-identity
Aug 27, 2026
Merged

feat: take a VPC identifier from the network#16
scotwells merged 2 commits into
mainfrom
feat/vpc-from-fabric-identity

Conversation

@scotwells

@scotwells scotwells commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

A network in two locations behaves as two unrelated networks on the fabric: each location's VPC drew its own random identifier, so the two got different VRF names and different Route Targets and never imported each other's routes. The identity that makes them one network is already allocated centrally, once per network, and carried to every cell that needs it, and nothing read it.

A VPC now derives its identifier from that identity, encoded through the existing identifier package so the reserved-value guards and the character budget for kernel interface names still apply. A VPC that already has an identifier keeps it, since renumbering a live one would rename its VRF device and change its routes under running traffic.

A VPC whose identity has not reached the cell yet writes no identifier and reports Ready=False with reason AwaitingFabricIdentity until it arrives. There is deliberately no fallback: the identifier is immutable, so a random value taken while waiting is permanent, and the extension server refuses to bind a VRF for any Envoy cluster spanning two VPCs, meaning a network whose locations disagree would serve nothing at all rather than recover the moment its identity lands.

Test plan

task generate (no diff), task lint, task test:unit. New tests cover a derived identifier, the wait writing nothing, the identity arriving mid-wait being taken, an already-allocated VPC left alone, and the watch enqueuing only the right network's contexts.

Related

A VPC drew its own random identifier per location, so the two locations of
one network were two unrelated networks on the fabric: different VRF names,
different Route Targets, no route import between them. The identity that
makes them one network is already allocated centrally and carried to each
cell, and nothing read it.

The VPC now derives its identifier from that identity, through the existing
identifier package so the reserved-value guards and the base62 width that
keeps a kernel interface name inside fifteen characters still apply.

Key changes:
- Read the NetworkFabricIdentity for the context's network and encode
  spec.identity as the VPC identifier
- Wait up to five minutes from the VPC's own creation timestamp for an
  identity that has not propagated yet, since the identifier is immutable
  and a fallback taken early is permanent
- Fall back to the previous random draw past that window, so a network that
  will never have an identity still gets a working VPC
- Report the wait as Ready=False with reason AwaitingFabricIdentity
- Watch NetworkFabricIdentity so an arriving identity is taken at once
Falling back to a random identifier when the fabric identity has not
arrived is worse than having no VPC. The identifier is immutable, so the
fallback is permanent, and the extension server refuses to bind a VRF for
any Envoy cluster whose members span more than one VPC. A network whose
locations disagree therefore serves no traffic at all, including through
healthy members, where a network still waiting recovers the instant its
identity lands.

Key changes:
- Remove the grace period, the poll interval and the random fallback: a
  VPC with no identity writes no identifier and waits
- Rely on the NetworkFabricIdentity watch alone; the informer lists before
  it watches, so an identity present at startup is seen rather than missed
- Delete allocateVPCIdentifier, RandomVPCBase62 and RandomVPC, which the
  fabric identity leaves with no callers
@scotwells
scotwells marked this pull request as ready for review August 27, 2026 19:18
@scotwells
scotwells requested a review from a team as a code owner August 27, 2026 19:18
@scotwells
scotwells requested review from ecv and privateip and removed request for ecv August 27, 2026 19:18
@scotwells
scotwells merged commit a9c7716 into main Aug 27, 2026
8 checks passed
@scotwells
scotwells deleted the feat/vpc-from-fabric-identity branch August 27, 2026 19:19
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.

2 participants