hyperhq / runv

Hypervisor-based Runtime for OCI
Apache License 2.0
828 stars 129 forks source link

Join shim into nslistener network ns and end pod support #525

Closed WeiZhang555 closed 7 years ago

WeiZhang555 commented 7 years ago

runv shim should share same network namespace with nslistener, then if user try to insert an network interface into runv shim's netns, nslistener can observe the changes and copy the configure into VM.

Signed-off-by: Zhang Wei zhangwei555@huawei.com

WeiZhang555 commented 7 years ago

This is a replacement of https://github.com/hyperhq/runv/pull/523

WeiZhang555 commented 7 years ago
$ ps -ef | grep shim | grep runv
root     20653 28460  0 17:27 ?        00:00:00 docker-containerd-shim 26036710137bfa57b9521adc6a4f206ce9cd3e65292d0f56dfea71bdf18e1245 /var/run/docker/libcontainerd/26036710137bfa57b9521adc6a4f206ce9cd3e65292d0f56dfea71bdf18e1245 /usr/local/bin/runv
root     20836 20653  0 17:27 ?        00:00:00 runv --root /run/runv --log_dir /var/log/hyper/shim-26036710137bfa57b9521adc6a4f206ce9cd3e65292d0f56dfea71bdf18e1245 --debug --log /tmp/runv.log --log-format json shim --container 26036710137bfa57b9521adc6a4f206ce9cd3e65292d0f56dfea71bdf18e1245 --process init --proxy-exit-code --proxy-signal --proxy-winsize
$ sudo ls -l /proc/20836/ns/net
lrwxrwxrwx 1 root root 0 Jun 30 17:35 /proc/20836/ns/net -> net:[4026532302]
$ ps -ef | grep nslistener
root     20695 20666  0 17:27 ?        00:00:00 containerd-nslistener
zhangwei 21859  2224  0 17:35 pts/28   00:00:00 grep --color=auto nslistener
$ sudo ls -l /proc/20695/ns/net
lrwxrwxrwx 1 root root 0 Jun 30 17:27 /proc/20695/ns/net -> net:[4026532302]
WeiZhang555 commented 7 years ago

Append a new commit to enable POD support.

gnawux commented 7 years ago

@WeiZhang555 Having merged #537, do we still need this?

laijs commented 7 years ago

537 reuses your code (nsenter/) thanks. @WeiZhang555

537 does not include the support of --net container:xxx. please update it