Skip to content

Keep NetworkRules consistent across clusters so backend replies have a return path #706

Closed as not planned

Description

@privateip

Summary

A backend's reply leaves through the edge node in front of that backend. That node needs to know the VIP, or it doesn't claim the reply and the node's kube-proxy forwarding rules drop it. Within one cluster, the reconciler guarantees this. Across clusters, it only works if the same NetworkRule exists on both sides, and nothing enforces that.

datum-cloud/enhancements#884 keeps every backend in the load balancer's own region in its first phase (enforced by #736). So for now this matters only where a region has more than one cluster. It becomes the general case with #884's second phase, global anycast, and the fan-out should be built so it extends to backends in several regions without a redesign.

Acceptance criteria

  • The higher-layer controller from Public API for network load balancer #696 writes the rule into every cluster in the load balancer's region that holds one of its backends
  • Galactic sets a status condition on a rule when a backend sits in a cluster with no matching rule (no reply path)
  • A test with backends in two clusters of one region passes, and fails with the condition set when the second cluster's rule is removed

Phase 2 of #698.

Activity

  1. added
    galactic-gateway
    on Oct 4, 2026
  2. added theissue type on Oct 4, 2026
  3. self-assigned this
    on Oct 9, 2026
  4. privateip commented on Oct 22, 2026

    @privateip
    ContributorAuthor

    Closing this: the failure it describes can't happen in galactic, and the fan-out it asks for is already part of #696.

    A gateway only forwards to a backend whose node is in its own cluster:

    1. A rule's backends are the VPCAttachments its selector matches in the gateway's cluster (rulebackends.go#L222-L245).
    2. Each backend gets its SRv6 uSID only from a BGPRouter and BGPAdvertisement in that same cluster, for the node the attachment names (usidresolver.go#L116-L141). EVPN carries routes between clusters, not those objects.
    3. A backend that doesn't resolve is left out of the Maglev table and reported as BackendsUnresolved. The rule keeps serving through the rest (networkgateway_controller.go#L1527-L1538). TestNetworkGatewayReconciler_ServesThroughResolvedBackends and TestBackendSIDIndex_OtherNodeIsError pass on main and cover this.

    The resolver worked the same way when this issue was filed, before #809 replaced the backend list with a selector: a backend address resolved only against the local cluster's advertisements.

    So a backend always replies through an edge node in the cluster that holds the rule. A backend in a second cluster isn't reached through the first cluster's gateways at all. It is served only if that cluster has its own copy of the rule, and then by its own gateways.

    For each criterion:

    • Fan-out to every cluster in the region that holds a backend. This is the Public API for network load balancer #696 controller's job, and Public API for network load balancer #696 already lists it in its scope.
    • A condition when a backend's cluster has no matching rule. Galactic can't detect this. The cluster with the rule never sees the other cluster's attachments, and the cluster without it has no rule to put a condition on. The higher-layer controller that knows the region's clusters is where that check belongs.
    • A two-cluster test. With galactic as built, each cluster serves only its own backends, so removing the second cluster's rule stops those backends from being served. It doesn't break a reply path.

    If #884's second phase needs a gateway to forward to backends in another cluster, that is new resolution work and would need its own issue. Please reopen this if you see a gateway forward to a backend outside its cluster on the latest main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

galactic-gateway

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions