Skip to content

feat(edge): Create an ingress gVPC per public listener provider - #1520

Merged
privateip merged 4 commits into
mainfrom
fix/issue-1509-ingress
Nov 29, 2026
Merged

privateip merged 4 commits into
mainfrom
fix/issue-1509-ingress

Conversation

@privateip

@privateip privateip commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

An Edge provider's public listener needs a private network of its own, holding only that provider's listener attachments, and nothing creates one.

Core, the Galactic cell controller, now creates one ingress network per approved provider with the public listener capability, using a /64 from an operator-set unique local prefix and an identity the operator reserves by hand until #1516 moves allocation to the fabric.

It refuses an identity another network already holds, and the later pull requests in this stack put listeners on it.

Its new Role can write any network object in the gateway namespace, so core touches only the ones it labelled, and nothing happens until an operator sets an ingress identity.

Test plan

  • An approved provider with a configured identity gets its ingress network, with a /64 that stays put across restarts
  • A provider with no identity, or one another network holds, gets no ingress network and an event that says why
  • A network object core did not label is never written or deleted, and one still referenced by a service is kept
  • CI passes

Related to #1509

Core now keeps one ingress gVPC per approved provider that lists
PublicListener: the VPC edge-ingress-<provider> in the gateway
namespace, with a /64 carved from an operator-configured unique local
prefix and the provider's operator-assigned fabric identity as its
status.vpc.

Two galactic-controller flags configure it, both read with --edge:
--edge-ingress-identity maps a provider to its decimal identity, and
--edge-ingress-prefix is the prefix the /64s come from; it must be
reserved for ingress gVPCs. The first /64 a provider tries is fixed by
a hash of its name, and the one recorded in the VPC's immutable spec
never moves. A provider the prefix has no free /64 for is retried every
minute. A recorded identifier is kept, and reported in the VPC's Ready
condition, if the configured identity changes. A provider without an
identity gets no gVPC and an Event on its EdgeProvider. A provider that
may no longer hold a listener loses its gVPC only once no EdgeService
grants it and no NetworkService names its identifier.

A VPC of that name with a controller is not core's: NSO adopts the VPC
named after a NetworkContext in the same namespace, so core neither
trusts nor writes one that has a controller.

Listener admission finds the gVPC through the IngressVPCs interface, so
a later change can look up a VPC another component creates instead.

A Role in galactic-system grants the VPC writes.

Refs #1509
@privateip privateip self-assigned this Nov 29, 2026
@privateip
privateip added this pull request to stack #1524 November 29, 2026 03:43
Before core records a provider's ingress identity as its ingress gVPC's
status.vpc, it now lists the VPCs in every namespace. When another VPC
already holds that identifier, core writes nothing, reports Ready False
with reason IdentityInUse, records an Event on the EdgeProvider, and
refuses the gVPC to listeners. It looks again every retry interval, so
the identity is recorded once the other VPC lets it go.

A provider whose ingress gVPC name, edge-ingress-<provider>, exceeds
the object-name limit gets no gVPC and an IngressVPCNameTooLong Event,
and is not retried.

Tests cover both, and that a VPC of the ingress gVPC's name without
core's label and annotation is never written or deleted.

Refs #1509
@privateip

Copy link
Copy Markdown
Contributor Author

Review verdicts at head 2899f07: the correctness re-review says merge, and the conventions review says merge.

The first pass asked for three changes, and all three are in. Core now refuses an ingress identity that another network already holds. A test proves core never writes or deletes a network object it did not label. A provider name too long for a network name gets an event and no create loop. The re-review confirmed that both new tests fail when their guard is removed.

Two points were declined. The branch keeps its signed merge of main rather than being rebased, because this stack carries main up with merges and never force-pushes. The cluster-wide read on the Role stays, because the controller's informer lists cluster-wide.

One CI job, the root-gated installer test, failed on an unrelated health-check timing flake and passed on rerun.

