k8snetworkplumbingwg / multus-cni

A CNI meta-plugin for multi-homed pods in Kubernetes
Apache License 2.0
2.29k stars 575 forks source link

tap plugin fails to detect existing bridge #1247

Closed EugenMayer closed 3 weeks ago

EugenMayer commented 4 months ago

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):

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:

dougbtv commented 4 months ago

This should also probably filed against https://github.com/containernetworking/plugins

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.