|
本文档采用自动化机器翻译技术翻译。 尽管我们力求提供准确的译文,但不对翻译内容的完整性、准确性或可靠性作出任何保证。 若出现任何内容不一致情况,请以原始 英文 版本为准,且原始英文版本为权威文本。 |
Multus
Using Multus
Multus CNI is a CNI plugin that enables attaching multiple network interfaces to pods. Multus does not replace CNI plugins, instead it acts as a CNI plugin multiplexer. Multus is useful in certain use cases, especially when pods are network intensive and require extra network interfaces that support dataplane acceleration techniques such as SR-IOV.
Multus can not be deployed standalone. It always requires at least one conventional CNI plugin that fulfills the Kubernetes cluster network requirements. That CNI plugin becomes the default for Multus, and will be used to provide the primary interface for all pods.
To enable Multus, add multus as the first list entry in the cni config key, followed by the name of the plugin you want to use alongside Multus (or none if you will provide your own default plugin). Note that multus must always be in the first position of the list. For example, to use Multus with canal as the default plugin you could specify:
# /etc/rancher/rke2/config.yaml
cni:
- multus
- canal
This can also be specified with command-line arguments, i.e. --cni=multus,canal or --cni=multus --cni=canal.
For more information about Multus, refer to the multus-cni documentation.
Using Multus with Cilium
|
Version Gate
Disabling the |
To use Cilium with Multus the exclusive config needs to be disabled.
You can do this by using the following HelmChartConfig:
# /var/lib/rancher/rke2/server/manifests/rke2-cilium-config.yaml
---
apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
name: rke2-cilium
namespace: kube-system
spec:
valuesContent: |-
cni:
exclusive: false
Using Multus with the containernetworking plugins
Any CNI plugin can be used as secondary CNI plugin for Multus to provide additional network interfaces attached to a pod. However, it is most common to use the CNI plugins maintained by the containernetworking team (bridge, host-device, macvlan, etc) as secondary CNI plugins for Multus. These containernetworking plugins are automatically deployed when installing Multus. For more information about these plugins, refer to the containernetworking plugins documentation.
To use any of these plugins, a proper NetworkAttachmentDefinition object will need to be created to define the configuration of the secondary network. The definition is then referenced by pod annotations, which Multus will use to provide extra interfaces to that pod. An example using the macvlan cni plugin with Multus is available in the multus-cni repo.
Multus IPAM plugin options
-
host-local
-
Multus DHCP daemon
-
Whereabouts
host-local IPAM plugin allocates ip addresses out of a set of address ranges. It stores the state locally on the host filesystem, therefore ensuring uniqueness of IP addresses on a single host. Therefore, we don’t recommend it for multi-node clusters. This IPAM plugin does not require any extra deployment. For more information: https://www.cni.dev/plugins/current/ipam/host-local/.
Multus provides an optional daemonset to deploy the DHCP daemon required to run the DHCP IPAM plugin. You can do this by using the following HelmChartConfig:
# /var/lib/rancher/rke2/server/manifests/rke2-multus-config.yaml
---
apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
name: rke2-multus
namespace: kube-system
spec:
valuesContent: |-
manifests:
dhcpDaemonSet: true
This will configure the chart for Multus to deploy the DHCP daemonset. This feature is available starting with the 2024-01 releases (v1.29.1+rke2r1, v1.28.6+rke2r1, v1.27.10+rke2r1, v1.26.13+rke2r1).
|
You should write this file before starting RKE2. |
Whereabouts is an IP Address Management (IPAM) CNI plugin that assigns IP addresses cluster-wide. RKE2 includes the option to use Whereabouts with Multus to manage the IP addresses of the additional interfaces created through Multus. In order to do this, you need to use HelmChartConfig to configure theMultus CNI to use Whereabouts.
You can do this by using the following HelmChartConfig:
# /var/lib/rancher/rke2/server/manifests/rke2-multus-config.yaml
---
apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
name: rke2-multus
namespace: kube-system
spec:
valuesContent: |-
rke2-whereabouts:
enabled: true
This will configure the chart for Multus to use rke2-whereabouts as a dependency.
|
You should write this file before starting RKE2. |
Enabling Multus Dynamic Networks Controller
One use case for using Multus "thick plugin" is to deploy the Dynamic Networks Controller. This is done through the following HelmChartConfig:
# /var/lib/rancher/rke2/server/manifests/rke2-multus-config.yaml
apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
name: rke2-multus
namespace: kube-system
spec:
valuesContent: |-
thickPlugin:
enabled: true
dynamicNetworksController:
enabled: true
|
The Dynamic Networks Controller can be deployed only with Multus in "thick plugin" mode. |
Using Multus with SR-IOV
Using the SR-IOV CNI with Multus can help with data-plane acceleration use cases, providing an extra interface in the pod that can achieve very high throughput. Complete deployment steps, prerequisites, and hardware compatibility details can be found in the SR-IOV Network Operator Quickstart Guide.
For fully validated configurations and enterprise-grade infrastructure support for SR-IOV in RKE2, refer to SUSE Telco Cloud.