@privateip
privateip marked this pull request as ready for review November 29, 2026 04:55
@privateip
privateip requested a review from a team as a code owner November 29, 2026 04:55
@privateip
privateip requested a review from scotwells November 29, 2026 04:55
ecv
ecv previously approved these changes Nov 29, 2026

@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.

Per-provider ingress gVPC is isolated by construction (distinct operator-set fabric identity, disjoint /64, a provider's name can never reach another's VPC) and nothing happens until an operator passes --edge-ingress-identity/--edge-ingress-prefix, so merging changes no production behavior; production moves only when infra pins a galactic tag and sets those flags. Checks at 2899f07 are green (Unit Tests, E2E, Lint, Manifests). Repo is public, nothing site-specific here. Stack note: #1522 is not stacked on this PR directly; the chain is #1520 <- #1521 <- #1522 <- #1523.

  • Isolation: carve avoids only /64s of VPCs in the gateway namespace, so overlap with a VPC elsewhere or a prefix not reserved for ingress is not caught (the comment says the prefix must be reserved). Follow-up: say in the infra pin docs that --edge-ingress-prefix is a reserved range, or list VPCs cluster-wide as identityHolder already does.
  • Isolation: the identity-in-use check lists VPCs then patches only its own VPC with an optimistic lock, so two writers claiming one identity (a hand-reserved one now, fabric allocation after #1516) can both pass. Safe today because ParseIdentities rejects duplicates in one flag set. Follow-up: revisit when #1516 lands.
  • Lifecycle: the gVPC has no owner or finalizer. A provider deleted while the controller is down is still reclaimed because the VPC watch enqueues the provider name on start and the prov == nil path runs reclaim. Delete uses a UID precondition and is refused while an EdgeService or NetworkService still holds it. Good.
  • RBAC: Role galactic-controller-edge-listener grants create/update/patch/delete on every VPC in galactic-system, not just labelled ones; the author documents it and the code only writes objects it labelled and that carry no controller (isIngressVPC). Agree with the declined cluster-wide-read point. Follow-up: if tenant or NSO VPCs live in galactic-system, a ValidatingAdmissionPolicy limiting this SA to edge-ingress labelled VPCs would make "least privilege" real.
  • Tests: the guards (unlabelled/adopted VPC untouched, identity in use, name taken, prefix exhausted) are envtest only; this checkout had no envtest binaries, so I did not run the mutation test myself. The PR comment says the re-review confirmed both new tests fail without their guard, and CI ran them at this head.
  • Teammates: none reviewed this PR.

@scotwells scotwells 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.

Please leave an ingress network alone if another controller adopts it during cleanup. reclaim checks ownership before deletion, but the delete only checks the UID, which adoption does not change. Guard the delete with the resource version you inspected and recheck ownership on conflict. Please cover adoption between the read and delete.

Reclaim checked that core still owned the ingress gVPC, then deleted it
on a UID precondition alone. Adoption by another controller does not
change the UID, so a gVPC adopted between the check and the delete was
deleted anyway.

The delete now also requires the resource version inspected. On a
conflict core reads the gVPC again and leaves it alone when it is no
longer an ingress gVPC core created; otherwise the provider is decided
again on the next pass.
@privateip

Copy link
Copy Markdown
Contributor Author

Fixed in f594e5c. reclaim now deletes on the UID and the resource version it inspected. On a conflict it reads the ingress gVPC again and leaves it alone if it is no longer an ingress gVPC core created; otherwise the next pass decides it again. TestIngressReclaimRace adopts the gVPC, and separately relabels it, between the read and the delete. Both cases fail without the fix.

@privateip
privateip requested a review from scotwells November 29, 2026 17:06

@scotwells scotwells 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.

Approved the per-provider ingress network design. Cleanup now leaves a network alone if another controller adopts it.

@privateip
privateip merged commit 81e9f5b into main Nov 29, 2026
28 checks passed
@privateip
privateip deleted the fix/issue-1509-ingress branch November 29, 2026 21:27
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