Open miaoyq opened 6 years ago
Hi @miaoyq - can you please give us at least the exact commands you executed?
It might also help to speed things up if you ran the cc-collect-data.sh
and attach the output as requested in the Issue report template.
thanks.
@grahamwhaley Thanks for your reply, have updated, expect to get your help. :-)
Thanks @miaoyq - can you explain what you did (which commands do you run) when you say 'when I create a pod' ? How do you create a pod, which docker commands do you run, can you tell how your network is broken? Just for reference, one way I know to 'break' the host network with CC is to use the --net=host option (as listed here: https://github.com/clearcontainers/runtime/blob/master/docs/limitations.md#docker---nethost).
/cc @amshinde @chavafg for any thoughts (especially if this might be swarm and docker version related etc.)
@grahamwhaley I create a container via docker run -ti -d busybox top
, successful.
# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 52:54:00:78:88:4e brd ff:ff:ff:ff:ff:ff
inet 192.168.122.198/24 brd 192.168.122.255 scope global dynamic ens6
valid_lft 3497sec preferred_lft 3497sec
inet6 fe80::aacb:be64:e387:3820/64 scope link
valid_lft forever preferred_lft forever
3: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 52:54:00:5b:ff:df brd ff:ff:ff:ff:ff:ff
inet 172.120.0.216/24 brd 172.120.0.255 scope global ens3
valid_lft forever preferred_lft forever
inet6 fe80::5054:ff:fe5b:f6df/64 scope link
valid_lft forever preferred_lft forever
4: br-0a7129f645d4: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:c4:9c:4c:00 brd ff:ff:ff:ff:ff:ff
inet 172.18.0.1/16 scope global br-0a7129f645d4
valid_lft forever preferred_lft forever
5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:43:8e:39:d3 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 scope global docker0
valid_lft forever preferred_lft forever
6: docker_gwbridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:05:0b:d8:cb brd ff:ff:ff:ff:ff:ff
inet 172.19.0.1/16 scope global docker_gwbridge
valid_lft forever preferred_lft forever
inet6 fe80::42:5ff:fe0b:d8cb/64 scope link
valid_lft forever preferred_lft forever
... ...
But I create a pod via kubectl create -f myapp.yaml
, failed
# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
4: br-0a7129f645d4: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:c4:9c:4c:00 brd ff:ff:ff:ff:ff:ff
inet 172.18.0.1/16 scope global br-0a7129f645d4
valid_lft forever preferred_lft forever
5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:43:8e:39:d3 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 scope global docker0
valid_lft forever preferred_lft forever
6: docker_gwbridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:05:0b:d8:cb brd ff:ff:ff:ff:ff:ff
inet 172.19.0.1/16 scope global docker_gwbridge
valid_lft forever preferred_lft forever
inet6 fe80::42:5ff:fe0b:d8cb/64 scope link
valid_lft forever preferred_lft forever
Related log: syslog.txt
ping @amshinde @chavafg Could you help me and give some guidance advice for this scenario? tks :)
Hi @miaoyq - I have a feeling some folks are still on vacation until Monday maybe. There is a relevant Issue filed over on #890 though I believe - looks like an image update broke some of the k8s networking - we are working on a revert/fix/release at the moment... /cc @jcvenegas
@miaoyq I'd like some clarifications on your issue here. You're saying that creating a pod with k8s, using the command kubectl create -f myapp.yaml
, messes the network on your host system ??
So basically you run ip addr
on your host before to run k8s and if you run it after you've started the pod, you have a different network result ?
Or is it what you see from the guest OS ?
Also, have you tried with runc
? Is it really tied to Clear Containers ?
@miaoyq I'd like some clarifications on your issue here. You're saying that creating a pod with k8s, using the command kubectl create -f myapp.yaml, messes the network on your host system ?? So basically you run ip addr on your host before to run k8s and if you run it after you've started the pod, you have a different network result ?
@sboeuf Yes.
Or is it what you see from the guest OS ?
Yes.
Also, have you tried with runc ? Is it really tied to Clear Containers ?
It's ok with runc
, but once switch to cc-runtime
, ens3
and ens6
will be removed when create the first pod.
@miaoyq what is network configuration you are using for k8s?
@mcastelino @sameo @sboeuf to me looks like the host net interfaces are in the namespace where the container is running. I remember an old behivor for old cc-oci-runtime 2.x when using host networking would result in a similar issue.
@miaoyq what is network configuration you are using for k8s?
@jcvenegas Sorry, I am not very familiar with network,how can I find the network configuration?
@jcvenegas
# ifconfig
br-0a7129f645d4 Link encap:Ethernet HWaddr 02:42:c4:9c:4c:00
inet addr:172.18.0.1 Bcast:0.0.0.0 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
docker0 Link encap:Ethernet HWaddr 02:42:43:8e:39:d3
inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::42:43ff:fe8e:39d3/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:577 errors:0 dropped:0 overruns:0 frame:0
TX packets:792 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:61389 (61.3 KB) TX bytes:71021 (71.0 KB)
docker_gwbridge Link encap:Ethernet HWaddr 02:42:05:0b:d8:cb
inet addr:172.19.0.1 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::42:5ff:fe0b:d8cb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:217 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:20546 (20.5 KB)
ens3 Link encap:Ethernet HWaddr 52:54:00:5b:ff:df
inet addr:172.120.0.216 Bcast:172.120.0.255 Mask:255.255.255.0
inet6 addr: fe80::5054:ff:fe5b:f6df/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:37590 errors:0 dropped:0 overruns:0 frame:0
TX packets:40739 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2731653 (2.7 MB) TX bytes:50139747 (50.1 MB)
ens6 Link encap:Ethernet HWaddr 52:54:00:78:88:4e
inet addr:192.168.122.198 Bcast:192.168.122.255 Mask:255.255.255.0
inet6 addr: fe80::aacb:be64:e387:3820/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:325752 errors:0 dropped:7791 overruns:0 frame:0
TX packets:80380 errors:0 dropped:0 overruns:0 carrier:0
collisions:401503 txqueuelen:1000
RX bytes:442248758 (442.2 MB) TX bytes:6978533 (6.9 MB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:2187033 errors:0 dropped:0 overruns:0 frame:0
TX packets:2187033 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:957439371 (957.4 MB) TX bytes:957439371 (957.4 MB)
@miaoyq where are you running your command ? From the shell of your container or from a shell on your host ?
@sboeuf On my host.
Ok then we have to investigate this. More questions:
ens3
and ens6
on your system ?ens3
and ens6
are used to connect other host in subnet, and connect to the Internet.
I have to restart my system
This is the related log (syslog.txt) when I created a pod.
@grahamwhaley @jcvenegas @sboeuf Thank you very much for your help, I think I should go to sleep, continue tomorrow :-)
@miaoyq just to clarify I assume this is your setup
If you are doing this, it will not work.
The reason is that the the kubernetes network plugins run with --net=host. As kubernetes will use whatever is the default runtime to run the PODs, this will result in the use of cc-runtime as runtime used by kubernetes (via docker) to launch PODs.
As cc-runtime does not support --net=host it will result in loss of network connectivity.
So you have two options
Change the docker default runtime to runc and then use k8s+docker
Use crio-o to setup k8s and continue to use docker with cc-runtime as the default.
We have documented that limitation here:
@miaoyq just to clarify I assume this is your setup
Docker setup with the default runtime of docker set to cc-runtime Normal docker usage works properly You now use docker with kubernetes to setup a k8s environment on the same machine
@mcastelino It fits well with your analysis, Thanks so much. :) I must setup CRI-O currently If I want to use cc-runtime in k8s, right? BTW, will cc or Kate-containers support k8s with docker?
@miaoyq
I must setup CRI-O currently If I want to use cc-runtime in k8s, right?
Yes
BTW, will cc or Kate-containers support k8s with docker?
When we support cri-containerd that is a possibility.
We have documented that limitation here:
https://github.com/clearcontainers/runtime/blob/master/docs/limitations.md#docker---nethost
@jodh-intel Thanks, I think I should study the document seriously.
@mcastelino Thanks so much. :-)
The reason is that the the kubernetes network plugins run with --net=host. As kubernetes will use whatever is the default runtime to run the PODs, this will result in the use of cc-runtime as runtime used by kubernetes (via docker) to launch PODs.
As cc-runtime does not support --net=host it will result in loss of network connectivity.
Hi @mcastelino @jodh-intel,
I still have a bit confused about above, that kubelet create pause
container with --net=none
by default as far as I know, and the network of app container isn't set by docker but by cni plugin. The problem is how the plugin run with --net=host
?
@mcastelino @jodh-intel @sboeuf @jcvenegas That's also what i want to know, do we miss something?
@miaoyq
BTW, will cc or Kate-containers support k8s with docker?
cc or kata will not work with the docker CRI shim (dockershim) that's currently used by kubelet as its default CRI. But it will work with:
When using dockershim, you will not be able to start and run any privileged container that requires host networking namespace access (i.e. --net=host
) and you will most likely end up creating one VM per container as opposed to one VM per pod for cri-containerd, CRI-O and Frakti. That also will create networking issues.
@sameo Thanks for your detailed explanation :-)
Description of problem
In my host(VM), docker+cc works well, I can create container noemally. But my host network is broken, when I create a pod.
Execute command like:
The content of
myapp.yaml
:after executing this cmd, my host network is broken.
Expected result
(replace this text with an explanation of what you thought would happen)
Actual result
(replace this text with details of what actually happened)
cc-collect-data.sh
Meta details
Running
cc-collect-data.sh
version3.0.12 (commit d9f04c9)
at2018-01-03.21:33:31.355704102
.Runtime is
/usr/bin/cc-runtime
.cc-env
Output of "
/usr/bin/cc-runtime cc-env
":Runtime config files
Runtime default config files
Runtime config file contents
Config file
/etc/clear-containers/configuration.toml
not found Output of "cat "/usr/share/defaults/clear-containers/configuration.toml"
":Logfiles
Runtime logs
No recent runtime problems found in system journal.
Proxy logs
No recent proxy problems found in system journal.
Shim logs
No recent shim problems found in system journal.
Container manager details
Have
docker
Docker
Output of "
docker info
":Have
kubectl
Kubernetes
Output of "
kubectl config view
":Packages
Have
dpkg
Output of "dpkg -l|egrep "(cc-proxy|cc-runtime|cc-shim|clear-containers-image|linux-container|qemu-lite|qemu-system-x86|cc-oci-runtime)"
":No
rpm