Multus
It is strongly recommended to check out the Multus project documentation before you start configuring this chart.
Integrations
Section titled “Integrations”Cilium
Section titled “Cilium”Cilium is an exclusive CNI by default and needs to be configured to allow interoperation with other CNIs.
To do this, the following value needs to be added to the Cilium chart:
cni: exclusive: falseTalos does not ship all reference CNI plugins by default. You can check which CNI plugins are available in your talos install using the following command:
$ talosctl list /opt/cni/binNODE NAME192.168.1.10 .192.168.1.10 bridge192.168.1.10 cilium-cni192.168.1.10 firewall192.168.1.10 flannel192.168.1.10 host-local192.168.1.10 ipvlan192.168.1.10 loopback192.168.1.10 macvlan192.168.1.10 multus-shim192.168.1.10 passthru192.168.1.10 portmapIf you find that the plugins you require are missing, you can use this chart to install them. To do so, you must enable the Talos integration and specify which CNI binaries you would like to have installed. For example:
multus: integrations: talos: enabled: true installCni: macvlan: true ipvlan: trueThe above configuration will install the macvlan and ipvlan CNI plugins. This
is the default behaviour (as long as the talos integration is enabled), however,
it can be disabled by setting the value of any of corresponding keys to false.
On the other hand, more CNI plugins can be specified for installation by adding
their names under the installCni map in the form of <binary_name>: true.
Adding network interfaces to workloads
Section titled “Adding network interfaces to workloads”Adding a network interface to a workload consists of 2 steps:
- Defining the interface template via
NetworkAttachementDefinitionCRD. - Attaching the interface to a pod via custom annotations
If you have a multi-node cluster, you will need to deploy the Whereabouts plugin for IPAM management. The standard host-local IPAM plugin does not support multi-node IP assigment and using it may lead to IP conflicts, leaks and/or exhaustion
Examples
Section titled “Examples”Bridge network
Section titled “Bridge network”apiVersion: k8s.cni.cncf.io/v1kind: NetworkAttachmentDefinitionmetadata: name: bridge-network-with-gatewayspec: config: '{ "cniVersion": "0.3.1", "name": "mynet", "type": "bridge", "bridge": "br-192-168-10", "isDefaultGateway": true, "ipMasq": true, "ipam": { "type": "host-local", "subnet": "192.168.10.0/24", "rangeStart": "192.168.10.200", "rangeEnd": "192.168.10.216", "gateway": "192.168.10.1" } }'---apiVersion: v1kind: Podmetadata: name: busybox-bridge-pod annotations: k8s.v1.cni.cncf.io/networks: bridge-network-with-gatewayspec: containers: - name: busybox-container image: busybox:1.36 command: - "sh" - "-c" - | ip addr echo ip r echo echo '----- Waiting indefinitely -----' sleep infinityMacvlan default route network
Section titled “Macvlan default route network”apiVersion: k8s.cni.cncf.io/v1kind: NetworkAttachmentDefinitionmetadata: name: macvlan-networkspec: config: '{ "cniVersion": "0.3.1", "name": "mynet", "type": "macvlan", "master": "eth0", "mode": "bridge", "ipam": { "type": "host-local", "subnet": "192.168.1.0/24", "rangeStart": "192.168.1.3", "rangeEnd": "192.168.1.99", "gateway": "192.168.1.1", "routes": [ { "dst": "0.0.0.0/0" } ] } }'---apiVersion: v1kind: Podmetadata: name: busybox-macvlan-pod annotations: k8s.v1.cni.cncf.io/networks: | [{ "name": "macvlan-network", "mac": "02:aa:bb:cc:dd:ee", "default-route": ["192.168.1.1"] }]spec: containers: - name: busybox-container image: busybox:1.36 command: - "sh" - "-c" - | ip addr echo ip r echo echo '----- Waiting indefinitely -----' sleep infinityUninstalling
Section titled “Uninstalling”This chart makes several changes to the node’s root filesystem (via host-path mounts). These changes cannot be reversed by simply uninstalling the chart.
To combat this, this chart provides an “uninstall” mode, which takes care of cleaning up any host filesystem changes made by this chart.
Therefore, when uninstalling, it is recommended to first configure the chart in “uninstall” mode like so:
multus: uninstall: trueOnce applied, a cleanup container will run (you can check the logs for progress) and when it is done, the chart can be safely uninstalled.
Troubleshooting
Section titled “Troubleshooting”Missing networks after a node reboot
Section titled “Missing networks after a node reboot”This is a common issue with Multus and is caused by a race condition, where the primary CNI starts before Multus after a node reboot. This causes workloads to start scheduling before Multus has started, using only the primary CNI to configure the pods networks, resulting in missing network interfaces.
The easiest way to fix this is to change the directory where your primary CNI
places its config file. For example, with Cilium this can be achieved like so:
cni: confPath: /etc/cni/net.d/cilium # Note the cilium subdirOnce done, Multus needs to be pointed to where the primary CNI config is located.
If using Cilium, this will look something like this:
multus: primaryCniConfigFile: "cilium/05-cilium.conflist"