Open philwinder opened 8 years ago
How would CNI get hold of the container name? I don't think it's part of the 'add' request.
(*) populate any internal weave state so that
weave ps
correctly shows mesos containers.
Please raise a separate issue for that. It is completely orthogonal to the DNS issue.
How would CNI get hold of the container name? I don't think it's part of the 'add' request.
Container ID is, and from there one can get to anything else via the Docker API
Container ID is, and from there one can get to anything else via the Docker API
Can one? ...
it is not a process and/or a docker container. It is a self contained, isolated namespace and therefore not visible to the external process.
OK, then it would be up to Mesos to pass in the necessary information as 'extra arguments' within the CNI spec.
it would be up to Mesos to pass in the necessary information as 'extra arguments' within the CNI spec
@philwinder does it?
@bboreham is this a dup of #2056?
is this a dup of #2056?
The 'DNS usage' part of this issue is in the same territory. #2056 notes that K8s does not (yet) respect the DNS info; this issue suggests that we unilaterally override what Mesos puts in place. It would be better to have an agreed handshake with Mesos.
The context of this issue involves Mesos, but the same reasoning should apply to k8s.
When creating a unified Mesos container (Docker or simple process) with CNI support, Mesos will submit an
add
request to the Weave CNI plugin. The plugin then correctly assigns an IP address, and that address is added to the weave network.However, weave DNS and
weave ps
does not know about this container, because it is not a process and/or a docker container. It is a self contained, isolated namespace and therefore not visible to the external process. But this should not matter. Since we receive state updates from the CNI request (i.e.add
anddel
) we should be able to maintain the weave state manually.Hence, I request that this functionality is added to the weave cni plugin.
Pseudocode
(*) = new.
DNS usage
Then for Mesos (and probably k8s) we can edit
/etc/resolve.conf
to use the local weave DNS server as the nameserver and everyone can just refer totask-name.weave.local
(or whatever comes through as the name in the CNI packet - visible inweave ps
)Caveats
If the CNI source also uses the standard user-space docker daemon, weave dns may pick up the container from the standard docker plugin. We could disable the docker plugin in this case, or prefix the received container names with
cni-
or put them on a different domain*.weave-cni.local
or something.