How to Connect VMs to an External L2 Network Using KubeVirt?

0
17
Asked By CuriousCoder42 On

I'm currently exploring whether a K8s cluster running on Talos Linux can replace our OpenStack environment since we only need a VM orchestrator, and we're looking to containerize our infrastructure. KubeVirt seems like a promising solution for us.

I'm trying to mimic OpenStack-style networking for VMs with Open vSwitch, utilizing Kube-OVN alongside Multus to connect the VMs to an external network that's L2 connected to my cluster nodes. This external network is managed on an Arista MLAG pair.

I've followed various guides related to Kube-OVN and set up some configurations, including provider networks and subnets:
- Created a ProviderNetwork named "network-prod" using bond0.1204
- Established a Subnet named "subnet-prod" with a specified CIDR and gateway
- Defined a VLAN named "vlan-prod"

Then, I created a NetworkAttachmentDefinition (NAD) linking to the above provider network. Everything seems to be in order as all components are in a READY state.

However, upon creating a VM, the Multus NIC is getting an IP from the Kube-OVN pod CIDR instead of my defined network. This is evident from the annotations that show the incorrect CIDR. Am I missing something here? Has anyone successfully connected VMs to an external L2 network using KubeVirt, or is there a better way to achieve what I want?

1 Answer

Answered By NinjaNetworker99 On

It looks like you might need to specify the provider in a specific way. Try using the format [name].[namespace of the NAD] for the provider in all relevant fields. That could help ensure the VM grabs an IP from your specified network instead of the default setup.

CuriousCoder42 -

Thanks for the tip! I tried that, but now I'm running into a different issue. I'm getting an error when creating the pod sandbox that says, "failed to setup network for sandbox... no address allocated to pod..." Do you have any ideas on what to check next?

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.