Repository navigation
feat(gateway): Report on a load balancer rule whether it serves traffic - #962
Conversation
28235be to
02ed7fd
Compare
be6ed2b to
eaf3555
Compare
|
The failed CI task is fixed in #964 |
To tell whether a NetworkService serves, a client had to know every gateway node, read each node's Programmed condition on the rule, and read each node's NetworkGateway for whether its routes were published. The tenant-facing API (#696) must not reach into NetworkGateway. Each gateway node now writes <node>/Advertised beside <node>/Programmed. It is True once the node published the rule's BGPAdvertisements and galactic-router reports each one Advertised for its current generation, and otherwise False with NotProgrammed, NoRouter, AdvertisementFailed or AdvertisementPending. A status write that changes whether one of the node's rule advertisements is installed now wakes the gateway pass. NetworkServiceReconciler rolls the per-node conditions up into rule-wide ones: - Programmed: every reporting gateway node loaded the rule. - Advertised: every node that loaded it has its routes installed. - BackendsReady: every backend node bound its backends, and no gateway node left one out unresolved. - IPv4Served: on a rule with an IPv4 VIP only, every node that loaded the rule serves that VIP. - Ready: Accepted and the above, reading IPv4Served only for a rule with no IPv6 VIP. IPv4 VIPs are off by default, and a rule whose IPv6 VIP serves must not read as down. Only gateway nodes reporting on the current generation count, since a node that has not reported advertises nothing; Programmed and Ready say how many have not. A per-node condition, or Accepted, from an older generation counts as pending. A failing summary takes the reason every failing node shares, or a generic one. Every input is shared state, so every gateway node computes the same result. The summary is re-read through the uncached APIReader and written only on change. clearNodeRuleConditions recomputes it, since no reconciler is left once the last gateway node leaves. BackendsReady leaves room for the reply-path check (#706) and backend health (#704). docs/gateway/configuration.md gains the reason table the tenant-facing API maps from. Related to #708 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The status docs said a gateway node whose datapath is off advertises nothing and so carries none of a rule's traffic. It advertises none of the rule's VIPs, but a backend node that reaches clients through more than one edge node still sends some replies through it. The node does not claim them, so those TCP connections fail while the rule reports Ready. Say so in the reason docs and in summaryConditions' doc comment, so a reader does not take a node that has not reported as one that carries nothing. Related to #708 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eaf3555 to
5aa7196
Compare
|
Review record for this head. The first-pass re-reviewer confirmed every earlier finding fixed and held only on a commit subject length, since corrected. The first-pass conventions reviewer held on the same subject plus owner decisions, all settled: this PR merges before #845, and the lab validation passed. The latest conventions review returned merge, and its one warning and one nit are fixed in the docs commit. Verdicts, verbatim as recorded for the session: pr-rereviewer at 02ed7fd: every first-pass finding confirmed fixed; held only on a commit subject length, since fixed. pr-conventions-reviewer at 02ed7fd: held on the same subject (fixed) plus owner decisions, all settled. pr-conventions-reviewer at be6ed2b: merge. The RAN: lists were not passed to the closing step, so they are not reproduced here. The lab validation run covered both test-plan items and both passed: the rule-wide Ready condition holds after the traffic checks on all six lab rules, and a dual-stack rule with IPv4 off stays Ready with IPv4Served False and reason Unsupported. The author can tick both boxes. The datapath behaviour that lab check 3 exposed is tracked in #963 and is not part of this PR. #708 stays open, as this PR is related to it. Applied findings are in the two commits on this branch, now rebased onto current main; the docs fixes are in the later commit. CI on head 5aa7196 is green: Build, Lint, Unit Tests, Unit Tests (root), E2E Tests, the CLA check and every image and bundle publish job. Auto-merge is enabled with the merge method, the only one the ruleset allows. The ruleset requires one approving review including a code owner, and a push dismisses earlier approvals, so the PR waits for a human approval. |
Summary
To tell whether a load balancer rule serves traffic, a client had to know every gateway node and read each node's own status object.
Each rule now reports, on the rule itself, whether it is loaded, whether its routes are installed, whether its backends are ready, and whether it is ready overall, plus whether its IPv4 address serves when it has one.
A rule whose IPv6 address serves stays ready when its IPv4 address does not, since IPv4 is off on most gateways.
Test plan
Related to #708
🤖 Generated with Claude Code