Mirantis / virtlet

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

Default Gateway Route is not added on the VM incase of CNI-genie with canal network #803

Closed kannanvr closed 5 years ago

kannanvr commented 6 years ago

Hi, Default Route is not added on the VM, incase of CNI-genie with canal network We are facing the issue with virtlet when we launch the VM (cirros/ubuntu images) with CNI-genie-canal networking. VM can communicate within the node. It could not communicate across the node. It seems VM does not have default route. After adding the default route manually, it works fine. It needs to be fixed with virtlet. Following is the ip routes

10.244.2.0/24 dev eth0  src 10.244.2.78  metric 202

Following is the network config

10.244.2.0/24 dev eth0  src 10.244.2.78  metric 202
$ cat /mnt/^C
$ sudo mount /dev/sr0 /mnt
$ cat /mnt/network-config
version: 1
config:
- mac_address: ae:81:ae:a9:be:79
  mtu: 1500
  name: eth0
  subnets:
  - address: 10.244.2.78
    netmask: 255.255.255.0
    type: static
  type: physical
- destination: 0.0.0.0/0
  gateway: 169.254.1.1
  type: route
- address:
  - 10.96.0.10
  search:
  - customer-1.svc.cluster.local
  - svc.cluster.local
  - cluster.local
  - ipc3dev.com
  type: nameserver
$

After adding the following route manulay inside the VM, it works fine

sudo route add default gw 10.244.2.1 eth0
jellonek commented 6 years ago

To be more precise - that was tested on ubuntu? Cirros is not using this network-config file at all, and are you sure that it has the same lack of routes? (it should receive default route from dhcp).

kannanvr commented 6 years ago

i have tested on ubuntu and cirros. We are facing the similar issue... Ubuntu image -> http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img cirros image -> https://github.com/mirantis/virtlet/releases/download/v0.9.3/cirros.img

I am sure that this issue happened due to lack of default gateway.... If i added the default gateway manually within the VM, then it starts working fine and able to communicate across the nodes.

We used the below command to add the default gateway

sudo route add default gw 10.244.2.1 eth0

Following is the pod IP and the Host names

vm-customer-1-566447cd8-2ff8b      1/1     Running   0          5m24s   10.244.2.79    server-f2-29.ipc3dev.com   <none>
vm-customer-1-566447cd8-fklck      1/1     Running   0          5m24s   10.244.1.151   server-f2-77.ipc3dev.com   <none>

Following is the uname output from VM

Linux vm-customer-1-566447cd8-fklck 4.4.0-139-generic #165-Ubuntu SMP Wed Oct 24 10:58:50 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

IP route info

testuser@vm-customer-1-566447cd8-fklck:~$ ip r
10.244.1.0/24 dev eth0  proto kernel  scope link  src 10.244.1.151

You could observe that there is no default route

Kindly let me know if you need any further info

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.