Skip to content
Français
Sync not enabled: your progress stays in this browser My learning
Select theme
Français

Give a Pod a second interface with Multus

By updated

Improve this page

A Pod gets a single network interface from its CNI plugin, and Multus adds a second one: it calls other CNI plugins, according to an annotation set on the Pod. With Cilium as the main network, an ordering trap makes the installation fail without any error: by default Cilium renames Multus's configuration, and an annotated Pod then starts without its second interface, with no error event at all. This lesson first sets Cilium to cni.exclusive=false, then installs Multus 4.3.2. It then declares a second macvlan network in a NetworkAttachmentDefinition (NAD, the Kubernetes object that describes an additional network), attaches two Pods to this network and proves they can talk over it.

It is aimed at readers who have already installed Cilium on a kubeadm cluster and want an extra network for storage, administration or isolated traffic.

What you will learn

  • Say why a Pod may need a second interface, and what Multus adds to the main network's CNI plugin.
  • Recognize the ordering trap: Cilium renames Multus's configuration to 00-multus.conf.cilium_bak, with no error message, and prove it with ls -l /etc/cni/net.d. Set cni.exclusive=false with helm upgrade and check the value in the cilium-config ConfigMap.
  • Install the reference CNI plugins 1.10.0 (checked with sha256sum -c) and deploy Multus as a thick plugin with a pinned image, whose version you read with multus-daemon --version.
  • Declare a second network with a NetworkAttachmentDefinition, attach it to a Pod with the k8s.v1.cni.cncf.io/networks annotation, read the two interfaces, the network-status annotation and the routes, then prove an exchange over the second network.
  • Know that the second interface's traffic escapes Cilium's network policies, and measure what mode: private changes in the NAD.
  • Repair each trapped node and diagnose a missing second interface.

Prerequisites

  • The lesson Install Cilium without kube-proxy and choose your IPAM, which installs the cluster used in this lesson: Cilium 1.20.5 as the CNI plugin of the main network, deployed with Helm.
  • The lesson Pod Networking, to know what a Pod's address is and how it gets it.
  • The lesson CNI, CSI and CRI, to know that a CNI plugin is an executable the runtime calls when a Pod starts.
  • ssh access to the nodes with sudo, and a kubectl that administers the cluster.
  • The demonstration environment: three Ubuntu 24.04 VMs (net-cp, net-w1, net-w2), Kubernetes 1.37.2, containerd 2.2.1, Multus 4.3.2 and CNI plugins 1.10.0. The outputs were captured on November 17, 2026 with Cilium 1.20.4; the lab installs Cilium 1.20.5.
  • VMs whose hypervisor accepts several MAC addresses per network card: macvlan gives each Pod its own MAC address, and the demonstration fails between two nodes if the hypervisor blocks it (see the troubleshooting table).

Why give a Pod a second interface?

A Pod's network is an eth0 interface created by the cluster's CNI plugin, here Cilium. It carries all the traffic: calls to Services, DNS and the rest. Some uses call for a separate path: a storage network whose throughput you want to protect, an isolated administration network, or a piece of equipment reachable only through a specific physical network.

Kubernetes has nothing for this: a CNI plugin configures one interface per Pod. Multus adds the missing piece. It is installed as the "head" CNI plugin: when a Pod starts, the runtime calls it, and Multus in turn calls the main network's plugin (Cilium), then one plugin per additional network that the Pod's annotation asks for. The main network is the one that provides eth0 and the Pod's default route. Each additional network is described in a Kubernetes object, the NetworkAttachmentDefinition.

Multus comes in two variants. The thin plugin is a plain executable. The thick plugin, the one in this lesson, adds a daemon that runs in a Pod on each node, and a small client executable, multus-shim, that the runtime calls. The project recommends the thick plugin in most environments, and keeps the thin one for nodes with limited resources.

The diagram follows a Pod starting with the thick plugin. Watch who talks to whom: the runtime only calls Multus, and Multus calls the two plugins, Cilium first for eth0, then macvlan for net1.

Exchange between four actors. When a Pod starts, containerd calls Multus (the shim and the daemon). Multus first calls cilium-cni for the main network, which returns eth0 and its address. Multus then calls the macvlan plugin for the annotation's network, which returns net1 and its address. Multus then tells containerd that the Pod's network is ready.macvlancilium-cniMultus (shim,daemon)containerdCNI callmain networketh0 and its addressannotation networknet1 and its addressPod network ready
Source · SVG
Esc to close, + and − to zoom, scroll to move around. 100 %

In what order should you install Cilium and Multus?

The order matters, and getting it wrong produces no error. Cilium comes with the setting cni.exclusive=true: it wants to be the only plugin on the node, and renames to *.cilium_bak any other CNI configuration it finds in /etc/cni/net.d. Multus writes its configuration into exactly this directory.

Here is what happens when you install Multus on the cluster as the Cilium lesson leaves it, that is with cni.exclusive=true. This first installation is to be read, not repeated. The section "What happens to an annotated Pod when Multus is renamed?" reproduces the same failure further down, on a cluster where Multus and its network are already installed.

Before the installation, Cilium's ConfigMap says true, and the node only holds Cilium's configuration. The kubectl command runs from the administration workstation. The sudo ls command, on the other hand, runs on the net-w1 node, because it reads a directory of the node:

Terminal window
kubectl -n kube-system get configmap cilium-config -o jsonpath='{.data.cni-exclusive}'; echo
true
Terminal window
sudo ls -l /etc/cni/net.d
total 4
-rw------- 1 root root 191 Nov 17 17:35 05-cilium.conflist

You then apply Multus's manifest as the project publishes it (its image is not pinned yet, which the installation section fixes). The deployment goes fine, the three Pods of the kube-multus-ds DaemonSet become Ready, and kubectl reports nothing. You have to look at the same directory on the net-w1 node:

total 8
-rw------- 1 root root 169 Nov 17 17:38 00-multus.conf.cilium_bak
-rw------- 1 root root 191 Nov 17 17:35 05-cilium.conflist

Multus's file exists, but it is named 00-multus.conf.cilium_bak. A file that no longer ends in .conf is not read as a CNI configuration: Multus is no longer in the chain. Restarting Cilium's Pods (kubectl -n kube-system rollout restart ds/cilium) changes nothing, the name stays the same. The restarted Cilium agent's log does not mention any renaming either. The direct proof is the file name, read with ls -l /etc/cni/net.d on a node.

The real danger is not the renamed file but what a Pod gets out of it: an annotated Pod starts normally, without its second interface, and nothing reports it. The full demonstration comes after the installation of Multus and the creation of the network.

The remedy is to set Cilium before installing Multus, and to read ls -l /etc/cni/net.d again after each Cilium helm upgrade.

How do you set cni.exclusive=false?

You modify the existing Helm release without touching its other values. --reuse-values keeps the installation's values, --version keeps the same chart version, and --set cni.exclusive=false applies the only change. This command runs on the net-cp control plane node, because it reads /etc/kubernetes/admin.conf:

Terminal window
sudo helm --kubeconfig /etc/kubernetes/admin.conf upgrade cilium cilium/cilium \
-n kube-system --version 1.20.5 --reuse-values --set cni.exclusive=false
Release "cilium" has been upgraded. Happy Helming!
NAME: cilium
LAST DEPLOYED: Tue Nov 17 17:39:02 2026
NAMESPACE: kube-system
STATUS: deployed
REVISION: 2
DESCRIPTION: Upgrade complete

The Cilium agent restarts on each node: you wait for the rollout to finish, then read the setting again in the ConfigMap. These two kubectl commands run from the administration workstation.

Terminal window
kubectl -n kube-system rollout status ds/cilium --timeout=300s
kubectl -n kube-system get configmap cilium-config -o jsonpath='{.data.cni-exclusive}'; echo
daemon set "cilium" successfully rolled out
false

The ConfigMap says false: this is the proof that Cilium will now leave other CNI configurations in place. On a cluster where Multus was already installed the wrong way, this setting does not give the .cilium_bak file its name back. It is Multus that writes 00-multus.conf, when its Pod starts: you therefore have to restart it. The three-step repair is measured further down, in the section "What happens to an annotated Pod when Multus is renamed?".

Which CNI plugins should you install on the nodes?

Multus does not configure the second interface itself: it calls a CNI plugin, here macvlan, and an addressing plugin (IPAM, for IP Address Management) that provides the address, here static. These executables live in /opt/cni/bin on each node. The directory already contains cilium-cni and plugins shipped with the nodes' installation. You install version 1.10.0 of the CNI project's reference plugins so as not to depend on what a node image contains, and you check the archive before opening it. To be done on each node:

Terminal window
cd /tmp
curl -sSLO https://github.com/containernetworking/plugins/releases/download/v1.10.0/cni-plugins-linux-amd64-v1.10.0.tgz
curl -sSLO https://github.com/containernetworking/plugins/releases/download/v1.10.0/cni-plugins-linux-amd64-v1.10.0.tgz.sha256
sha256sum -c cni-plugins-linux-amd64-v1.10.0.tgz.sha256
sudo tar -xzf cni-plugins-linux-amd64-v1.10.0.tgz -C /opt/cni/bin ./macvlan ./static ./host-local
/opt/cni/bin/macvlan --version
cni-plugins-linux-amd64-v1.10.0.tgz: OK
CNI macvlan plugin v1.10.0
CNI protocol versions supported: 0.1.0, 0.2.0, 0.3.0, 0.3.1, 0.4.0, 1.0.0, 1.1.0

The OK on the first line is the condition for extracting the archive: without it, you do not touch it. The last line of the output lists the CNI protocol versions the plugin understands, including 1.0.0, which this lesson's NetworkAttachmentDefinition declares. tar only extracts the three useful plugins; the rest of the archive stays closed. The downloaded archive is the amd64 variant: on ARM nodes, take cni-plugins-linux-arm64-v1.10.0.tgz and its .sha256 file, with the same check.

