CUDN with BGP EVPN¶
Cluster User Defined Networks (CUDN) with BGP EVPN extends OVN-Kubernetes user-defined networks beyond the cluster boundary. By using BGP EVPN as the interconnect, external routers can participate in the overlay network, enabling seamless Layer 2 and Layer 3 connectivity between workloads inside OpenShift and services outside the cluster.
Official documentation:
Tested with:
| Component | Version |
|---|---|
| OpenShift | v4.22 |
| VyOS | rolling (nightly) |
Lab environment¶
The lab runs on a single Hetzner bare-metal server using hetzner-ocp4 to provision OpenShift 4.22 via libvirt/KVM. A compact cluster (3 control-plane nodes, no dedicated workers) is used. A VyOS virtual machine acts as the external BGP router peering with OpenShift's FRR.
Network design¶
Libvirt networks¶
| Network | Subnet | Purpose | DHCP |
|---|---|---|---|
demo |
192.168.52.0/24 |
OCP machine network + BGP/VXLAN underlay | Yes (hetzner-ocp4) |
evpn-tenant |
No IP (pure L2) | Bridge segment between VyOS and external VM | No |
IP assignments (underlay)¶
| VM | IP | Role |
|---|---|---|
| control-plane-0 | 192.168.52.10 |
CP + workloads, FRR/VTEP (AS 65001) |
| control-plane-1 | 192.168.52.11 |
CP + workloads, FRR/VTEP (AS 65001) |
| control-plane-2 | 192.168.52.12 |
CP + workloads, FRR/VTEP (AS 65001) |
| VyOS | 192.168.52.200 |
BGP router / VTEP (AS 65011) |
| External VM (Fedora) | underlay: none | Connected via evpn-tenant only |
CUDN overlay¶
| Property | Value |
|---|---|
| CUDN name | cudn-bgp-evpn |
| Topology | Layer2 |
| Overlay subnet | 10.100.0.0/24 |
| VNI | Assigned by OVN-K (or manually set) |
| Participants | CUDN pods/VMs on OCP + external VM via VyOS bridge |
BGP EVPN peering¶
- Type: eBGP (different ASNs)
- Address family: L2VPN EVPN
- Route types: Type-2 (MAC/IP), Type-3 (Inclusive Multicast for BUM)
- VXLAN tunnels: Formed automatically over
192.168.52.0/24underlay
VyOS role¶
VyOS serves two functions:
- BGP peering — peers with FRR on each OCP control-plane node, exchanges EVPN routes
- Bridging — bridges the VXLAN interface (bound to the CUDN's VNI) with
the
evpn-tenantlibvirt network, so the external VM lands on the overlay
| VyOS internals | |
|---|---|
Topology overview¶
External VM¶
- Connected only to
evpn-tenantlibvirt network - Gets an IP from
10.100.0.0/24(static or via DHCP from VyOS) - Layer 2 adjacent to CUDN pods inside OCP
- Can ping/curl pods on the CUDN directly
Extensibility¶
The design supports extending the EVPN fabric beyond the single server:
- Second Hetzner server — VyOS on server 2 peers with VyOS on server 1 over Hetzner internal network
- Remote VM/site — wrap the underlay in WireGuard/IPsec, BGP + VXLAN runs inside the tunnel
- Another OCP cluster — FRR on cluster 2 peers with VyOS
VyOS acts as the border gateway — remote peers only need to talk to VyOS, not to every OCP node.
Setup¶
Prerequisites¶
- OpenShift 4.22 compact cluster deployed via hetzner-ocp4
- SSH access to the Hetzner bare-metal host
- VyOS rolling ISO downloaded from VyOS rolling releases
hetzner-ocp4 cluster.yml¶
Info
masters_schedulable: true is required for a compact cluster (0 workers)
so that workloads (including CUDN pods) can be scheduled on the
control-plane nodes.
Step 1: Create the evpn-tenant libvirt network¶
Create an L2-only libvirt network on the Hetzner host for the bridge segment between VyOS and the external VM. This network has no IP addresses or DHCP — it is a pure Layer 2 segment.
| Define, start and autostart the network | |
|---|---|
| Verify | |
|---|---|
Step 2: Deploy VyOS VM¶
Download the VyOS rolling ISO and create the VM with two NICs using
virt-install:
| Deploy VyOS VM via virt-install | |
|---|---|
After boot, install VyOS to disk:
| Install VyOS to disk (run inside VyOS) | |
|---|---|
Then shut down, remove the CDROM, and start again:
| Remove CDROM and restart | |
|---|---|
Step 3: Configure VyOS¶
Connect to the VyOS console and enter configuration mode:
Configure eth0 (underlay on the demo network) and eth1 (bridge to evpn-tenant, no IP):
| Interface configuration | |
|---|---|
Create the VXLAN interface (VNI must match the CUDN VNI) and bridge it with eth1:
Configure BGP with AS 65011, enable EVPN, and add the three OCP control-plane nodes as neighbors (AS 65001):
Commit and save:
Step 4: Configure OpenShift CUDN with BGP EVPN¶
Warning
The exact CRDs and FRR configuration for CUDN with BGP EVPN interconnect on OpenShift 4.22 depend on the OVN-Kubernetes version and feature gates. Verify against the official documentation before applying.
Create the ClusterUserDefinedNetwork with BGP EVPN:
| cudn-bgp-evpn.yaml | |
|---|---|
Configure FRR on the OCP side to peer with VyOS. This is typically done via
the MetalLB operator's FRRConfiguration or the OVN-Kubernetes BGP
configuration:
Step 5: Deploy external test VM¶
Create a Fedora VM connected only to the evpn-tenant network:
After installation, configure a static IP on the overlay subnet:
| Configure static IP on the external VM | |
|---|---|
Validation¶
Check BGP sessions on VyOS¶
| VyOS: show BGP summary | |
|---|---|
Expected: 3 established sessions with the control-plane nodes.
Check EVPN routes on VyOS¶
| VyOS: show EVPN routes | |
|---|---|
Test connectivity¶
From the external VM, test connectivity to a pod on the CUDN:
| Ping a CUDN pod from the external VM | |
|---|---|
| Curl a service on the CUDN | |
|---|---|