feat(gobgp): expose BGPProviderService on galactic's gRPC port#116
Merged
Conversation
scotwells
reviewed
Jun 17, 2026
| "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, |
Contributor
There was a problem hiding this comment.
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?
Contributor
Author
There was a problem hiding this comment.
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.
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>
f873764 to
53b7863
Compare
scotwells
approved these changes
Jun 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BGPProviderServiceregistered on galactic's own health gRPC server (--grpc-health-port). Cosmos now configures GoBGP by calling galactic'sBGPProviderServicerather than dialing GoBGP's API directly, eliminating--gobgp-api-portand the extra per-node port.BGPProviderdeletion on shutdown — provider lifecycle is now managed by cosmos.BGPProviderSpec.Endpointto a top-level field (drops theGoBGPnested config struct) and bumps the cosmos dependency to pick up the updated API.Changes
internal/gobgp/provider.go— newBGPProviderServiceServerimplementationinternal/agent/agent.go— registersBGPProviderServiceon the sharedgrpcSrv; passesgrpcAddrto bootstrap instead ofgobgpSrv.Addr()internal/gobgp/server.go— removesAPIPort/Addr(); switches toatomic.Pointer[BgpServer]+ channel-basedreadysignal; addsReconfigure()for future reconfiguration supportinternal/bootstrap/bootstrap.go— updatesBGPProviderSpecto new flatEndpointfield--gobgp-api-portflag from all daemonset specsdeploy/containerlab/resources/cosmos/— adds kustomize overlay for Kind (replaces manual kubectl patch ininstall-overlay.sh)go.mod/go.sum— bumpsgo.miloapis.com/cosmosto20260616Test plan
task lintpassestask testpasses (unit + e2e)deploy_cosmosdeploys via kustomize overlay without manual patches--gobgp-enabled=true; cosmos configures GoBGP viaBGPProviderServiceon the health port🤖 Generated with Claude Code