How do you install Multus as a thick plugin with a pinned image?

The Multus project publishes the thick plugin's manifest with each version: deployments/multus-daemonset-thick.yml, at tag v4.3.2. It creates the NetworkAttachmentDefinition resource definition, the RBAC permissions, a settings ConfigMap and the kube-multus-ds DaemonSet. One detail means you should not apply it as is: its image is ghcr.io/k8snetworkplumbingwg/multus-cni:snapshot-thick, a moving tag that changes with each publication. Two nodes set up on different dates might not run the same Multus.

You therefore download the manifest, replace the image with the one for version 4.3.2 with its digest, then apply it:

Terminal window
curl -sSL -o multus-thick.yml https://raw.githubusercontent.com/k8snetworkplumbingwg/multus-cni/v4.3.2/deployments/multus-daemonset-thick.yml
grep -n 'image:' multus-thick.yml
168: image: ghcr.io/k8snetworkplumbingwg/multus-cni:snapshot-thick # ❌ moving tag
215: image: ghcr.io/k8snetworkplumbingwg/multus-cni:snapshot-thick # ❌ moving tag

The manifest cites the image twice: for the init container and for the main container. The # ❌ marker is added here to point out the moving tag, it is not part of the output. The sed replaces both images.

Terminal window
sed -i 's#ghcr.io/k8snetworkplumbingwg/multus-cni:snapshot-thick#ghcr.io/k8snetworkplumbingwg/multus-cni:v4.3.2-thick@sha256:109b885d8752fe7a7bc3b2371750bfad6789b8b8e2d0b0820b337386ba9b93c9#' multus-thick.yml
kubectl apply -f multus-thick.yml
kubectl -n kube-system rollout status ds/kube-multus-ds --timeout=240s
customresourcedefinition.apiextensions.k8s.io/network-attachment-definitions.k8s.cni.cncf.io unchanged
clusterrole.rbac.authorization.k8s.io/multus unchanged
clusterrolebinding.rbac.authorization.k8s.io/multus unchanged
serviceaccount/multus unchanged
configmap/multus-daemon-config unchanged
daemonset.apps/kube-multus-ds created
Waiting for daemon set "kube-multus-ds" rollout to finish: 0 of 3 updated pods are available...
Waiting for daemon set "kube-multus-ds" rollout to finish: 1 of 3 updated pods are available...
Waiting for daemon set "kube-multus-ds" rollout to finish: 2 of 3 updated pods are available...
daemon set "kube-multus-ds" successfully rolled out

Here, only the DaemonSet is created: the resource definition, the permissions and the ConfigMap already existed (unchanged) because of the first installation described above, whose DaemonSet had been deleted beforehand. On a cluster without Multus, kubectl apply prints created for all these objects. You then check, from the administration workstation, that each node runs the expected image, then the daemon's version:

Terminal window
kubectl -n kube-system get pods -l app=multus -o jsonpath='{range .items[*]}{.spec.nodeName}{" "}{.status.containerStatuses[0].imageID}{"\n"}{end}'
kubectl -n kube-system exec ds/kube-multus-ds -c kube-multus -- /usr/src/multus-cni/bin/multus-daemon --version
net-w2.lab ghcr.io/k8snetworkplumbingwg/multus-cni@sha256:109b885d8752fe7a7bc3b2371750bfad6789b8b8e2d0b0820b337386ba9b93c9
net-cp.lab ghcr.io/k8snetworkplumbingwg/multus-cni@sha256:109b885d8752fe7a7bc3b2371750bfad6789b8b8e2d0b0820b337386ba9b93c9
net-w1.lab ghcr.io/k8snetworkplumbingwg/multus-cni@sha256:109b885d8752fe7a7bc3b2371750bfad6789b8b8e2d0b0820b337386ba9b93c9
multus-daemon: version:v4.3.2(clean,released), commit:1d81062afcb32eb7290fa28bcbc482c3d0c5cae9, date:2026-11-05T16:11:55+00:00

The three nodes carry the same digest, and multus-daemon answers v4.3.2(clean,released). The word released says the binary comes from a published version, not from a snapshot. The binary prints its version then exits with code 4. This code is normal for this command, it does not signal a failure. What is left is to read what Multus wrote on the net-w1 node, with the following two commands run on that node.

Terminal window
sudo ls -l /etc/cni/net.d
sudo cat /etc/cni/net.d/00-multus.conf
total 12
-rw------- 1 root root 169 Nov 17 17:39 00-multus.conf
-rw------- 1 root root 169 Nov 17 17:38 00-multus.conf.cilium_bak
-rw------- 1 root root 191 Nov 17 17:35 05-cilium.conflist
{"cniVersion":"0.3.1","logLevel":"verbose","logToStderr":true,"name":"multus-cni-network","clusterNetwork":"/host/etc/cni/net.d/05-cilium.conflist","type":"multus-shim"}

