-
Notifications
You must be signed in to change notification settings - Fork 70
How to make dockershim support clear containers? #987
Comments
cc @egernst @miaoyq I think we're looking at a couple of potential solutions here:
Solution #2 is obviously the most appealing to us, as #1 would be quite disruptive for CC in general. |
@sameo Thanks for providing the potential solutions
The third solution doesn't work, since the network of sandbox is set up by The second solution may be the best one. I will also try to seek better ways to get the sandbox IP on dockershim side. |
@egernst Yeah. |
@miaoyq There already is a per pod map in the |
@sameo Yeah, it's a good idea. |
@sameo Today, I ran a container via In dockershim, the pid of container is used to get the Could we get the pid of |
@miaoyq we actually don't want to provide the pid of the qemu process since this is related to the pod and not to the container itself. Please open an issue on virtcontainers repo for that, so that we can discuss further on this. |
Thanks @sboeuf, I also think it's reasonable to run shim in container network namespace. :) |
I think I have got the answer in containers/virtcontainers#241. |
Recently I was trying to make dockershim support cc, and found that dockershim supporting cc need to meet the following conditions at least:
Annotation
that clear containers need.dockershim have provided this info in Label` field of docker container struct.
Label
of docker container toAnnotations
of OCI runtime spec.I have sent a pr to moby project about this, see: moby/moby/pull/36181
The annotations(labels) are defined as private fields in dockershim and can't be referenced by virtcontainer. So I only modify the codes locally for testing.
The IP address of the veth device that is create by cni plugin will be remove when cc-runtime create a tap device linked to the veth device. So we must create the network namespace and get the IP address of the veth before creating the sandbox container with the existing network namespace, just like this issue description in cri-containerd. However, docker does not provide an interface for using existing network namespace to create containers, we must use the namespace created by docker, so we can't get the IP via cni plugin after setting up the network since the IP of veth have been removed. This is the main obstruction point for me at present.
After modifying the code corresponding to the first three conditions, and compiling codes of each component and setting up the k8s cluster, I could create the pod successfully but the network of pod could not be set up correctly. I do not know whether it is related to conditions, expect to get help here. Thanks!
@sameo @plutoinmii
/cc @guangxuli
The text was updated successfully, but these errors were encountered: