Aggregate multiple network interfaces into a single logical "bonded" interface
Overview
- Bonding provides a method for aggregating multiple network interfaces into a single logical "bonded" interface.
- According to the 802.3ad specification, Linux Bonding drivers provides various flavours of bonded interfaces depending on the mode (bonding policies), such as round robin, active aggregation.
- When Bond CNI is configured as a standalone plugin, interfaces are obtained from the host network namespace. With these physical interfaces a bonded interface is created in the container network namespace.
- When used with Multus users can bond two interfaces that have previously been passed into the container.
- A major use case for bonding in containers is network redundancy of an application in the case of network device or path failure and unavailability. For more information - refer to network redundancy using interface bonding.
- And for more information on the bonding driver please refer to kernel doc.
Installation and Usage
Given the following network configuration:
# cat > /etc/cni/net.d/00-flannel-bonding.conf <<EOF
{
"name": "mynet",
"type": "flannel",
"delegate": {
"type": "bond",
"mode": "active-backup",
"miimon": "100",
"failOverMac": 1,
"links": [
{
"name": "ens3f2"
},
{
"name": "ens3f2d1"
}
]
}
}
EOF
Note In this example configuration above required "ipam" is provided by flannel plugin implicitly.
Integration with Multus, SRIOV CNI and SRIOV Device Plugin
Users can take advantage of Multus to enable adding multiple interfaces to a K8s Pod. The SRIOV CNI plugin allows a SRIOV VF (Virtual Function) to be added to a container. Additionally the SRIOV Device Plugin allows Kubelet to manage SRIOV virtual functions. This example shows how Bond CNI could be used in conjunction with these plugins to handle more advanced use cases e.g, high performance container networking solution for NFV environment. Specifically the below functionality shows how to set up failover for SR-IOV interfaces in Kubernetes. This configuration is only applicable to SRIOV VFs using the kernel driver. Userspace driver VFs - such as those used in DPDK workloads - can not be bonded with the Bond CNI.
Configuration is based on the Multus CRD Network Attachment Definition. Please follow the configuration details in the link: Usage with Kubernetes CRD based Network Objects.
For more information and advanced use refer to the Network Custom Resource standard for more details.
Bonded failover for SRIOV Workloads
Steps for deployment