The 00-multus.conf.cilium_bak file from the first installation stays there, with no effect since its extension is not read. 00-multus.conf exists under its real name and comes before 05-cilium.conflist in alphabetical order. Its type field is multus-shim, the daemon's client executable. Its clusterNetwork field points to Cilium's configuration: this is the main network, the one Multus calls first to create eth0. The /host prefix comes from the fact that Multus's Pod sees the node's files under this path. Cilium, for its part, keeps answering. Run from the administration workstation, the command kubectl -n kube-system exec ds/cilium -c cilium-agent -- cilium status --brief prints OK.

How do you declare a second network?

A second network is described by a NAD, a Kubernetes object that is scoped to a namespace. Its spec.config field contains the plugin's CNI configuration, in JSON. Here, the reseau-stockage network uses the macvlan plugin, which creates in the Pod a virtual interface laid on a network card of the node, with its own MAC address. Each Pod therefore shows up on the physical network with a MAC address that is not the VM's, which matters if the hypervisor filters addresses (see the troubleshooting table).

apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
name: reseau-stockage
namespace: multus-demo
spec:
config: |
{
"cniVersion": "1.0.0",
"name": "reseau-stockage",
"type": "macvlan",
"master": "enp1s0",
"mode": "bridge",
"ipam": { "type": "static" }
}

Save this file as nad.yaml. Each field of the configuration has a precise role:

  • type names the plugin to call, an executable in /opt/cni/bin.
  • master is the node's card the macvlan interface attaches to.
  • mode: bridge lets the macvlan interfaces of the same parent communicate with each other. With mode: private, two Pods on the same node can no longer reach each other; the section on modifying a NAD measures it.
  • ipam chooses the address: with static, the address comes from the Pod's annotation, not from the network.

The name enp1s0 is the card's name on the demonstration VMs. On your nodes, the card may have another name: ip -br link lists them, and master must hold the card of the network you want to double.

Terminal window
kubectl create namespace multus-demo
kubectl apply -f nad.yaml
kubectl -n multus-demo get network-attachment-definitions
namespace/multus-demo created
networkattachmentdefinition.k8s.cni.cncf.io/reseau-stockage created
NAME AGE
reseau-stockage 0s

How do you attach this network to a Pod?

You attach a network with the k8s.v1.cni.cncf.io/networks annotation, which carries either the NAD's name or a JSON list when you need to fix the address. Two Pods on two different nodes, client on net-w1 and serveur on net-w2, share the reseau-stockage network with one address each. The nodeName field forces the node, so that the exchange really crosses two machines. The server listens for HTTP on port 8080 and answers a recognizable text. Save the two Pods in the pods.yaml file.

apiVersion: v1
kind: Pod
metadata:
name: client
namespace: multus-demo
annotations:
k8s.v1.cni.cncf.io/networks: '[{"name": "reseau-stockage", "ips": ["192.168.100.11/24"]}]'
spec:
nodeName: net-w1.lab
containers:
- name: c
image: busybox:1.37@sha256:a7dbc319b1438115a207e11930dc4bb3e643dcb3ec0bdd694bb36cd8fad289ec
command: ["sleep", "3600"]
---
apiVersion: v1
kind: Pod
metadata:
name: serveur
namespace: multus-demo
annotations:
k8s.v1.cni.cncf.io/networks: '[{"name": "reseau-stockage", "ips": ["192.168.100.12/24"]}]'
spec:
nodeName: net-w2.lab
containers:
- name: c
image: busybox:1.37@sha256:a7dbc319b1438115a207e11930dc4bb3e643dcb3ec0bdd694bb36cd8fad289ec
command: ["sh", "-c", "echo bonjour-du-reseau-stockage > /tmp/index.html; httpd -f -p 8080 -h /tmp"]

The client Pod's annotation names reseau-stockage without specifying a namespace: Multus therefore looks for the NAD in the Pod's own namespace, multus-demo. The address carries its mask (/24), because the static plugin needs it. You apply the file and wait for both Pods to be ready:

Terminal window
kubectl apply -f pods.yaml
kubectl -n multus-demo wait --for=condition=Ready pod/client pod/serveur --timeout=180s
kubectl -n multus-demo get pods -o wide
pod/client created
pod/serveur created
pod/client condition met
pod/serveur condition met
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
client 1/1 Running 0 1s 10.244.1.221 net-w1.lab <none> <none>
serveur 1/1 Running 0 1s 10.244.0.74 net-w2.lab <none> <none>

The IP column only shows the main network's address. The second address does not appear in kubectl get pods: you have to look for it inside the Pod.

How do you read a Pod's two interfaces?

The diagram shows what you have just built. Follow the two links between the Pods. The dotted link is the main network, Cilium's, which gives eth0 to each Pod. The thick link is the reseau-stockage network: the two net1 interfaces, each laid by macvlan on its node's enp1s0 card.

