Configuration for a Bond CNI secondary network

The Bond Container Network Interface (Bond CNI) combines multiple network interfaces into a single logical interface inside a container, improving redundancy and fault tolerance. Red Hat OpenShift Container Platform supports Bond CNI only when using kernel-mode SR-IOV virtual functions (VFs).

The following table describes the configuration parameters for the Bond CNI plugin:

Table 70. Bond CNI plugin JSON configuration object
Field Type Description

name

string

The mandatory, unique identifier assigned to this CNI network attachment definition. It is used by the container runtime to select the correct network configuration and serves as the key for persistent resource state management, such as IP address allocations.

cniVersion

string

The CNI specification version. A minimum version of 0.3.1 is required.

type

string

Specifies the name of the CNI plugin to configure: bond.

miimon

string

Specifies the address resolution protocol (ARP) link monitoring frequency in milliseconds. This parameter defines how often the bond interface sends ARP requests to check the availability of its aggregated interfaces.

mtu

integer

Optional: Specifies the maximum transmission unit (MTU) of the bond. The default is 1500.

failOverMac

integer

Optional: Specifies the failOverMac setting for the bond. Default is 0.

mode

string

Specifies the bonding policy. The supported values are balance-rr, active-backup, and balance-xor.

xmitHashPolicy

string

Specifies the transmit hash policy that the balance-xor mode uses for load balancing across the aggregated interfaces. This parameter defaults to layer2 and supports the following values: layer2, layer2+3, and layer3+4.

linksInContainer

boolean

Optional: Specifies whether the network interfaces intended for bonding are expected to be created and available directly within the network namespace of the container when the bond starts. If false which is the default, the CNI plugin looks for these interfaces on the host system first before attempting to form the bond.

links

object

Specifies the interfaces to be bonded.

ipam

object

The configuration object for the IPAM CNI plugin. The plugin manages IP address assignment for the attachment definition.

Important

When you use SR-IOV virtual functions (VFs) from multiple physical functions (PFs) in an active-active bond (such as balance-rr or balance-xor), you must configure the upstream network switch with a link aggregation group (LAG) that spans all participating PFs.

When you configure a switch LAG across multiple PFs, every workload using VFs from those PFs must use an active-active bonding policy. You cannot mix active-active bonds, active-backup bonds, or single-VF workloads on PFs participating in a switch LAG.

When using an active-active bond across multiple PFs without an upstream switch LAG, traffic drops occur. Configurations using active-backup or single-VF workloads can only receive traffic on a single designated PF, so any frames routed by the switch to an alternate PF are silently dropped.

Bond CNI plugin configuration example

The following example configures a secondary network named bond-net1:

{
 "type": "bond",
 "cniVersion": "0.3.1",
 "name": "bond-net1",
 "mode": "active-backup",
 "failOverMac": 1,
 "linksInContainer": true,
 "miimon": "100",
 "mtu": 1500,
 "links": [
       {"name": "net1"},
       {"name": "net2"}
   ],
  "ipam": {
        "type": "host-local",
        "subnet": "10.56.217.0/24",
        "routes": [{
        "dst": "0.0.0.0/0"
        }],
        "gateway": "10.56.217.1"
    }
}

The following example configures a secondary network named bond-xor-net that uses the balance-xor mode with the xmitHashPolicy parameter enabled:

{
 "type": "bond",
 "cniVersion": "0.3.1",
 "name": "bond-xor-net",
 "mode": "balance-xor",
 "xmitHashPolicy": "layer2+3",
 "failOverMac": 0,
 "linksInContainer": true,
 "miimon": "100",
 "mtu": 1500,
 "links": [
       {"name": "net1"},
       {"name": "net2"}
   ],
  "ipam": {
        "type": "host-local",
        "subnet": "10.57.218.0/24",
        "routes": [{
        "dst": "0.0.0.0/0"
        }],
        "gateway": "10.57.218.1"
    }
}
  • xmitHashPolicy: This parameter dictates how outgoing network traffic is distributed across the net1 and net2 active member interfaces within the bond. The hashing algorithm combines layer 2 information, specifically source and destination MAC addresses, with layer 3 information, which includes source and destination IP addresses.