Skip to content

feat(gobgp): expose BGPProviderService on galactic's gRPC port#116

Merged
privateip merged 2 commits into
mainfrom
feat/gobgp-bgp-provider-service
Jun 17, 2026
Merged

feat(gobgp): expose BGPProviderService on galactic's gRPC port#116
privateip merged 2 commits into
mainfrom
feat/gobgp-bgp-provider-service

Conversation

@privateip

Copy link
Copy Markdown
Contributor

Summary

  • Replaces the separate GoBGP gRPC API port with a BGPProviderService registered on galactic's own health gRPC server (--grpc-health-port). Cosmos now configures GoBGP by calling galactic's BGPProviderService rather than dialing GoBGP's API directly, eliminating --gobgp-api-port and the extra per-node port.
  • Removes BGPProvider deletion on shutdown — provider lifecycle is now managed by cosmos.
  • Switches BGPProviderSpec.Endpoint to a top-level field (drops the GoBGP nested config struct) and bumps the cosmos dependency to pick up the updated API.

Changes

  • internal/gobgp/provider.go — new BGPProviderServiceServer implementation
  • internal/agent/agent.go — registers BGPProviderService on the shared grpcSrv; passes grpcAddr to bootstrap instead of gobgpSrv.Addr()
  • internal/gobgp/server.go — removes APIPort/Addr(); switches to atomic.Pointer[BgpServer] + channel-based ready signal; adds Reconfigure() for future reconfiguration support
  • internal/bootstrap/bootstrap.go — updates BGPProviderSpec to new flat Endpoint field
  • Deployment manifests — removes --gobgp-api-port flag from all daemonset specs
  • deploy/containerlab/resources/cosmos/ — adds kustomize overlay for Kind (replaces manual kubectl patch in install-overlay.sh)
  • go.mod/go.sum — bumps go.miloapis.com/cosmos to 20260616

Test plan

  • task lint passes
  • task test passes (unit + e2e)
  • ContainerLab: deploy_cosmos deploys via kustomize overlay without manual patches
  • Agent starts with --gobgp-enabled=true; cosmos configures GoBGP via BGPProviderService on the health port
  • Kubernetes readiness probe reports SERVING after GoBGP initializes

🤖 Generated with Claude Code

@privateip privateip requested a review from a team as a code owner June 17, 2026 00:30
@privateip privateip requested a review from savme June 17, 2026 00:30
Comment thread cmd/galactic-agent/main.go Outdated
"Port for the embedded GoBGP gRPC API (cosmos dials this)")
cmd.Flags().StringVar(&opts.GoBGPLogLevel, "gobgp-log-level", "panic",
"GoBGP internal log level (debug, info, warn, error, panic)")
cmd.Flags().IntVar(&opts.GRPCHealthPort, "grpc-health-port", 8084,

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.

The name of this poet is a little off now. Also might be worth having these on separate ports so we can have different authentication?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ugh thought i had caught all of these. Its actually actually the galactic-agent port not GoBGP which is entirely abstracted and embedded in galactic-agent. Correction coming.

privateip and others added 2 commits June 17, 2026 07:49
Replace the separate GoBGP gRPC API port with a BGPProviderService
registered on galactic's own health gRPC server. Cosmos now configures
GoBGP by calling galactic's BGPProviderService rather than dialing
GoBGP's API directly, eliminating the --gobgp-api-port flag and the
extra per-node port.

- Add internal/gobgp/provider.go implementing BGPProviderServiceServer
- Register BGPProviderService on the shared grpcSrv in agent.go
- Remove GoBGPAPIPort from Options and all deployment manifests
- Switch BGPProviderSpec.Endpoint to a top-level field (drop GoBGP nested config)
- Replace TCP-poll readiness with channel-based ready signal in Server
- Add atomic.Pointer[BgpServer] and Reconfigure() for future reconfig support
- Remove BGPProvider deletion on shutdown (lifecycle managed by cosmos)
- Add cosmos kustomize overlay for containerlab instead of manual kubectl patches
- Bump go.miloapis.com/cosmos to 20260616 for updated BGPProviderSpec

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace ctrl.NewManager and its HTTP health/metrics infrastructure with
a lean gRPC-only design:

- Remove --gobgp-enabled and --gobgp-log-level; GoBGP is always on
- Rename --plane to --role (accepts overlay, overlay-rr); rename
  galactic.io/plane label to galactic.io/role across all BGP resources
- Replace --grpc-health-port/--health-addr/--metrics-addr with a single
  --health-port (default 5000) backed by a dedicated gRPC health server
- Liveness ("") is SERVING immediately; readiness ("readyz") becomes
  SERVING once GoBGP WaitReady completes
- Switch Kubernetes probes from httpGet to grpc in all manifests
- Delete internal/metrics package; drop prometheus/client_golang,
  go-logr/zapr, and go.uber.org/zap as direct dependencies
- Remove controller-runtime manager, healthz, zap logger, and metrics
  server imports from the agent run loop

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@privateip privateip force-pushed the feat/gobgp-bgp-provider-service branch from f873764 to 53b7863 Compare June 17, 2026 11:50
@privateip privateip merged commit abf0b97 into main Jun 17, 2026
5 checks passed
@privateip privateip deleted the feat/gobgp-bgp-provider-service branch June 17, 2026 12:49
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