Mirantis / virtlet

Kubernetes CRI implementation for running VM workloads
Apache License 2.0
739 stars 128 forks source link

Make Virtlet work with newer Calico #912

Closed ivan4th-jenkins closed 4 years ago

ivan4th-jenkins commented 4 years ago

For now, only DHCP-based networking works for Calico. So, if your VM supports cloud-init, you must either set VirtletForceDHCPNetworkConfig: "true" annotation for it or add a script that will add a link-scoped route to 169.254.1.1 for the CNI-provided link, as well as the default route via 169.254.1.1.

The patch is inspired by kubevirt/kubevirt#1436 and removes the old scheme that was making a "fake pod", because it's no longer possible to create such "fake pods" in new versions of Calico (they always must correspond to a real pod).

The remaining difficulty is that it's apparently impossible to specify the link-scoped routes through cloud-init network config.

This PR also renames virtlet-eth0 to eth0, removing compatibility problems with some old CNI Genie versions.


This change is Reviewable

ivan4th-jenkins commented 4 years ago

Closed in favour of #913 (proper branch name ending with -net to run e2e for different CNIs)