multus-cni icon indicating copy to clipboard operation
multus-cni copied to clipboard

tap plugin fails to detect existing bridge

Open EugenMayer opened this issue 5 months ago • 1 comments

What happend: trying to configure a tap based network for an existing bridge

Configuring network (in namespace multus)

       {
            "name": "iot-tap",
            "cniVersion": "0.3.1",
            "type": "tap",
            "mtu": 1440,
            "multiQueue": true,
            "bridge": "br0",
            "owner": 0,
	          "group": 0
          }

configuring pod

        k8s.v1.cni.cncf.io/networks: '[
          {
          "name": "iot-tap",
          "namespace": "multus",
          "ips": ["10.10.12.100/24"],
          "interface": "iot"
          }]'

or with a simple k8s.v1.cni.cncf.io/networks: 'multus/iot-tap'

in both cases, i get an error

"255d8cbde874ffe335a0cde86fe8e0988b4f248dd63be8144e16de5c85fc36c4": plugin type="multus" name="multus-cni-network" failed (add): [network-tools1/network-tools-85c6846fbb-thlt6/47f0757a-914d-4e86-89de-50872fc16fdc:iot-tap]: error adding container to network "iot-tap": failed to get bridge br0: Link not found

while on the host

ip a show br0
4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1440 qdisc noqueue state UP group default qlen 1000
    link/ether 9e:af:84:89:ea:8c brd ff:ff:ff:ff:ff:ff
    inet 10.10.12.11/24 scope global br0
       valid_lft forever preferred_lft forever
bridge link
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1440 master br0 state forwarding priority 32 cost 100 

What you expected to happen: a tap based network interface should be added to the pod

How to reproduce it (as minimally and precisely as possible):

  • create a bridge on your host
ip link add name br0 type bridge
ip link set dev br0 up
ip link set dev eth1 master br0
ip address add 10.10.12.11/24 dev br0
ip route append default via 10.10.12.1 dev br0

Create the network / pod annotation as desribed above

Anything else we need to know?:

Environment:

  • Multus version 0.3.1 (rancher/hardened-cni-plugins:v1.4.0-build20240122)
  • Kubernetes version (use kubectl version):
Client Version: v1.29.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.29.2+k3s1
  • Primary CNI for Kubernetes cluster: calico
  • OS (e.g. from /etc/os-release): ubuntu jammy
  • File of '/etc/cni/net.d/'
{
        "cniVersion": "0.3.1",
        "name": "multus-cni-network",
        "type": "multus",
        "capabilities": {"bandwidth":true,"portMappings":true},
        "kubeconfig": "/etc/cni/net.d/multus.d/multus.kubeconfig",
        "delegates": [
                {"cniVersion":"0.3.1","name":"k8s-pod-network","plugins":[{"container_settings":{"allow_ip_forwarding":true},"datastore_type":"kubernetes","ipam":{"assign_ipv4":"true","assign_ipv6":"false","type":"calico-ipam"},"kubernetes":{"k8s_api_root":"https://10.43.0.1:443","kubeconfig":"/etc/cni/net.d/calico-kubeconfig"},"log_file_max_age":30,"log_file_max_count":10,"log_file_max_size":100,"log_file_path":"/var/log/calico/cni/cni.log","log_level":"Info","mtu":0,"nodename_file_optional":false,"policy":{"type":"k8s"},"type":"calico"},{"capabilities":{"bandwidth":true},"type":"bandwidth"},{"capabilities":{"portMappings":true},"snat":true,"type":"portmap"}]}
        ]
}
  • File of '/etc/cni/multus/net.d'
  • NetworkAttachment info (use kubectl get net-attach-def -o yaml)
kubectl get net-attach-def -o yaml
apiVersion: v1
items: []
kind: List
metadata:
  resourceVersion: ""

EugenMayer avatar Mar 17 '24 19:03 EugenMayer