Two Pods on two nodes. The client Pod, on net-w1, has an eth0 interface (10.244.1.221) and a net1 interface (192.168.100.11, macvlan on enp1s0). The serveur Pod, on net-w2, has eth0 (10.244.0.74) and net1 (192.168.100.12, macvlan on enp1s0). The Pod network, managed by Cilium, links the two eth0. The reseau-stockage network links the two net1.eth010.244.1.221eth010.244.0.74 Pod network net1 192.168.100.11macvlan on enp1s0net1 192.168.100.12macvlan on enp1s0 reseau-stockage Node net-w1.labclient PodNode net-w2.labserveur Pod
Source · SVG
Esc to close, + and − to zoom, scroll to move around. 100 %

The ip -4 addr command inside the Pod shows both interfaces:

Terminal window
kubectl -n multus-demo exec client -- ip -4 addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: net1@net1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue qlen 1000
inet 192.168.100.11/24 brd 192.168.100.255 scope global net1
valid_lft forever preferred_lft forever
16: eth0@if17: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue
inet 10.244.1.221/32 scope global eth0
valid_lft forever preferred_lft forever

eth0 carries Cilium's address (10.244.1.221/32), and net1 carries the one we asked for (192.168.100.11/24).

Multus also keeps a registry in a Pod annotation, network-status. For each interface, it gives the originating network, the interface name, the addresses and the MAC address.

Terminal window
kubectl -n multus-demo get pod client -o jsonpath='{.metadata.annotations.k8s\.v1\.cni\.cncf\.io/network-status}'; echo
[{
"name": "cilium",
"interface": "eth0",
"ips": [
"10.244.1.221"
],
"mac": "b6:55:a0:5a:7c:e8",
"default": true,
"dns": {},
"gateway": [
"10.244.1.195"
]
},{
"name": "multus-demo/reseau-stockage",
"interface": "net1",
"ips": [
"192.168.100.11"
],
"mac": "72:18:dd:73:25:f6",
"dns": {}
}]

Only the first network carries "default": true, and it alone has a gateway: it is the main network. The second is a separate network, with no gateway. The Pod's routes confirm it:

Terminal window
kubectl -n multus-demo exec client -- ip route
default via 10.244.1.195 dev eth0
10.244.1.195 dev eth0 scope link
192.168.100.0/24 dev net1 scope link src 192.168.100.11

The default route goes through eth0: all ordinary traffic (Services, DNS, Internet) stays on Cilium. The 192.168.100.0/24 network is only reachable through net1. A Pod does not use its second network until an application sends packets to an address of that network.

This second interface has a security limit. Cilium only manages the Pod's main interface. Managing several interfaces per Pod ("multi-homing") is still, in the Cilium project, only a proposal. The traffic of net1 therefore does not go through Cilium, and neither Kubernetes NetworkPolicies nor CiliumNetworkPolicies filter it.

The mechanism intended for secondary networks is MultiNetworkPolicy, a separate project whose repository describes itself as "not stable yet". This lesson does not install it: until you have set it up, do not count on network policies to filter net1.

How do you prove the second network is used?

To prove the exchange, you call the server by the address of its second network, which only exists on net1. A ping first, then an HTTP request.

Terminal window
kubectl -n multus-demo exec client -- ping -c 3 -W 2 192.168.100.12
kubectl -n multus-demo exec client -- wget -qO- -T 5 http://192.168.100.12:8080/
PING 192.168.100.12 (192.168.100.12): 56 data bytes
64 bytes from 192.168.100.12: seq=0 ttl=64 time=0.286 ms
64 bytes from 192.168.100.12: seq=1 ttl=64 time=0.494 ms
64 bytes from 192.168.100.12: seq=2 ttl=64 time=0.300 ms
--- 192.168.100.12 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.286/0.360/0.494 ms
bonjour-du-reseau-stockage

Three packets go out, three come back, and the server's text arrives. The address 192.168.100.12 only exists on net1: the answer therefore crossed the second network. The main network stays intact: the same request to the server's Cilium address, http://10.244.0.74:8080/, also returns bonjour-du-reseau-stockage. The Pod talks on two networks at once.

What happens to an annotated Pod when Multus is renamed?

An annotated Pod starts normally, without its second interface, and nothing reports it. You reproduce it on the demonstration cluster, where Multus, the plugins, the multus-demo namespace and the reseau-stockage NAD already exist. Setting cni.exclusive=true again with helm upgrade and waiting for Cilium to restart renames 00-multus.conf to 00-multus.conf.cilium_bak once more, and the old .cilium_bak is overwritten.

The following block runs on three machines. helm reads /etc/kubernetes/admin.conf: it starts from the net-cp control plane node. kubectl runs from the administration workstation. sudo ls runs on the net-w1 node.

Terminal window
sudo helm --kubeconfig /etc/kubernetes/admin.conf upgrade cilium cilium/cilium \
-n kube-system --version 1.20.5 --reuse-values --set cni.exclusive=true
kubectl -n kube-system rollout status ds/cilium --timeout=300s
sudo ls -l --time-style=+%H:%M:%S /etc/cni/net.d

The last ls, run on net-w1, now only shows the renamed file and Cilium's configuration:

total 8
-rw------- 1 root root 169 17:42:31 00-multus.conf.cilium_bak
-rw------- 1 root root 191 17:35:46 05-cilium.conflist

