Mirantis / virtlet

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

Inserting network routes in VM #872

Closed ritusood closed 5 years ago

ritusood commented 5 years ago

When running a virtlet VM with 3 interfaces (virtlet-eth0: 10.233.64.221/24, net0:172.16.44.2/24 and net1:10.40.11.5/24) and inserting routes in VM by populating the Route structure in CNI Result like below: https://github.com/containernetworking/cni/blob/137b4975ecab6e1f0c24c1e3c228a50a3cfba75e/pkg/types/current/types.go#L139

"routes ": [ { "dst ": "10.30.11.0/24 ", "gw ": "172.16.44.3 " }, { "dst ": "0.0.0.0/0 ", "gw ": "10.40.11.4 " }, { "dst ": "172.16.33.0/24 ", "gw ": "172.16.44.3 " } ] Only the default route from the structure gets added to the VM.

[ 97.788812] cloud-init[950]: ci-info: ++++++++++++++++++++++++++++++Route IPv4 info++++++++++++++++++++++++++++++ [ 97.881958] cloud-init[950]: ci-info: +-------+-------------+------------+---------------+--------------+-------+ [ 97.955834] cloud-init[950]: ci-info: | Route | Destination | Gateway | Genmask | Interface | Flags | [ 98.016952] cloud-init[950]: ci-info: +-------+-------------+------------+---------------+--------------+-------+ [ 98.077712] cloud-init[950]: ci-info: | 0 | 0.0.0.0 | 10.40.11.4 | 0.0.0.0 | net1 | UG | [ 98.141931] cloud-init[950]: ci-info: | 1 | 10.40.11.0 | 0.0.0.0 | 255.255.255.0 | net1 | U | [ 98.213413] cloud-init[950]: ci-info: | 2 | 10.233.64.0 | 0.0.0.0 | 255.255.255.0 | virtlet-eth0 | U | [ 98.288347] cloud-init[950]: ci-info: | 3 | 172.16.44.0 | 0.0.0.0 | 255.255.255.0 | net0 | U | [ 98.447516] cloud-init[950]: ci-info: +-------+-------------+------------+---------------+--------------+-------+

Related question is that is there a way of inserting routes into running VM using the namespace of the VM running with virtlet.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.