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
- 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.
BGPPeeringPolicyautomates 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.
Install the CRDs and deploy the controller:
kubectl apply -k config/deployCreate a BGPConfiguration (one per cluster):
apiVersion: bgp.miloapis.com/v1alpha1
kind: BGPConfiguration
metadata:
name: default
spec:
asNumber: 65001
listenPort: 1790
routerIDSource: NodeIPCreate 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: meshCheck session state:
kubectl get bgpsessFor a complete walkthrough, see the Getting Started guide.
| 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. |
- 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
- Single-cluster full mesh
- Route-reflector topology
- eBGP peering
- Prefix advertisement with communities
- Route filtering
# 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 .