Skip to content

feat(gateway): wire egress control plane and admission webhook - #383

Open
privateip wants to merge 1 commit into
feat/865-egress-phase-bfrom
feat/865-egress-phase-c
Open

feat(gateway): wire egress control plane and admission webhook#383
privateip wants to merge 1 commit into
feat/865-egress-phase-bfrom
feat/865-egress-phase-c

Conversation

@privateip

Copy link
Copy Markdown
Contributor

Summary

Phase C of #865, per docs/plans/865-edge-gateway-nat66-egress.md §4-§5.
Stacked on #381 (Phase B).

  • config.GatewayConfig gains EgressAddress/EgressSID, optional
    but validated as a pair.
  • gateway.NewKernelDatapath optionally writes egress_config_table;
    zero value means no egress on this node.
  • gateway.DesiredEgressPolicy defined but not added to EngineState
    -- routing-only enablement means nothing in Engine/Datapath consumes
    it yet.
  • NetworkGatewayReconciler.publishEgressAddress publishes
    status.EgressAddress and a self-address BGP route, kept separate
    from publishSelfAddress since the two fields are independently
    optional.
  • webhook.Authorizer narrowed from *NetworkRule to
    (vpcRef, vpcAttachmentRef string), so the new
    NetworkEgressPolicyValidator shares it with NetworkRuleValidator
    instead of duplicating the interface. Wired into cmd/galactic-router
    alongside the existing validator.
  • cmd/galactic-gateway CLI flags/config plumbed through to
    setupGatewayDatapath.

Scoping note

The plan's §4.3 also describes a NetworkEgressPolicy watch/reconcile
loop mirroring NetworkRule's list-and-assemble pattern. Left out here:
it has no well-defined per-policy work until Phase D decides node
assignment, and a watch that lists objects and does nothing with them
is dead scaffolding, not a real feature.

Testing

  • New tests: config pairing/family validation, NewKernelDatapath
    mismatched-pair/IPv4 rejection, reconciler publish/skip-publish,
    webhook create/update/delete/fail-closed plus a test proving one
    Authorizer instance serves both validators.
  • go build ./..., go vet ./..., task lint (0 issues) -- clean.
  • Full task test:unit under root: everything this PR touches passes.
    Two unrelated failures present (internal/cni/tap,
    internal/cniroute) are environment artifacts -- confirmed
    cni/tap fails identically on the unmodified branch, and
    cniroute passes cleanly in isolation.

🤖 Generated with Claude Code

@privateip
privateip requested a review from a team as a code owner August 13, 2026 19:54
@privateip
privateip requested review from aflor024 and removed request for a team August 13, 2026 19:54
Phase C of #865, per docs/plans/865-edge-gateway-nat66-egress.md §4-§5.

- config.GatewayConfig gains EgressAddress/EgressSID, optional but
  validated as a pair.
- gateway.NewKernelDatapath optionally writes egress_config_table;
  zero value means no egress on this node.
- gateway.DesiredEgressPolicy defined but deliberately not added to
  EngineState -- routing-only enablement means nothing in
  Engine/Datapath consumes it yet.
- NetworkGatewayReconciler.publishEgressAddress publishes
  status.EgressAddress and a self-address BGP route, mirroring
  publishSelfAddress as a separate method since the two fields are
  independently optional.
- webhook.Authorizer narrowed from *NetworkRule to
  (vpcRef, vpcAttachmentRef string), letting the new
  NetworkEgressPolicyValidator share it with NetworkRuleValidator
  instead of duplicating the interface. Wired into
  cmd/galactic-router alongside the existing validator.
- cmd/galactic-gateway CLI flags/config plumbed through to
  setupGatewayDatapath.

Scoping note: the plan's §4.3 also describes a NetworkEgressPolicy
watch/reconcile loop mirroring NetworkRule's list-and-assemble
pattern. Left out of this phase: it has no well-defined per-policy
work until Phase D decides node assignment, and a watch that lists
objects and does nothing with them is dead scaffolding, not a real
feature.
@privateip
privateip force-pushed the feat/865-egress-phase-c branch from 6d5c25c to 33f95b3 Compare August 14, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Design: egress control-plane wiring and admission webhook (865 Phase C)

2 participants