Repository navigation
fix(gateway): Serve project load balancers only where enabled - #1181
Conversation
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
…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.
|
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. |
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
Fixes #1107. Follows #1106.