Skip to content

Integrate Envoy through the galactic-vrf sidecar #1439

Closed

Description

@privateip

Parent: Deliver Galactic Worker with Local and Fabric delivery for tenant services

Deliverable

One Envoy proxy serves local and remote backends through VRF-bound upstream sockets, with the galactic-vrf sidecar consuming Worker attachments. It satisfies the ALB part of the "Deliver service consumers" phase exit.

References:

  • Sidecar: cmd/galactic-vrf and internal/ingresssidecar (store.go, ebpfdatapath.go, gatewayreply.go with ensureGatewayReplyRedirect).
  • Host-return writer to move under Worker: internal/installer/sidecarreturn.go.
  • The image is containers/galactic-vrf/Dockerfile. No config/galactic-vrf manifest exists, so this Task ships one.

PR #1384 changes redirect-route cleanup in internal/ingresssidecar. If it has merged to main before this PR, incorporate it into the branch and record that. Otherwise this PR carries the same rule: remove a redirect route only through its own VRF.

Work items

  • Have the sidecar request the host attachment and own the pod-side VRF, gateway address and tenant routes. Share one pod-to-host routed pair per attached VPC. Use the physical locator and current host attachment to choose a local backend route or a remote encapsulating route.
  • Install the gateway return /128 in the canonical host VRF ahead of default NAT, and keep remote reachability.
  • Fence link and advertisement transfer by proxy pod UID. Serialize replacement unless overlapping ownership is implemented and tested.
  • Add the config/galactic-vrf manifest component, covered by task test:manifests.
  • Expose the sidecar's Worker capability state and failure reasons through existing diagnostics and metrics.

Dependencies

Blocked by #1434, #1435 and #1436. Runs in parallel with #1437, #1438 and #1440.

Acceptance

Run in the #1432 topology:

  • HTTPS requests complete through one proxy into two VPCs with overlapping backend addresses, on both fresh and reused connections. Captures and socket reads show that each upstream socket receives the correct reply with the right source.
  • Moving an endpoint off-node, deleting the last TAP and replacing the proxy each leave the successor and other tenants working, and cleanup removes only the old owner's state.
  • task test:manifests renders the new component.
  • The delivering PR targets integration/galactic-worker, carries this evidence and says Fixes datum-cloud/galactic#1439. GitHub does not auto-close from a non-default base, so close this issue explicitly when the PR merges and record the PR and merged SHA.

Activity

  1. added theissue type on Nov 18, 2026
  2. self-assigned this
    on Nov 19, 2026
  3. privateip commented on Nov 19, 2026

    @privateip
    ContributorAuthor

    Triage on integration/galactic-worker at 6e0de37: the work is still needed.

    • The galactic-vrf sidecar has no Worker client. It encapsulates every backend, local or remote, through eBPF on a veth pair inside the pod (internal/ingresssidecar/ebpfdatapath.go). Replies return through a flower redirect on the pod's eth0 (gatewayreply.go) and the installer's return tables from 0xF000 (internal/installer/sidecarreturn.go).
    • The sidecar writes BGPVRFInstance without the Argument lock (internal/ingresssidecar/gateway.go:273) and writes its own BGPAdvertisement (gateway.go:300).
    • Worker's Local module already serves local.socket claims with a routed link, the attachment's /128s in the host VRF and PassThroughLocal entries. Its host end runs only local_link_guard, so remote backends cannot be reached through it alone, and no part of Worker publishes a BGPAdvertisement for a claim's addresses.
    • No config/galactic-vrf manifest exists.
    • fix(ingress-sidecar): remove a redirect route only via its own VRF #1384 is still an open draft against main. Its files on this branch match its base, so this Task carries its rule and test.
  4. privateip commented on Nov 19, 2026

    @privateip
    ContributorAuthor

    Approved plan:

    • Claims. The sidecar opens one socket claim per attached VPC through the Worker socket, mounted with hostPath (D9). The claim's attachment is the proxy's VPCAttachment in that VPC, whose address is the gateway address (D26). Its destinations are the backend VPCAttachments matched from EndpointSlice addresses. The sidecar releases its claims on shutdown.
    • Pod-side state. The sidecar owns the pod VRF, the gateway /128 on the routed link's pod end and the per-backend routes. Envoy binds upstream sockets to the VPC's VRF. The sidecar's BGPVRFInstance write is removed; Worker's nodevpc.Ensure writes it under the Argument lock.
    • Backend routes. A backend that Worker resolves to Local is routed over the routed link to the host end's link-local address, which Worker now reports in handoff_interfaces. A Fabric backend keeps the in-pod encapsulation, whose egress_route_table rows stay in the sidecar's private table range, where it is the only writer.
    • Return path. Local's /128 and PassThroughLocal entry in the host VRF keep replies away from the default NAT route. Worker publishes a BGPAdvertisement for each socket or routed_link claim's addresses, keyed by the claim and pod UID, and withdraws it on release, lease expiry or a pod change. The installer's sidecar return writer, reaper and sweep are retired, and one prune of leftover 0xF000 tables is kept.
    • Replacement. Worker's ClaimHeldByAnotherPod serializes replacement. The successor retries and stays not ready until it holds its claims, and cleanup removes only the old pod UID's state.
    • Diagnostics. New sidecar metrics report Worker capability state, claim conditions and reasons, and each destination's mode.
    • Manifests. A self-contained config/galactic-vrf Component, rendered by a tests/manifests/galactic-vrf fixture under task test:manifests.
    • Docs. The decisions are recorded as D31. NSO's creation of the proxy's per-VPC VPCAttachment is documented as an external prerequisite for production; the lab fixture creates it.
    • Tests. Unit tests against a fake Worker (claims, retries, route choice); root tests for overlapping backends in two pod VRFs and for advertisement publish, move and withdraw; fix(ingress-sidecar): remove a redirect route only via its own VRF #1384's redirect-route test; and a lab HTTPS run through one proxy into two VPCs with overlapping backends, local and remote, over fresh and reused connections, with captures, socket reads and the move, last-TAP and replacement cases.
  5. privateip commented on Nov 21, 2026

    @privateip
    ContributorAuthor

    Scope change, decided by the epic owner: this issue now delivers Envoy through the galactic-vrf sidecar to local tenant backends only. Remote backends move to #1487.

    On nodes running Cilium, the sidecar's in-pod SRv6 encapsulation is dropped as source spoofing at the pod's host veth, because the outer source is the node's SID, not the pod's address. #1487 sends remote traffic over the routed link into the host VRF instead.

    The delivering PR must show the local rows passing in the lab, with the remote rows skipped and citing #1487.

  6. privateip commented on Nov 21, 2026

    @privateip
    ContributorAuthor

    Delivered by #1463, merged into integration/galactic-worker as 113d8d7. The lab's Envoy case passed at b839832 with 170 rows and none failed, followed by the lab's verification on the same deploy; the evidence is on #1463. Scope is backends on the proxy's own node. Remote backends moved to #1487.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions