Skip to content

chore: split gateway docs into separate file and update tooling - #14

Merged
privateip merged 2 commits into
mainfrom
feat/networkgateway-networkrule-crds
Aug 12, 2026
Merged

chore: split gateway docs into separate file and update tooling#14
privateip merged 2 commits into
mainfrom
feat/networkgateway-networkrule-crds

Conversation

@privateip

Copy link
Copy Markdown
Collaborator

Summary

Split NetworkGateway and NetworkRule documentation out of docs/api/bgp.md into a dedicated docs/api/gateway.md, generated via a new .crd-ref-docs-gateway.yaml config.

Changes

  • New .crd-ref-docs-gateway.yaml — crd-ref-docs config targeting NetworkGateway/NetworkRule types
  • New docs/api/gateway.md — Generated gateway CRD field reference
  • New docs/api/index.md — API docs index linking to both bgp.md and gateway.md (sourced from templates/api-index.md)
  • Updated .crd-ref-docs.yaml — Ignores gateway types so bgp.md stays BGP-only
  • Updated Taskfile.yamlgenerate:docs now runs both crd-ref-docs configs and copies the index template
  • Updated AGENTS.md — Reflects the dual-doc structure and tooling in conventions

Generated with Qwen Code

privateip and others added 2 commits August 11, 2026 19:59
Adds the CRD types for the edge NAT+LB gateway engine's control plane:
NetworkGateway (one per dedicated gateway-role node, spec.targetRef
names the node) and NetworkRule (namespaced, tenant-writable, carries
an ingress VIP/protocol/port and backend targets for a vpc/vpcAttachment).

NetworkGatewayStatus carries sRv6Address rather than a tunnel endpoint
address: the consuming galactic-router design pivoted away from an
earlier Geneve-overlay approach to pushing SRv6 uSID headers directly
from an XDP program, so there is no tunnel endpoint to publish. This
address is the gateway node's own SRv6-reachable address, used as the
Full-NAT SNAT source for every ingress flow the node translates, and
advertised into BGP the same way any workload prefix is (a
BGPAdvertisement naming it at the reserved Argument 0, which PR #740
forbids ever registering into a tenant VRF, so it can never collide
with real tenant state).

NetworkRuleStatus.primaryNode implements the active-active BGP model:
assigned once at creation (hash(vpcRef) % gateway node count) and never
recomputed, so a later reconcile can't silently flip which node is
preferred for a live VIP.

Regenerated deepcopy methods and CRD manifests via controller-gen.
NetworkGateway and NetworkRule docs are now generated to docs/api/gateway.md
via a dedicated .crd-ref-docs-gateway.yaml config, keeping bgp.md focused
on the BGP API group. Added docs/api/index.md as a landing page linking
both references.

Updated Taskfile generate:docs target, AGENTS.md conventions, and the BGP
crd-ref-docs config to ignore the gateway types.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
@privateip
privateip requested a review from a team as a code owner August 12, 2026 18:29

@ecv ecv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omg comments

@privateip
privateip merged commit 6e8a6c4 into main Aug 12, 2026
5 checks passed
@privateip
privateip deleted the feat/networkgateway-networkrule-crds branch August 12, 2026 18:44
privateip added a commit to datum-cloud/galactic that referenced this pull request Aug 12, 2026
…on webhook

Adds the CRD-driven layer that feeds the gateway engine from the
previous branch, and the NetworkRule admission webhook:

- internal/controller/networkgateway_controller.go: NetworkGateway
  reconciler; watches NetworkGateway/NetworkRule, resolves backend
  SRv6 uSIDs (usidresolver.go), builds DesiredRule/DesiredBackend, and
  drives internal/gateway's Engine.
- internal/controller/networkrule_controller.go: NetworkRule
  reconciler; finalizer, Status.PrimaryNode assignment, BGP-withdrawal-
  before-NAT-teardown delete ordering.
- internal/controller/status.go: setGatewayCondition/setRuleCondition
  helpers.
- internal/webhook: NetworkRuleValidator admission webhook
  (vpcRef/vpcAttachmentRef authorization) and a pluggable Authorizer
  interface (AllowAllAuthorizer placeholder pending the companion
  operator integration).
- cmd/galactic-router/root.go: wires the webhook server into the
  manager, opt-in behind --webhook-enabled (internal/config/router.go).
- go.mod: bump go.datum.net/network to the commit that adds the
  NetworkGateway/NetworkRule types (datum-cloud/network#14), now that
  they've landed upstream. This replaces an earlier, since-abandoned
  'replace go.datum.net/network => ../network' stopgap that pointed at
  a sibling checkout while those types were still only local.
- scripts/ci.sh: NETWORK_SHA extraction matches the require line's
  module path exactly, not just a substring.

Known gap, not addressed by this branch: config/webhook/ (the
ValidatingWebhookConfiguration + Service + cert-manager Certificate
this webhook needs to actually run) doesn't exist yet. The webhook
defaults to disabled (WebhookEnabled=false), so this doesn't affect
any existing deployment, but the feature is incomplete without those
manifests -- follow-up work, not in scope here.

Third branch in the edge-gateway stack; builds on
feat/edge-gateway-02-engine.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
privateip added a commit to datum-cloud/galactic that referenced this pull request Aug 12, 2026
…on webhook

Adds the CRD-driven layer that feeds the gateway engine from the
previous branch, and the NetworkRule admission webhook:

- internal/controller/networkgateway_controller.go: NetworkGateway
  reconciler; watches NetworkGateway/NetworkRule, resolves backend
  SRv6 uSIDs (usidresolver.go), builds DesiredRule/DesiredBackend, and
  drives internal/gateway's Engine.
- internal/controller/networkrule_controller.go: NetworkRule
  reconciler; finalizer, Status.PrimaryNode assignment, BGP-withdrawal-
  before-NAT-teardown delete ordering.
- internal/controller/status.go: setGatewayCondition/setRuleCondition
  helpers.
- internal/webhook: NetworkRuleValidator admission webhook
  (vpcRef/vpcAttachmentRef authorization) and a pluggable Authorizer
  interface (AllowAllAuthorizer placeholder pending the companion
  operator integration).
- cmd/galactic-router/root.go: wires the webhook server into the
  manager, opt-in behind --webhook-enabled (internal/config/router.go).
- go.mod: bump go.datum.net/network to the commit that adds the
  NetworkGateway/NetworkRule types (datum-cloud/network#14), now that
  they've landed upstream. This replaces an earlier, since-abandoned
  'replace go.datum.net/network => ../network' stopgap that pointed at
  a sibling checkout while those types were still only local.
- scripts/ci.sh: NETWORK_SHA extraction matches the require line's
  module path exactly, not just a substring.
- containers/galactic-router/Dockerfile: also regenerates
  internal/plumbing/ebpf/edgeprog's bpf2go output now, alongside
  internal/plumbing/ebpf/prog's -- the reconcilers added here wire
  internal/gateway.Engine into cmd/galactic-router for the first time,
  which transitively needs edgeprog's generated types.

Known gap, not addressed by this branch: config/webhook/ (the
ValidatingWebhookConfiguration + Service + cert-manager Certificate
this webhook needs to actually run) doesn't exist yet. The webhook
defaults to disabled (WebhookEnabled=false), so this doesn't affect
any existing deployment, but the feature is incomplete without those
manifests -- follow-up work, not in scope here.

Third branch in the edge-gateway stack; builds on
feat/edge-gateway-02-engine.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

2 participants