Improve east-west performance by routing pods on the underlay with BGP
To improve east-west performance on bare-metal clusters, configure no-overlay mode with Border Gateway Protocol (BGP) so pod traffic uses underlay routing instead of Geneve encapsulation.
No-overlay mode with BGP is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
Understanding no-overlay mode for layer-3 networks using Border Gateway Protocol (BGP)
You can use no-overlay mode to route layer 3 pod traffic directly over the underlay network with BGP, which reduces encapsulation overhead and improves east-west performance.
No-overlay mode disables the default encapsulation for the default cluster network and uses BGP-learned routes to forward pod traffic across nodes. A cluster can run overlay and no-overlay networks at the same time.
For the default cluster network, no-overlay supports managed and unmanaged routing. With managed routing, OVN-Kubernetes creates a full-mesh BGP fabric between cluster nodes only, so no external BGP routers are required and pod routes are not advertised outside the cluster (intra-cluster traffic only). Managed routing requires nodes to be directly connected at layer 2; it is not suitable for clusters with nodes in different subnets. With unmanaged routing on the default network, you configure external BGP peers and use RouteAdvertisements custom resources (CRs) to advertise pod subnets to your existing BGP infrastructure.
For a primary network defined by a ClusterUserDefinedNetwork CR, no-overlay supports unmanaged routing only. Configure external BGP peers and RouteAdvertisements CRs for the CUDN.
- Requirements
-
- A bare-metal cluster that uses the OVN-Kubernetes network plugin.
- Single-node zone interconnect mode enabled for the cluster.
- BGP routing enabled and FRR-K8s deployed.
- Layer 3 networks only (the default network or a primary network defined by a
ClusterUserDefinedNetworkCR).
- Limitations
-
- No-overlay mode is not supported for layer 2 networks.
- EgressIP, EgressService, IPsec, multicast, and multiple external gateways are not supported for no-overlay networks.
- Switching an existing network between overlay and no-overlay modes is not supported using a
ClusterUserDefinedNetworkCR.
- Supported gateway modes
-
- On the default cluster network, no-overlay is supported in both local gateway (LGW) mode and shared gateway (SGW) mode.
- On a primary network defined by a
ClusterUserDefinedNetworkCR, no-overlay is supported in both LGW and SGW modes.
warningPods running on a CUDN configured with
NoOverlaytransport mode cannot establish TCP connections toNodePortservices whenexternalTrafficPolicyis set toClusterand the backend pod resides on a different node than the one targeted by the request. This issue occurs regardless of whether outbound SNAT is enabled or disabled.
Plan underlay routing and BGP for your cluster
Plan routing mode, BGP topology, and SNAT behavior so pod subnets are routable and the design scales for your cluster size.
- Workflow and timing
- No-overlay mode requires BGP to be enabled on the cluster by configuring the
Networkcustom resource (CR) so that the Cluster Network Operator (CNO) applies your settings. While no-overlay is a Technology Preview feature, enable theTechPreviewNoUpgradefeature set at installation time if you plan to use the feature on the default cluster network from day 0. Day 0 (installation): If the default cluster network will use no-overlay, supply manifests in the installationmanifests/directory so BGP and no-overlay settings are applied when the cluster is created. Day 2 (running cluster): You can patchnetwork.operator/clusterto adjust theoutboundSNATfield for clusters using unmanaged routing. PrimaryClusterUserDefinedNetwork(CUDN) resources that use no-overlay can be created or updated after installation. - Routing mode
- On the default cluster network, managed routing creates a full-mesh BGP fabric between nodes and is easier to operate. It requires nodes to be directly connected at layer 2 and is not suitable for nodes in different subnets. Unmanaged routing lets you control external peers and routing policies and is typically used when integrating with external BGP or when nodes are not in the same layer 2 segment.
- BGP topology
- For managed routing on the default cluster network, the supported topology is full mesh between nodes so that every node peers with every other node. Unmanaged routing uses your own design, for example eBGP to external routers, together with
FRRConfigurationandRouteAdvertisementsCRs.
Managed routing and a full-mesh BGP topology apply to the default cluster network when you choose that mode. A primary ClusterUserDefinedNetwork with no-overlay requires unmanaged routing in which you plan external BGP peers, create FRRConfiguration and RouteAdvertisements CRs for that network, and set spec.network.noOverlayOptions.outboundSNAT to Disabled.
- SNAT behavior
- Enable outbound SNAT when pod IPs are not routable on the external network. Disable outbound SNAT when the underlay can route pod IPs directly.
- IP address planning
- Allocate pod subnets and node subnets so they do not overlap with existing networks and can be advertised to your BGP fabric.
Enable underlay routing for the default cluster network
To steer default network’s east-west traffic over the underlay network instead of Geneve, configure the Cluster Network Operator (CNO) for NoOverlay transport and set the source network address translation (SNAT) and routing. If you use unmanaged routing, apply FRRConfiguration and RouteAdvertisements custom resources (CRs) so your routers exchange pod routes.
Prerequisites
- You have cluster-admin privileges.
- Your cluster is installed on bare-metal infrastructure with single-node zone interconnect mode.
- You have enabled Border Gateway Protocol (BGP) routing for the cluster. See "About BGP routing" and "Enabling BGP routing" for more information.
- You deployed FRR-K8s on cluster nodes installed with the BGP prerequisite.
- Choose
spec.defaultNetwork.ovnKubernetesConfig.noOverlayConfig.outboundSNATbased on whether pod IPs are routable on your external network. You can set toEnabledwhen they are not, andDisabledwhen the underlay can route pod IP addressess directly. - For
unmanagedmode you must setoutboundSNATtoEnabledor cluster deployment will fail.
Procedure
- Enable no-overlay for the default network in the Cluster Network Operator (CNO) custom resource (CR).
-
At installation time (day 0), set the BGP manifest in your installation
manifests/directory to configure thenoOverlayConfigobject such as in the following managed and unmanaged routing examples.Example CNO CR using no-overlay with unmanaged routingapiVersion: operator.openshift.io/v1kind: Networkmetadata:name: clusterspec:additionalRoutingCapabilities:providers:- FRRdefaultNetwork:ovnKubernetesConfig:routeAdvertisements: Enabledtransport: NoOverlaynoOverlayConfig:outboundSNAT: Enabledrouting: Unmanagedtype: OVNKubernetesExample CNO CR using no-overlay with managed routingapiVersion: operator.openshift.io/v1kind: Networkmetadata:name: clusterspec:additionalRoutingCapabilities:providers:- FRRdefaultNetwork:ovnKubernetesConfig:routeAdvertisements: Enabledtransport: NoOverlaynoOverlayConfig:outboundSNAT: Enabledrouting: ManagedbgpTopology: FullMeshasNumber: 64512type: OVNKubernetesspec.defaultNetwork.ovnKubernetesConfig.noOverlayConfig.bgpTopology- Specifies
FullMeshfor a full-mesh BGP fabric between nodes. spec.defaultNetwork.ovnKubernetesConfig.noOverlayConfig.asNumber- Optional: specifies the BGP autonomous system number used in the default VRF. When omitted,
64512is used.
-
On a running cluster (day 2), configure the
noOverlayConfigobject in CNO using the following command:$ oc patch network.operator.openshift.io cluster --type merge --patch '{"spec":{"defaultNetwork":{"ovnKubernetesConfig":{"noOverlayConfig":{"outboundSNAT":"Enabled"}}}}}' -
For managed routing, proceed to the verification step. Do not create
RouteAdvertisementsorFRRConfigurationobjects. OVN-Kubernetes can reconcile the managed BGP fabric
-
- If you use unmanaged routing, add manifests to the installation
manifests/directory (day 0) for the following custom resources (CRs):-
Add the following
FRRConfigurationCR:apiVersion: frrk8s.metallb.io/v1beta1kind: FRRConfigurationmetadata:name: external-bgpnamespace: openshift-frr-k8slabels:network: defaultspec:bgp:routers:- asn: 64512neighbors:- address: 192.168.111.1asn: 64512disableMP: truetoReceive:allowed:mode: filteredReplace
spec.bgp.routers[].neighbors[].address, ASN values, andtoReceivefilters so they match your external BGP design. -
Add the following
RouteAdvertisementsCR:apiVersion: k8s.ovn.org/v1kind: RouteAdvertisementsmetadata:name: defaultspec:advertisements:- PodNetworkfrrConfigurationSelector:matchLabels:network: default
-
- Optional: Alternatively, you can create or apply the following CRs with
oc apply(day 2):-
Create an
FRRConfigurationCR that defines BGP peering toward your external router.Example FRRConfiguration CR for unmanaged routingapiVersion: frrk8s.metallb.io/v1beta1kind: FRRConfigurationmetadata:name: external-bgpnamespace: openshift-frr-k8slabels:network: defaultspec:bgp:routers:- asn: 64512neighbors:- address: 192.168.111.1asn: 64512disableMP: truetoReceive:allowed:mode: filteredReplace
spec.bgp.routers[].neighbors[].address, ASN values, andtoReceivefilters so they match your external BGP design. -
Apply the
FRRConfigurationCR using the following command:$ oc apply -f <frrconfiguration_file>.yamlReplace
<frrconfiguration_file>.yamlwith your manifest file name. -
Create a
RouteAdvertisementsCR that advertises the pod network.Example RouteAdvertisements CR for unmanaged routingapiVersion: k8s.ovn.org/v1kind: RouteAdvertisementsmetadata:name: defaultspec:advertisements:- PodNetworkfrrConfigurationSelector:matchLabels:network: defaultnetworkSelectors:- networkSelectionType: DefaultNetworknodeSelector: {}noteFor unmanaged routing on the default network, at least one
RouteAdvertisementsobject must select the default network. In the example, thespec.networkSelectorsentry withnetworkSelectionType: DefaultNetworkselects the default network,spec.advertisementsincludesPodNetwork, and theRouteAdvertisementsCR reachesAccepted=Truein status. OVN-Kubernetes uses this configuration when advertising pod subnets to your BGP infrastructure. -
Apply the
RouteAdvertisementsCR using the following command:$ oc apply -f <routeadvertisements_file>.yamlReplace
<routeadvertisements_file>.yamlwith your file name.
-
Verification
- Verify that the OVN-Kubernetes pods are running:
$ oc get pods -n openshift-ovn-kubernetes
Additional resources
Create a ClusterUserDefinedNetwork CR that uses underlay routing
Create a layer 3 ClusterUserDefinedNetwork (CUDN) custom resource (CR) with no-overlay transport and unmanaged routing so pods use BGP routes instead of encapsulation for east-west traffic.
You advertise pod subnets using FRRConfiguration and RouteAdvertisements CRs. For managed routing and a full-mesh BGP fabric between nodes on the default cluster network, see "Enable underlay routing for the default cluster network".
- On a primary CUDN,
NoOverlaymode supports unmanaged routing only. Managed routing (full-mesh BGP between nodes without external peers) is supported on the default cluster network only. - On a primary CUDN,
NoOverlaytransportandoutboundSNATset toEnabledare not supported.
Prerequisites
- You have cluster-admin privileges.
- Your cluster is installed on bare-metal infrastructure with single-node zone interconnect mode.
- You have enabled the
NoOverlayModefeature flag in theTechPreviewNoUpgradefeature set. - You enabled BGP routing support for the cluster.
- You deployed FRR-K8s on cluster nodes.
Procedure
-
Create a
ClusterUserDefinedNetworkCR that uses no-overlay transport.noteFor a primary layer 3
ClusterUserDefinedNetworkCR, every namespace that matchesspec.namespaceSelectormust include thek8s.ovn.org/primary-user-defined-networklabel before workloads can use the network; that label can only be set when the namespace is created.-
Set
spec.network.noOverlayOptions.routingtoUnmanaged.Example ClusterUserDefinedNetwork CR for no-overlay mode with outboundSNAT set to DisabledapiVersion: k8s.ovn.org/v1kind: ClusterUserDefinedNetworkmetadata:name: high-perf-networklabels:network: high-perf-networkspec:namespaceSelector:matchLabels:app: performance-sensitivenetwork:topology: Layer3layer3:role: Primarysubnets:- cidr: 10.200.0.0/16hostSubnet: 24transport: "NoOverlay"noOverlayOptions:outboundSNAT: "Disabled"routing: "Unmanaged"warningPods running on a CUDN running
NoOverlaymode cannot establish TCP connections toNodePortservices. This occurs whenexternalTrafficPolicyis set toClusterand the backend pod resides on a different node than the one targeted by the request. This issue occurs regardless of whether outbound SNAT is enabled or disabled. -
Apply the
ClusterUserDefinedNetworkCR by entering the following command:$ oc apply -f <cudn_file>.yamlReplace
<cudn_file>.yamlwith the name of yourClusterUserDefinedNetworkCR file.
-
-
Create a
RouteAdvertisementsCR-
Set
spec.advertisementstoPodNetworkto advertise the CUDN pod subnets to your external BGP infrastructure.Example RouteAdvertisements CR advertising the CUDN pod subnetsapiVersion: k8s.ovn.org/v1kind: RouteAdvertisementsmetadata:name: high-perf-networkspec:nodeSelector: {}frrConfigurationSelector:matchLabels:network: high-perf-networknetworkSelectors:- networkSelectionType: ClusterUserDefinedNetworksclusterUserDefinedNetworkSelector:networkSelector:matchLabels:network: high-perf-networkadvertisements:- PodNetworkwhere:
spec.nodeSelector- Specifies which nodes to include in the advertisements; when empty (
{}), all nodes are selected. spec.frrConfigurationSelector- Specifies the
FRRConfigurationthat peers with your external routers. UsematchLabelsto select theFRRConfigurationby its labels. spec.networkSelectors.networkSelectionType- Specifies the type of network to advertise. Set to
ClusterUserDefinedNetworksto advertise a cluster user-defined network (CUDN). Set toDefaultNetworkto advertise the default cluster network. spec.advertisements- Specifies the type of networks to advertise. Set to
PodNetworkto advertise pod subnets. Set toEgressIPto advertise EgressIPs.
-
Apply the
RouteAdvertisementsCR by entering the following command:$ oc apply -f <routeadvertisements_file>.yamlReplace
<routeadvertisements_file>.yamlwith the name of yourRouteAdvertisementsCR file.
-
-
Verify that the no-overlay transport was accepted by entering the following command:
$ oc get clusteruserdefinednetwork high-perf-network -o yaml
Reference for Cluster Network Operator (CNO) settings for default network underlay routing
Review the Cluster Network Operator (CNO) custom resource (CR) fields that control BGP, route advertisements, and no-overlay mode for the default OVN-Kubernetes cluster network. No-overlay mode for the default network is configured on the CNO CR.
apiVersion: operator.openshift.io/v1
kind: Network
metadata:
name: cluster
spec:
additionalRoutingCapabilities:
providers:
- FRR
defaultNetwork:
ovnKubernetesConfig:
routeAdvertisements: Enabled
transport: NoOverlay
noOverlayConfig:
outboundSNAT: Enabled
routing: Managed
bgpTopology: FullMesh
asNumber: 64512
type: OVNKubernetes
where:
spec.defaultNetwork.type- Must be
OVNKubernetes. spec.additionalRoutingCapabilities.providers- Specifies additional routing components on the cluster. For BGP and route advertisements, include
FRRso FRR-K8s is deployed on nodes. spec.defaultNetwork.ovnKubernetesConfig.routeAdvertisements- Specifies whether the cluster can import and advertise routes as configured by
RouteAdvertisementsobjects and related BGP configuration. Set toEnabledso the cluster can import and advertise routes as configured byRouteAdvertisementsobjects and related BGP configuration. spec.defaultNetwork.ovnKubernetesConfig.transport- Specifies the transport protocol. Set to
NoOverlayto disable the default encapsulation for the default network and use underlay for routing pod traffic. spec.defaultNetwork.ovnKubernetesConfig.noOverlayConfig.outboundSNAT- Specifies outbound SNAT for the default network. Set to
EnabledorDisabled. WhenEnabled, outbound pod traffic to networks outside the pod subnet is source NATed to the node IP when required. WhenDisabled, the underlay must route pod IPs directly. Pod-to-pod traffic within the cluster is not SNATed; traffic to node IPs, the Kubernetes API, and cluster DNS is still SNATed where applicable. spec.defaultNetwork.ovnKubernetesConfig.noOverlayConfig.routing- Specifies the routing mode for the default network. Set to
Managedfor a full-mesh BGP fabric between nodes (intra-cluster), orUnmanagedwhen you provideFRRConfigurationandRouteAdvertisementsCRs for external BGP. spec.defaultNetwork.ovnKubernetesConfig.noOverlayConfig.bgpTopology- Specifies the BGP topology for the default network. When routing is set to
Managed, set toFullMeshso every node runs a BGP router and peers with all other nodes. spec.defaultNetwork.ovnKubernetesConfig.noOverlayConfig.asNumber- Specifies the BGP autonomous system (AS) number for the default VRF. When routing is set to
Managed, optional BGP AS number for the default VRF. When omitted, the default is64512.
Reference for underlay routing settings on a ClusterUserDefinedNetwork custom resource (CR)
Review the full spec paths on a ClusterUserDefinedNetwork custom resource (CR) when you use no-overlay transport on a primary layer 3 cluster user-defined network.
apiVersion: k8s.ovn.org/v1
kind: ClusterUserDefinedNetwork
metadata:
name: high-perf-network
labels:
network: high-perf-network
spec:
namespaceSelector:
matchLabels:
app: performance-sensitive
network:
topology: Layer3
layer3:
role: Primary
subnets:
- cidr: 10.200.0.0/16
hostSubnet: 24
transport: "NoOverlay"
noOverlayOptions:
outboundSNAT: "Disabled"
routing: "Unmanaged"
where:
spec.namespaceSelector- Specifies label selectors for namespaces that can attach workloads to the primary network.
spec.network.topology- Specifies the network topology. Must be
Layer3. spec.network.layer3.role- Specifies the role of the network. For a primary CUDN, set to
Primary. spec.network.layer3.subnets- Specifies a list of objects with
cidrandhostSubnetfields that define the pod address space and per-node prefix size. spec.network.transport- Specifies the transport protocol. Set to
NoOverlayto disable the default encapsulation for this CUDN and use underlay routing for pod traffic. spec.network.noOverlayOptions- Specifies routing mode and SNAT behavior for this network. Required when transport is set to
NoOverlay. spec.network.noOverlayOptions.routing- Specifies the routing mode for the network. For a CUDN, set to
Unmanagedonly. You manage external BGP peers andRouteAdvertisementsCR for this network. No-overlay managed routing mode is only supported on the default cluster network. You must configure no-overlay managed routing on the Cluster Network Operator (CNO) CR, not on a CUDN. spec.network.noOverlayOptions.outboundSNAT- Specifies outbound SNAT for this network. For a primary
ClusterUserDefinedNetworkCR withNoOverlaytransport, set toDisabledwhen the underlay routes pod IPs directly. A value ofEnabledis not supported on this CR type. To useEnabledorDisabledwith no-overlay on the default cluster network, configurespec.defaultNetwork.ovnKubernetesConfig.noOverlayConfig.outboundSNATon the CNO CR instead.
Troubleshoot connectivity for pods that use underlay routing
To troubleshoot connectivity and resolve no-overlay connectivity issues, you can verify BGP sessions, route advertisements, and network status.
Prerequisites
- You have cluster-admin privileges.
- You configured no-overlay mode for the default network or a
ClusterUserDefinedNetwork(CUDN) CR.
Procedure
-
Verify that FRR-K8s pods are running by running the following command:
$ oc get pods -n openshift-frr-k8s -
If you configured no-overlay for the default network, verify the Cluster Network Operator (CNO) CR by running the following command:
$ oc get network.operator cluster -o yamlConfirm that
spec.defaultNetwork.ovnKubernetesConfigincludes the expectedrouteAdvertisements,transport, andnoOverlayConfigvalues. -
If you use unmanaged routing, verify
RouteAdvertisementsobjects by running the following commands:$ oc describe routeadvertisements <routeadvertisements_name>Replace
<routeadvertisements_name>with the name of yourRouteAdvertisementsobject.The output should show
Accepted=Truein thestatussection.noteIf you use managed routing, you typically do not create
RouteAdvertisementsyourself for intra-cluster-only designs; if pod connectivity fails, continue with the remaining steps in this procedure. -
If you configured a no-overlay
ClusterUserDefinedNetworkCR, check its status by running the following command:$ oc get clusteruserdefinednetwork <cudn_name> -o yamlReplace
<cudn_name>with the name of your CUDN CR. -
Check for BGP-related errors in the OVN-Kubernetes logs by entering the following command:
$ oc logs -n openshift-ovn-kubernetes -l app=ovnkube-node -
Confirm that pod subnets are present in the node routing table by entering the following command:
$ oc debug node/<node_name> -- chroot /host ip route
Additional resources