networkop / meshnet-cni

a (K8s) CNI plugin to create arbitrary virtual network topologies
BSD 3-Clause "New" or "Revised" License
116 stars 27 forks source link

Error while adding MacVlan/VxLAN Interface #18

Closed vparames86 closed 4 years ago

vparames86 commented 4 years ago

I keep getting an error while creating a POD and using the meshnet cni.

Warning FailedCreatePodSandBox 21m kubelet, k8s-agentpool1-40367033-vmss000001 Failed create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "2d6c4d562a8f7438450ebb390d56bf0617e18371485f54c99c1a02422a62be13" network for pod "testdevice02": NetworkPlugin cni failed to set up pod "testdevice02_default" network: Cannot add IPaddr/netns failed: failed to rename link koko2610346067 -> eth0: file exists

This error seems to be coming from the koko library in function "SetVethLink". I see this function getting invoked at three places in the library in "MakeVxLan", "MakeVLan" & "MakeMacVlan". In one of the functions they call. if err = veth1.SetVethLink(link); err != nil { netlink.LinkDel(link) return fmt.Errorf("Cannot add IPaddr/netns failed: %v", err) } but at other places I don't see the highlighted code.

I notice this error while I delete a topology and try to re-deploy the same again. I guess something is getting messed up during deleting a link and it ends up remaining stale.

networkop commented 4 years ago

it seems like you're trying to create interface eth0? this interface is always created by the master plugin, you won't be able to change it with meshnet. try doing the same for eth1 or eth2.