Create bridge on node:
# this step is needed so that the bridge would forward traffic
sudo echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
sudo sysctl -p
# create the bridge
sudo ip link add red type bridge
sudo ip link set dev red up
# connect the bridge to an interface where to which the PXE server is also connected
# note that this interface should not have an IP address or configured to use DHCP
sudo ip link set eth1 master red
ip link show red
Create device plugin with its configuration:
kubectl create configmap device-plugin-network-bridge --from-literal=bridges="red"
kubectl create -f https://raw.githubusercontent.com/kubevirt/kubernetes-device-plugins/master/manifests/bridge-ds.yml
Create a yaml with the VMI configuration. Note that it has 2 interface, the default one from the pod and another L2 one from the device plugin: https://gist.github.com/yuvalif/32ef18bd8cff2961d138b149983a1b9a
Create a VM connected to the "red" bridge:
wget https://gist.githubusercontent.com/yuvalif/32ef18bd8cff2961d138b149983a1b9a/raw/b083cd2b638b06c956a880789da6c04a2659ad94/vmi-bridge.yaml
kubectl create -f vmi-bridge.yaml
Wait for the launcher pod to start and use vnc to get the PXE boot screen:
virtctl vnc vmi-bridge