contiv / netplugin

Container networking for various use cases
Apache License 2.0
512 stars 177 forks source link

k8splugin support manager_networkmanage_network_ns_lifecycle=true from CRI-O #1153

Open newtonjose opened 5 years ago

newtonjose commented 5 years ago

Description of the changes

Type of fix:

Bug fix

Fixes #

1054.

Please describe:

When, the runtime send the pid process the operation inside the container is permitted, but when is the path of network namespace I have problems to exec same operation I get the error: RTNETLINK answers: Invalid argument, exit status 2

This is result inside the container contiv-netplugin running on k8s

ls -lha /var/run/netns/

rw-r--r- 1 root root 0 Aug 9 18:41 cni-d5e070e5-08c4-46f0-96ee-4bb5e6c6e21a
lrwxrwxrwx 1 root root 55 Aug 9 18:41 k8s_contiv-blue-c1_default_01bc671d-9a69-11e8-a90e-000af70485d0_1-81a93eff -> /var/run/netns/cni-d5e070e5-08c4-46f0-96ee-4bb5e6c6e21a

So, the k8s_cni is part of the contivk8s plugin execute on the host.

I make some test to try maintain the logical on ./netplugin\mgmtfn\k8splugin\driver.go but no success. I made some logical modifications to contiv run over buth net path. Some problems of permission on container, I can't execute the operation on the mounted path and that force me send part of the code to k8s_cni.go code.

Modifications:

TODO

kannanvr commented 5 years ago

I am also facing the similar problem. Can you please merge this code changes if it is OK

newtonjose commented 5 years ago

On this branch https://github.com/n3wt0nSAN/netplugin/tree/suport_manage_network_ns_lifecycle, the issue is fixed. But you need create a new docker image of netplugin. And change the contiv.yaml description for kubernetes. This is my personal image with the new code: newton001/netplugin:test