Repository navigation
Closed
Description
Parent: Deliver Galactic Worker with Local and Fabric delivery for tenant services
Deliverable
Ordered and hashed NAT66 and NAT64 egress selects a ready colocated shard through Local and keeps remote shard delivery through Fabric. It satisfies the NAT part of the "Deliver service consumers" phase exit.
Today ShardCandidate.Local in internal/plumbing/ebpf/egressroutemap/shardgroup.go excludes a node's own shard: it is never alive for tenants on that node. This Task replaces that exclusion with readiness-gated local selection.
References:
- Selection:
ShardGroupTable.Apply,GroupPolicy,TranslationClassandNAT64Class. - Node driver:
internal/installer/egressgroup.go(egressShardCandidates,spec.drain,spec.nat64Standby). - Datapath:
internal/plumbing/ebpf/natprog/nat.c(nat_ingress,nat66_*,nat64_*,nat_conn_table) andinternal/plumbing/ebpf/natmap/conntable.go. - Service:
cmd/galactic-nat/nat.go(setupNatDatapath).
Work items
- Add shard destination resolution to Worker. Implement Worker reconciliation and its authenticated service API #1433 ships the shard destination kind as
Resolved=False/DestinationKindUnsupported; this Task replaces that with resolution from NAT's trusted shard identity and locator, and documents the source indocs/worker/contract.md. - Make initial selection and refresh respect local readiness, class eligibility, drain, pins and standby.
- Carry tenant identity from TAP ingress across the internal receive pair. Use one shard-owned session table at both the internal and the public XDP entries.
- Return using the saved backend SID and physical locator. Route public masquerade addresses to their owning shard. Keep the shard locator distinct from the tenant-router locator.
- Limit a pair failure to the affected eligibility, and document which established sessions survive it.
- Expose NAT's Worker capability state and failure reasons through existing NAT diagnostics and
go.miloapis.com/instrumentationmetrics.
Dependencies
Blocked by #1434, #1435 and #1436. Runs in parallel with #1438, #1439 and #1440.
Acceptance
Run in the #1432 topology with one local and one remote shard path:
- Both translations work for TCP, UDP and supported ICMP, with overlapping guest addresses and ports. Each guest sees the right external source and reverse delivery, including NAT64 IPv4 replies.
- After the pair is recreated, NAT restarts and a shard drains, pins hold and state is reused as the contract says, and captures show no underlay hairpin.
task test:unitcovers the selection changes, and the lab checksverify:nat-sharding,verify:nat-egressandverify:nat-return-routestill pass.- The delivering PR targets
integration/galactic-worker, carries this evidence and saysFixes datum-cloud/galactic#1437. 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
privateip commentedon Nov 19, 2026
Triage: valid
Checked against
integration/galactic-workerat 6e0de37.resolveDestinationininternal/worker/reconcile.gorefuses every shard destination withDestinationKindUnsupported.ShardGroupTable.Applynever marks a local shard alive, andanyPrimaryAliveignores it. The datapath treats the LOCAL flag as metrics only (prog/usid.c,egress_shard_member.flags).nat.conly accepts SRv6. It reads the tenant from the uSID Argument and the outer source, keys sessions on that source (conn_key.encap_src), and always re-encapsulates the return.So a tenant always reaches a remote shard, even when a ready shard runs on its own node.
Plan
ShardRefgainsname, which names an EgressShard; a request that setsgrouporindexis refused withMalformedSpec. A shard resolves only when it is not being deleted, hasstatus.shardSID, and is Programmed and Ready. It is Local whenspec.targetRefnames this node, and Fabric otherwise. The shard's locator stays distinct from the node's router locator.veth_pairclaim per VPC, with the EgressShard UID asattachment_uid. Worker allows that only when all three hold:egress_local_shardrow while that VPC's pair is ready.usid_egresschooses the local member for an eligible VPC, it hands the packet to the Local tc program, unencapsulated, throughskb->cb. That program redirects it into the pair.PassThroughLocalNATclass route.nat_ingressattaches natively to the pair's NAT end, outside the XDP dispatcher.Tests
privateip commentedon Nov 21, 2026
Fixed by #1461, merged into
integration/galactic-workeras f32863f. NAT66 and NAT64 egress now use the node's own shard through a veth pair when it is ready, and the lab evidence is in the PR comments.Two follow-ups for the epic remain: the shard's IPv4 masquerade address is not advertised to the fabric, and removing galactic-nat leaves the pair links and rows it pinned.
docs(worker): Record the Worker API decisions made in #1433
Merge the NAT local-pair stream for #1437
Merge the uSID local-shard stream for #1437
docs(worker): Record the Worker API decisions made in #1433
Merge the NAT local-pair stream for #1437
Merge the uSID local-shard stream for #1437
docs(worker): Record the Worker API decisions made in #1433
Merge the NAT local-pair stream for #1437
Merge the uSID local-shard stream for #1437