Skip to content

milo-os/cosmos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BGP Control Plane

Manage BGP topology declaratively through Kubernetes Custom Resource Definitions (CRDs), powered by GoBGP.

You define BGP speakers, sessions, and policies as Kubernetes resources. The controller reconciles them into a running GoBGP instance on each node and programs learned routes into the kernel.

API group: bgp.miloapis.com | Version: v1alpha1


Key features

  • Topology-agnostic. The controller has no built-in knowledge of nodes, clusters, or datacenter layout. All topology lives in the CRDs you create.
  • CNI-independent. Works with any CNI — or no CNI at all. No dependency on Cilium, Calico, or any other network plugin.
  • Declarative session management. BGPPeeringPolicy automates session creation through label selectors. Full-mesh and route-reflector topologies are both supported.
  • Producer/consumer model. Any system — node operators, cluster discovery, automation pipelines, or humans — can create BGP CRDs. The controller reconciles them uniformly.
  • GoBGP sidecar. Each node runs its own GoBGP daemon. The controller configures it over gRPC and programs kernel routes from BGP RIB events.

Quick start

Install the CRDs and deploy the controller:

kubectl apply -k config/deploy

Create a BGPConfiguration (one per cluster):

apiVersion: bgp.miloapis.com/v1alpha1
kind: BGPConfiguration
metadata:
  name: default
spec:
  asNumber: 65001
  listenPort: 1790
  routerIDSource: NodeIP

Create BGPEndpoint resources for your nodes and a peering policy:

apiVersion: bgp.miloapis.com/v1alpha1
kind: BGPEndpoint
metadata:
  name: node-worker-01
  labels:
    bgp.miloapis.com/role: node
spec:
  address: "2001:db8:1::1"
  asNumber: 65001
---
apiVersion: bgp.miloapis.com/v1alpha1
kind: BGPPeeringPolicy
metadata:
  name: mesh
spec:
  selector:
    matchLabels:
      bgp.miloapis.com/role: node
  mode: mesh

Check session state:

kubectl get bgpsess

For a complete walkthrough, see the Getting Started guide.


CRDs

Resource Short name Scope Description
BGPConfiguration bgpconfig Cluster Speaker identity: AS number, listen port, router ID. One per cluster.
BGPEndpoint bgpep Cluster BGP speaker address and AS number. One per node (or manually created).
BGPSession bgpsess Cluster Peering relationship between two endpoints.
BGPPeeringPolicy bgppp Cluster Automates session creation through label selectors.
BGPAdvertisement bgpadvert Cluster Prefix advertisement with optional communities and LOCAL_PREF.
BGPRoutePolicy bgprp Cluster Import/export filtering with prefix matching.

Documentation

  • Service design — motivation, architecture, controller internals, and design decisions
  • API reference — complete field documentation for all six CRDs
  • Getting started — deploy the control plane and establish your first BGP session

Examples


Building

# Build the controller binary
CGO_ENABLED=0 go build -o bgp ./cmd/bgp

# Build the container image
docker build -f build/Dockerfile -t ghcr.io/milo-os/bgp:latest .

About

Configure your network.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors