No declarative bridge binding to the node (sub)interface when using Multus bridge CNI plugin

Summary

Using a pod with several interfaces (Multus) and a bridge CNI plugin, the network attachment is defined through the NetworkAttachmentDefinition

apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: bridge-host-local
  namespace: test-multus

spec:
  config: '{
    "cniVersion": "0.3.0",
    "type": "bridge",
    "bridge": "br0",
    "ipam": {}  
  }'

This resource will be associated to the pod through an annotation annotations: k8s.v1.cni.cncf.io/networks: bridge-host-local and will result to the bridge br0 creation and binding to the pod secondary interface however there is no declarative way to declare and apply automatically the bridge binding to a node interface or VLAN sub-interface.

One way could be the use of nmstate but it is designed to rely on networkmanager which is not supported by every OS (e.g. SLES).

related references

Declarative Network API | nmstate

Details

Edited Sep 04, 2024 by Gurvan Moal
Assignee Loading
Time tracking Loading