You then launch a Pod annotated for reseau-stockage, placed on net-w1. Save it in the piege.yaml file:

apiVersion: v1
kind: Pod
metadata:
name: piege
namespace: multus-demo
annotations:
k8s.v1.cni.cncf.io/networks: '[{"name": "reseau-stockage", "ips": ["192.168.100.13/24"]}]'
spec:
nodeName: net-w1.lab
containers:
- name: c
image: busybox:1.37@sha256:a7dbc319b1438115a207e11930dc4bb3e643dcb3ec0bdd694bb36cd8fad289ec
command: ["sleep", "3600"]

The Pod becomes Ready. Three readings tell what it is missing: its interfaces, the network-status annotation and its events. The five commands run from the administration workstation.

Terminal window
kubectl apply -f piege.yaml
kubectl -n multus-demo wait --for=condition=Ready pod/piege --timeout=120s
kubectl -n multus-demo exec piege -- ip -4 addr
kubectl -n multus-demo get pod piege -o jsonpath='{.metadata.annotations.k8s\.v1\.cni\.cncf\.io/network-status}'; echo
kubectl -n multus-demo get events --field-selector involvedObject.name=piege -o custom-columns=RAISON:.reason,MESSAGE:.message
pod/piege condition met
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
26: eth0@if27: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue
inet 10.244.1.108/32 scope global eth0
valid_lft forever preferred_lft forever
RAISON MESSAGE
Pulled Container image "busybox:1.37@sha256:a7dbc319b1438115a207e11930dc4bb3e643dcb3ec0bdd694bb36cd8fad289ec" already present on machine and can be accessed by the pod
Created Container created
Started Container started

Look at what is missing. The Pod only has lo and eth0, with no net1. The empty line comes from the second command: network-status was not filled in, since Multus was not called. The events are limited to Pulled, Created and Started, as for a Pod with no annotation. A Pod that starts without net1 and without an error event is therefore the sign of a Multus configuration missing from /etc/cni/net.d. Unlike an unknown NAD, which blocks the Pod in ContainerCreating, here nothing blocks.

How do you repair the nodes where Multus is already renamed?

The failure hits every node where the Cilium agent restarted, not just one. The repair takes three steps, in this order: set Cilium, restart the Multus Pods on each affected node, then recreate the workload Pods. The first step is the helm upgrade ... --set cni.exclusive=false from the section on this setting, followed by waiting for Cilium to restart. The second deletes each node's kube-multus-ds Pod; the DaemonSet recreates it, and the new Pod rewrites 00-multus.conf. Deleting the Pod, not the DaemonSet, leaves the manifest and your NADs untouched.

The demonstration measured this action on net-w1 only. It must be repeated on each node, and ls -l /etc/cni/net.d must be read again on each one: a forgotten node keeps its 00-multus.conf.cilium_bak and its annotated Pods start without net1.

First locate the Multus Pods: the NODE column of the command gives each one's node, and the node's Pod name replaces <pod-kube-multus-ds-du-noeud> in the next one.

Terminal window
kubectl -n kube-system get pods -l app=multus -o wide

Then, for each node, delete its Pod, wait for the DaemonSet to come back and read the node's directory again. Here is what the net-w1 node gave. The following block runs on two machines. The two kubectl commands run from the administration workstation. sudo ls runs on the net-w1 node, over ssh, since it reads that node's /etc/cni/net.d directory.

Terminal window
kubectl -n kube-system delete pod <pod-kube-multus-ds-du-noeud> --wait=true
kubectl -n kube-system rollout status ds/kube-multus-ds --timeout=180s
sudo ls -l --time-style=+%H:%M:%S /etc/cni/net.d
pod "kube-multus-ds-ff8vs" deleted from kube-system namespace
Waiting for daemon set "kube-multus-ds" rollout to finish: 2 of 3 updated pods are available...
daemon set "kube-multus-ds" successfully rolled out
total 12
-rw------- 1 root root 169 18:08:03 00-multus.conf
-rw------- 1 root root 169 17:42:31 00-multus.conf.cilium_bak
-rw------- 1 root root 191 17:35:46 05-cilium.conflist

On net-w1, the 00-multus.conf file is back, dated to the minute of the restart, and the .cilium_bak no longer changes. But a workload Pod that is already running does not change: the piege Pod, launched before the repair, keeps eth0 alone after it. The third step is therefore to delete and recreate each annotated Pod (kubectl -n multus-demo delete pod piege, then kubectl apply -f piege.yaml): the recreated Pod gets eth0 and net1 (192.168.100.13/24 here). Then delete piege, which the rest of the lesson no longer needs.

What happens to a Pod when you modify the NAD?

A modified NAD does not act on running Pods: only Pods created afterwards read it. Multus reads the NAD when the Pod starts, not after. To measure it, you take two Pods a and b placed on net-w1 with the NAD in mode: bridge, then switch the NAD to private. Save the two Pods in the pods-nad.yaml file:

