Skip to content

fix(gateway): Serve project load balancers only where enabled - #1181

Merged
privateip merged 2 commits into
mainfrom
fix/issue-1107
Oct 28, 2026
Merged

privateip merged 2 commits into
mainfrom
fix/issue-1107

Conversation

@privateip

@privateip privateip commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Project-namespace load balancers could be served by any gateway that saw them, from namespaces it should not trust, with addresses the platform never allocated. A project load balancer deleted after the last gateway left also kept its namespace in Terminating.

Gateways now serve project namespaces only when a location turns it on, trust gateway definitions only in the gateway namespace, and refuse a load balancer outside the allocated prefixes. Deleting a project load balancer withdraws its routes and releases its finalizer, with the switch on or off, and the settings are documented.

Important

Until a location turns on project-namespace serving and sets its allocated address ranges, this release stops serving those load balancers.

Test plan

  • Each new behavior has a unit test that fails without its fix
  • Lint, unit tests and generated-docs checks pass
  • Kind e2e and lab suites, not run locally

Fixes #1107. Follows #1106.

Project-namespace serving (#1106) trusted any namespace that held a NetworkGateway, accepted any address no other service used, and was always on. This change closes those gaps and adds a rollout switch.

- GALACTIC_GATEWAY_PROJECT_SERVICES turns project-namespace serving on. It defaults to off: a gateway then serves only the services in its own namespace, as before #1106.
- Only NetworkGateways in GALACTIC_GATEWAY_NAMESPACE, which the DaemonSet sets to the pod's namespace, are trusted, with the switch on or off. A NetworkGateway anywhere else is ignored, so it serves nothing, its namespace's services are still checked, and its deletion no longer stops the engine.
- A project service with a VIP outside GALACTIC_GATEWAY_PROJECT_VIP_PREFIXES gets Accepted=False with reason VIPOutsidePool, and the gateway does not load it. A prefix covering every address is refused at startup.
- A watch the role denies now fails startup. VPCs are watched and checked only with the switch on.
- A deleting service that no NetworkGateway serves is torn down by any gateway process, so its namespace no longer stays Terminating.
- With the switch off, a project service accepted while it was on gets Accepted=False with reason ProjectServicesOff, and the orphan sweep withdraws its advertisements.

Conflict lookup by address is deferred, as #1107 asks for it only if the full list gets slow.

Fixes #1107
@privateip privateip self-assigned this Oct 28, 2026
@privateip
privateip requested a review from a team as a code owner October 28, 2026 11:10
…elete

A project service's advertisements live in the gateway namespace, whether project services are on or off. reconcileUnserved chose the advertisement namespace from the switch, so a project rule accepted while the switch was on and deleted after it was turned off had its finalizer released with its routes still advertised. Pick the gateway namespace for any project rule.

The new test deletes a project rule with the switch off and expects the advertisement withdrawn and the finalizer released. It fails without the change.
@privateip privateip changed the title fix(gateway): Harden load balancers served from project namespaces fix(gateway): Gate and harden project-namespace load balancers Oct 28, 2026
@privateip privateip changed the title fix(gateway): Gate and harden project-namespace load balancers fix(gateway): Serve project load balancers only where enabled Oct 28, 2026
@privateip
privateip enabled auto-merge October 28, 2026 11:37
@privateip

Copy link
Copy Markdown
Contributor Author

Two review passes ran on this branch.

First pass: the adversary reviewer held the change, and its findings were fixed. The conventions reviewer held on decisions the user had already settled: ship now, and merge #1181 before #845.

Second pass: the re-reviewer returned merge. It confirmed all four fixes and checked that the new test fails without its fix. The conventions reviewer returned merge.

Not run: the Kind e2e and lab suites. CI ran what it runs, and every check on the head commit passed.

The second commit's subject is 74 characters, over the 72 limit. Rewording it needs a force-push, so it stays as is.

Auto-merge is enabled with the merge method, the only one the main ruleset allows. The ruleset requires one approving review from a code owner on the latest push, so the PR waits for a human approval.

@privateip
privateip merged commit 8bd1f52 into main Oct 28, 2026
23 checks passed
@privateip
privateip deleted the fix/issue-1107 branch October 28, 2026 12:01
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.

Harden load balancers served from project namespaces

2 participants