Skip to content

feat: replace galactic-agent with galactic-router (controller-runtime)#125

Merged
privateip merged 6 commits into
mainfrom
pr/1c-core
Jun 24, 2026
Merged

feat: replace galactic-agent with galactic-router (controller-runtime)#125
privateip merged 6 commits into
mainfrom
pr/1c-core

Conversation

@privateip

Copy link
Copy Markdown
Contributor

Summary

Replace the gRPC-based galactic-agent DaemonSet with a controller-runtime based galactic-router.

New code added

  • cmd/galactic-router/main.go — New binary entry point
  • internal/controller/ — BGPRouter, BGPPeer, BGPAdvertisement, BGPPolicy, Secret, Node reconcilers
  • internal/reconcile/ — CRD-to-DesiredRouter translation
  • internal/runtime/ — RuntimeFactory pattern (GoBGP tenant, FRR fabric stub)
  • internal/model/ — Internal BGP types
  • internal/hash/ — Change detection for no-op suppression
  • config/ — DaemonSet, RBAC, and sample CRD manifests

Code removed

  • cmd/galactic-agent — Old binary
  • internal/agent — Old gRPC agent
  • internal/bootstrap — Old bootstrap logic
  • internal/gobgp — Old GoBGP provider (replaced by internal/runtime/gobgp)

Key design decisions

  • GoBGP starts lazily on first BGPRouter reconcile (listenPort=-1, outbound-only)
  • Hash-based no-op suppression prevents redundant GoBGP Apply calls
  • FRR fabric role is a stub (not yet implemented)

Dependencies

privateip and others added 3 commits June 23, 2026 15:43
- Add cmd/galactic-router as the new binary entry point
- Add internal/controller with BGPRouter, BGPPeer, BGPAdvertisement,
  BGPPolicy, Secret, and Node reconcilers
- Add internal/reconcile for CRD-to-DesiredRouter translation
- Add internal/runtime with RuntimeFactory pattern (GoBGP tenant, FRR fabric)
- Add internal/model for internal BGP types and internal/hash for
  change detection
- Add config/daemonset, config/rbac, config/samples for galactic-router
- Remove internal/agent, internal/bootstrap, internal/gobgp packages
- Remove cmd/galactic-agent binary
Replace the ErrEVPNNotImplemented stub with a real implementation that
builds and advertises EVPN Type 5 IP Prefix routes for each SRv6
endpoint prefix in a BGPAdvertisement.

- Route distinguisher derived from BGPRouter routerID (Type 1 IP:0)
- MpReachNLRI next-hop is node's primary IPv6 address
- Route target communities parsed from advertisement's communities field
- Support withdrawals via b.DeletePath
- Add configurable BGP_LISTEN_PORT env var for tenant GoBGP instance

Co-authored-by: Claude <noreply@anthropic.com>
…ions

- Replace setPeerSessionState + setPeerCondition with setPeerReadyCondition
  that sets a single Ready condition using bgpv1alpha1.ConditionTypeReady
- Remove unused FSM condition constants (SessionIdle..SessionEstablished)
- Remove dead code: fsmConditions slice, fsmStateToCondition map
feat: implement EVPN Type 5 path construction in GoBGP runtime
refactor: align BGPPeer status with cosmos API v3 consolidated conditions
Base automatically changed from pr/1b-cni-infra to pr/1a-go-mod June 23, 2026 20:28
Resolve merge conflict in go.sum (cosmos pseudo-version) and complete the
cosmos v3 API migration that fb4318e began but left uncompiled.

The branch referenced cosmos v3 symbols (bgpv1alpha1.ConditionTypeReady) in
internal/controller/status.go while go.mod still pinned a pre-v3 cosmos that
lacks them, so pr/1c-core never built. Bump cosmos to the v3 API
(v0.0.0-20260623153148-6678708e0513) and finish the migration:

- internal/cni/cni.go: construct BGPAdvertisementSpec.Prefixes as
  []AdvertisedPrefix{{CIDR: ...}} and Communities as []Community, matching the
  v3 typed fields (previously []string).
- internal/reconcile/reconcile.go: convert the typed AdvertisedPrefix/Community
  slices back to the internal model's []string at the API boundary, leaving
  the DesiredRouter model and gobgp runtime unchanged.
- internal/runtime/gobgp/paths.go: gofmt import ordering.

go build ./..., go vet, unit tests, and golangci-lint all pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Base automatically changed from pr/1a-go-mod to main June 23, 2026 21:18
@ecv ecv self-requested a review June 24, 2026 17:51
@privateip privateip merged commit 4f53dd8 into main Jun 24, 2026
1 check passed
@privateip privateip deleted the pr/1c-core branch June 24, 2026 18:14
@privateip privateip restored the pr/1c-core branch June 24, 2026 18:14
@privateip privateip deleted the pr/1c-core branch June 24, 2026 19:10
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