{"action":"created","issue":{"url":"https://api.github.com/repos/weaveworks/weave/issues/2404","repository_url":"https://api.github.com/repos/weaveworks/weave","labels_url":"https://api.github.com/repos/weaveworks/weave/issues/2404/labels{/name}","comments_url":"https://api.github.com/repos/weaveworks/weave/issues/2404/comments","events_url":"https://api.github.com/repos/weaveworks/weave/issues/2404/events","html_url":"https://github.com/weaveworks/weave/issues/2404","id":162469636,"number":2404,"title":"populate DNS from CNI","user":{"login":"philwinder","id":8793723,"avatar_url":"https://avatars.githubusercontent.com/u/8793723?v=3","gravatar_id":"","url":"https://api.github.com/users/philwinder","html_url":"https://github.com/philwinder","followers_url":"https://api.github.com/users/philwinder/followers","following_url":"https://api.github.com/users/philwinder/following{/other_user}","gists_url":"https://api.github.com/users/philwinder/gists{/gist_id}","starred_url":"https://api.github.com/users/philwinder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philwinder/subscriptions","organizations_url":"https://api.github.com/users/philwinder/orgs","repos_url":"https://api.github.com/users/philwinder/repos","events_url":"https://api.github.com/users/philwinder/events{/privacy}","received_events_url":"https://api.github.com/users/philwinder/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/weaveworks/weave/labels/feature","name":"feature","color":"009800"},{"url":"https://api.github.com/repos/weaveworks/weave/labels/[component/dns]","name":"[component/dns]","color":"d4c5f9"},{"url":"https://api.github.com/repos/weaveworks/weave/labels/[component/plugin]","name":"[component/plugin]","color":"ccffff"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-06-27T14:45:50Z","updated_at":"2016-07-05T09:35:31Z","closed_at":null,"body":"The context of this issue involves Mesos, but the same reasoning should apply to k8s.\r\n\r\nWhen 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.\r\n\r\nHowever, 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` and `del`) we should be able to maintain the weave state manually.\r\n\r\nHence, I request that this functionality is added to the weave cni plugin.\r\n\r\n## Pseudocode \r\n\r\n```\r\nreceive and parse NetConf\r\ncreate and add ip address to network\r\nassign to container\r\n(*) populate weave DNS with container name and ip\r\n(*) populate any internal weave state so that `weave ps` correctly shows mesos containers.\r\n(*) return dns info in result packet (although probably not used by Mesos)\r\n```\r\n(*) = new.\r\n\r\n## DNS usage\r\n\r\nThen 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 to `task-name.weave.local` (or whatever comes through as the name in the CNI packet - visible in `weave ps`)\r\n\r\n## Caveats\r\n\r\nIf 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."},"comment":{"url":"https://api.github.com/repos/weaveworks/weave/issues/comments/230432039","html_url":"https://github.com/weaveworks/weave/issues/2404#issuecomment-230432039","issue_url":"https://api.github.com/repos/weaveworks/weave/issues/2404","id":230432039,"user":{"login":"bboreham","id":8125524,"avatar_url":"https://avatars.githubusercontent.com/u/8125524?v=3","gravatar_id":"","url":"https://api.github.com/users/bboreham","html_url":"https://github.com/bboreham","followers_url":"https://api.github.com/users/bboreham/followers","following_url":"https://api.github.com/users/bboreham/following{/other_user}","gists_url":"https://api.github.com/users/bboreham/gists{/gist_id}","starred_url":"https://api.github.com/users/bboreham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bboreham/subscriptions","organizations_url":"https://api.github.com/users/bboreham/orgs","repos_url":"https://api.github.com/users/bboreham/repos","events_url":"https://api.github.com/users/bboreham/events{/privacy}","received_events_url":"https://api.github.com/users/bboreham/received_events","type":"User","site_admin":false},"created_at":"2016-07-05T09:35:31Z","updated_at":"2016-07-05T09:35:31Z","body":"> is this a dup of #2056?\r\n\r\nThe '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."}}
{"actor":{"display_login":"bboreham"}}