apiVersion: v1
kind: Pod
metadata:
name: a
namespace: multus-demo
annotations:
k8s.v1.cni.cncf.io/networks: '[{"name": "reseau-stockage", "ips": ["192.168.100.21/24"]}]'
spec:
nodeName: net-w1.lab
containers:
- name: c
image: busybox:1.37@sha256:a7dbc319b1438115a207e11930dc4bb3e643dcb3ec0bdd694bb36cd8fad289ec
command: ["sleep", "3600"]
---
apiVersion: v1
kind: Pod
metadata:
name: b
namespace: multus-demo
annotations:
k8s.v1.cni.cncf.io/networks: '[{"name": "reseau-stockage", "ips": ["192.168.100.22/24"]}]'
spec:
nodeName: net-w1.lab
containers:
- name: c
image: busybox:1.37@sha256:a7dbc319b1438115a207e11930dc4bb3e643dcb3ec0bdd694bb36cd8fad289ec
command: ["sleep", "3600"]

After kubectl apply -f pods-nad.yaml and waiting for both Pods to be Ready, the action that switches the NAD to private is an edit of nad.yaml (replace "mode": "bridge" with "mode": "private"), then its reapplication:

Terminal window
kubectl apply -f nad.yaml
networkattachmentdefinition.k8s.cni.cncf.io/reseau-stockage configured

The interface's real mode is read from the node, in the container's network namespace: busybox's ip -d does not display it and answers with its help. The container ID is read from the Pod's status, without its containerd:// prefix:

Terminal window
kubectl -n multus-demo get pod a -o jsonpath='{.status.containerStatuses[0].containerID}'

On the node that hosts the Pod (here net-w1), you ask crictl for its PID, then read the interface in its network namespace. The ping runs from the administration workstation:

Terminal window
pid=$(sudo crictl inspect --output go-template --template '{{.info.pid}}' <id-du-conteneur>)
sudo nsenter -t $pid -n ip -d link show net1 | grep -o 'macvlan mode [a-z]*'
kubectl -n multus-demo exec a -- ping -c 2 -W 2 192.168.100.22

Right after the NAD change, the running Pods answer as before:

macvlan mode bridge
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.046/0.052/0.059 ms

Look at the mode: it stays bridge, and the exchange still works. You then delete a and b (kubectl -n multus-demo delete pod a b --wait=true), then recreate them with kubectl apply -f pods-nad.yaml and the same NAD. The recreated Pods have new container IDs: read a's again with the same jsonpath command before running crictl inspect again. The three commands then give:

macvlan mode private
2 packets transmitted, 0 packets received, 100% packet loss
command terminated with exit code 1

The recreated Pods are in macvlan mode private and can no longer reach each other. The private mode only isolates Pods on the same node, though: from a, a ping to 192.168.100.12, the address of the serveur Pod on net-w2, still answers (2 packets out of 2), because this traffic goes through the physical card. After the measurement, put bridge back in nad.yaml, reapply it and recreate the Pods, or go straight to the cleanup.

How do you clean up the demonstration?

Delete the demonstration's namespace: the Pods and the NAD go with it, while Multus and the Cilium setting stay in place. Do it last, once you have finished all the measurements above: they use the namespace, the NAD and the serveur Pod.

Terminal window
kubectl delete namespace multus-demo

Troubleshooting

Start by reading the Pod's events (kubectl -n <namespace> describe pod <pod>) and the contents of /etc/cni/net.d on the node that hosts it: both answer most cases in the table below. When the Pod is Running without net1 and the events show no error, only the node's directory tells.

SymptomLikely causeSolution
The Pod stays in ContainerCreating; the events show NoNetworkFound then FailedCreatePodSandBox with cannot find a network-attachment-definition (reseau-inexistant) in namespace (multus-demo): networkattachmentdefinition.k8s.cni.cncf.io "reseau-inexistant" not foundThe NAD named in the annotation does not exist in the Pod's namespace: wrong name, or NAD created in another namespacekubectl -n multus-demo get network-attachment-definitions, then fix the name in the annotation or create the NAD. To target another namespace, write it namespace/name in the annotation
Multus is Ready on the three nodes, but ls -l /etc/cni/net.d shows 00-multus.conf.cilium_bak and not 00-multus.confMultus was installed with Cilium in cni.exclusive=true: Cilium renamed its configurationSet cni.exclusive=false and check false in cilium-config, then delete the kube-multus-ds Pod on each affected node (the DaemonSet recreates it and rewrites 00-multus.conf) and read ls -l /etc/cni/net.d again on each, then recreate the workload Pods. Restarting Cilium alone is not enough
The Pod is Running with lo and eth0 only, network-status is empty and kubectl get events shows no errorcni.exclusive=true renamed 00-multus.conf again (for example after a Cilium helm upgrade): Multus is not calledls -l /etc/cni/net.d on the node, then the three-step repair: cni.exclusive=false, restart of the Multus Pod on each affected node, workload Pods recreated
Two Pods on the same node can no longer reach each other on the second network, while a Pod on another node answersThe NAD was switched to mode: private: the Pods recreated since are isolated from each other on the same nodeRead the mode with nsenter ... ip -d link show net1, put bridge back in the NAD, recreate the Pods
kubectl -n kube-system get ds kube-multus-ds -o jsonpath='{.spec.template.spec.containers[0].image}' prints snapshot-thickThe manifest was applied without replacing the moving imageReplace the image with v4.3.2-thick@sha256:109b885d… as above, then reapply. Check with multus-daemon --version
sha256sum -c does not print OKCNI plugins archive incomplete or tampered withDo not extract: download the archive and its .sha256 file again
The Pod starts with eth0 alone, without net1The annotation key's name differs from k8s.v1.cni.cncf.io/networks: Multus then sees no request. Case not measured in this lessonRead the key again character by character, then recreate the Pod: the annotation is read at creation
The Pod stays in ContainerCreating and the events report an unreadable annotationThe annotation's value starts with [ or { and is not valid JSON. Case not measured in this lessonValidate the annotation's JSON, then recreate the Pod
net1 is not created and the events report an error from the macvlan pluginmaster names a card that is absent from the node: the demonstration VMs' names are not yours. Case not measured in this lessonip -br link on the node, fix master in the NAD, recreate the Pods
net1 exists in both Pods, but nothing passes between two nodes (the ping to the other node's net1 address fails)The hypervisor or the network drops frames whose MAC address is not the VM's: macvlan gives each Pod its own MAC address. Docker's documentation for the macvlan driver asks for network hardware that accepts "promiscuous" mode and notes that most cloud providers block macvlan. Another possible cause: master names a card that is not the intended network'sOn Hyper-V, allow MAC address spoofing on the VM's card: Set-VMNetworkAdapter -VMName <vm> -MacAddressSpoofing On. On VMware, set the virtual switch's security (MAC address changes and forged transmits). Otherwise, ip -br link on the node to check master

After fixing the NAD or Cilium's setting, you must recreate the Pods: the configuration is read when a Pod starts.

Put it into practice

The lab replays this walkthrough on a three-node Cilium cluster where Multus is not installed yet. You set Cilium to cni.exclusive=false, deploy Multus 4.3.2 as a thick plugin from an image pinned by its digest, declare the reseau-stockage NetworkAttachmentDefinition as macvlan, then attach two Pods on two nodes to this second network. The validation reads the cluster state: cni-exclusive is false and every agent is ready, Multus runs on the three nodes, the NAD describes the expected network, the two Pods each declare their two interfaces with their address, and client reaches serveur over the second network while serveur still answers on the cluster network. It does not look at the commands you type.

Key points

  • A CNI plugin configures one interface per Pod; Multus calls several plugins, one per network, according to the k8s.v1.cni.cncf.io/networks annotation. Its 00-multus.conf file names Cilium as clusterNetwork: eth0 stays the main network, with the default route.
  • Cilium in cni.exclusive=true (the default) renames Multus's configuration to 00-multus.conf.cilium_bak, without any error: an annotated Pod starts Running with eth0 alone, an empty network-status and no event. The proof is ls -l /etc/cni/net.d on a node.
  • You set cni.exclusive=false with helm upgrade --reuse-values before installing Multus, and you read false in the cilium-config ConfigMap. Nodes that are already trapped are repaired in three steps: cni.exclusive=false, deletion of the kube-multus-ds Pod on each node where Cilium restarted (reading /etc/cni/net.d again on each), then workload Pods recreated.
  • A modified NAD only acts on Pods created afterwards: in mode: private, two Pods on the same node can no longer reach each other.
  • Multus's manifest at tag v4.3.2 deploys a moving image; you pin multus-cni:v4.3.2-thick@sha256:… and read multus-daemon --version.
  • A NetworkAttachmentDefinition belongs to a namespace and carries the plugin's CNI configuration, here macvlan with master and ipam static. The name of the master card changes from one machine to another: ip -br link gives it.
  • kubectl get pods -o wide only shows the main address; the two interfaces are read with ip -4 addr in the Pod and in the network-status annotation. An unknown network leaves the Pod in ContainerCreating, with a FailedCreatePodSandBox event.
  • The traffic of net1 does not go through Cilium: its network policies do not filter it. The mechanism intended for secondary networks is MultiNetworkPolicy, which its repository describes as "not stable yet".
  • macvlan gives each Pod its own MAC address: if two nodes cannot reach each other on net1, check that the hypervisor or the network does not drop unknown MAC addresses.

Knowledge check

Eight reading and diagnosis questions, drawn at random from eleven: the installation order, the proof of a renaming, Multus's pinned image, the silent failure of an annotated Pod, reading the two interfaces, the default route, a missing NAD, the effect of a Cilium network policy on net1 and that of mode: private.

Knowledge check

Check what you have learned with this interactive quiz

8 questions
8 min
70% to pass

How it works

  • The timer starts when you click Start
  • Multiple choice, true/false and short answer questions
  • You can move between questions
  • Detailed results are shown at the end

Starts the quiz and the timer