{"action":"created","issue":{"url":"https://api.github.com/repos/moby/moby/issues/32981","repository_url":"https://api.github.com/repos/moby/moby","labels_url":"https://api.github.com/repos/moby/moby/issues/32981/labels{/name}","comments_url":"https://api.github.com/repos/moby/moby/issues/32981/comments","events_url":"https://api.github.com/repos/moby/moby/issues/32981/events","html_url":"https://github.com/moby/moby/pull/32981","id":225866861,"number":32981,"title":"Support swarm-mode services with node-local networks","user":{"login":"aboch","id":10080882,"avatar_url":"https://avatars2.githubusercontent.com/u/10080882?v=3","gravatar_id":"","url":"https://api.github.com/users/aboch","html_url":"https://github.com/aboch","followers_url":"https://api.github.com/users/aboch/followers","following_url":"https://api.github.com/users/aboch/following{/other_user}","gists_url":"https://api.github.com/users/aboch/gists{/gist_id}","starred_url":"https://api.github.com/users/aboch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aboch/subscriptions","organizations_url":"https://api.github.com/users/aboch/orgs","repos_url":"https://api.github.com/users/aboch/repos","events_url":"https://api.github.com/users/aboch/events{/privacy}","received_events_url":"https://api.github.com/users/aboch/received_events","type":"User","site_admin":false},"labels":[{"id":308856530,"url":"https://api.github.com/repos/moby/moby/labels/docs/revisit","name":"docs/revisit","color":"000000","default":false},{"id":237472255,"url":"https://api.github.com/repos/moby/moby/labels/impact/api","name":"impact/api","color":"bfe5bf","default":false},{"id":237472270,"url":"https://api.github.com/repos/moby/moby/labels/impact/changelog","name":"impact/changelog","color":"bfe5bf","default":false},{"id":450032382,"url":"https://api.github.com/repos/moby/moby/labels/impact/documentation","name":"impact/documentation","color":"bfe5bf","default":false},{"id":175375598,"url":"https://api.github.com/repos/moby/moby/labels/status/4-merge","name":"status/4-merge","color":"d4c5f9","default":false}],"state":"closed","locked":false,"assignee":{"login":"cpuguy83","id":799078,"avatar_url":"https://avatars0.githubusercontent.com/u/799078?v=3","gravatar_id":"","url":"https://api.github.com/users/cpuguy83","html_url":"https://github.com/cpuguy83","followers_url":"https://api.github.com/users/cpuguy83/followers","following_url":"https://api.github.com/users/cpuguy83/following{/other_user}","gists_url":"https://api.github.com/users/cpuguy83/gists{/gist_id}","starred_url":"https://api.github.com/users/cpuguy83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpuguy83/subscriptions","organizations_url":"https://api.github.com/users/cpuguy83/orgs","repos_url":"https://api.github.com/users/cpuguy83/repos","events_url":"https://api.github.com/users/cpuguy83/events{/privacy}","received_events_url":"https://api.github.com/users/cpuguy83/received_events","type":"User","site_admin":false},"assignees":[{"login":"cpuguy83","id":799078,"avatar_url":"https://avatars0.githubusercontent.com/u/799078?v=3","gravatar_id":"","url":"https://api.github.com/users/cpuguy83","html_url":"https://github.com/cpuguy83","followers_url":"https://api.github.com/users/cpuguy83/followers","following_url":"https://api.github.com/users/cpuguy83/following{/other_user}","gists_url":"https://api.github.com/users/cpuguy83/gists{/gist_id}","starred_url":"https://api.github.com/users/cpuguy83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpuguy83/subscriptions","organizations_url":"https://api.github.com/users/cpuguy83/orgs","repos_url":"https://api.github.com/users/cpuguy83/repos","events_url":"https://api.github.com/users/cpuguy83/events{/privacy}","received_events_url":"https://api.github.com/users/cpuguy83/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/moby/moby/milestones/69","html_url":"https://github.com/moby/moby/milestone/69","labels_url":"https://api.github.com/repos/moby/moby/milestones/69/labels","id":2444280,"number":69,"title":"17.06.0","description":"","creator":{"login":"vieux","id":1032519,"avatar_url":"https://avatars3.githubusercontent.com/u/1032519?v=3","gravatar_id":"","url":"https://api.github.com/users/vieux","html_url":"https://github.com/vieux","followers_url":"https://api.github.com/users/vieux/followers","following_url":"https://api.github.com/users/vieux/following{/other_user}","gists_url":"https://api.github.com/users/vieux/gists{/gist_id}","starred_url":"https://api.github.com/users/vieux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vieux/subscriptions","organizations_url":"https://api.github.com/users/vieux/orgs","repos_url":"https://api.github.com/users/vieux/repos","events_url":"https://api.github.com/users/vieux/events{/privacy}","received_events_url":"https://api.github.com/users/vieux/received_events","type":"User","site_admin":false},"open_issues":20,"closed_issues":335,"state":"open","created_at":"2017-04-07T23:27:32Z","updated_at":"2017-06-13T09:16:44Z","due_on":null,"closed_at":null},"comments":59,"created_at":"2017-05-03T01:47:59Z","updated_at":"2017-06-13T18:21:30Z","closed_at":"2017-05-18T01:43:07Z","pull_request":{"url":"https://api.github.com/repos/moby/moby/pulls/32981","html_url":"https://github.com/moby/moby/pull/32981","diff_url":"https://github.com/moby/moby/pull/32981.diff","patch_url":"https://github.com/moby/moby/pull/32981.patch"},"body":"This PR makes changes to support creating swarm networks with macvlan driver, or with any other local datascope driver ~~capable of creating multihost networks~~. Edit: Now also over the default `bridge` and `host` networks.\r\n\r\nSee #27082 \r\n\r\nIf the network driver is also capable of creating networks which provide connectivity across hosts (as macvlan driver for example), then the service discovery will be provided as it is done for global datascope drivers like overlay.\r\n\r\nIn order to achieve that, it adds three new flags to the network create API: ~~`multihost`~~ `scope=swarm`, `config-only`, `config-from`.\r\n\r\nWhile a global datascope driver network is by default created as a swarm network (see overlay nw as example), we need an option to make a local scope driver network creation a swarm network creation.\r\n~~`multihost`~~ `scope=swarm` option is for that. This is needed to ensure both regular and swarm networks from the same driver can coexist. \r\n\r\nEdit: Note: I am now thinking this flag should be renamed `multihost` --> `scope=swarm` as its actual semantic is \"I want this network to be a swarm visible network\"\r\n\r\nFor local datascope driver networks, resource allocation has to happen on the host, it cannot happen in the swarm manager, because the resources are tied to the underlay network and/or (as for macvlan) to the host network interfaces, so they are different in each swarm node. Once the dynamic swarm network creation request is sent to libnetwork, libnetwork on each swarm node needs to know from where to pick the local scope (therefore node specific) configuration for the network.\r\n\r\nThis is fine for simple local scope single host driver networks, which do not require specific configurations and are fine with the default IPAM resources. But for local scope, multihost capable driver networks, there is a need to provide a global identification of the docker network across the swarm nodes, being a multihost network entity, besides the need for host specific network configurations, like the parent interface for macvlan networks for example.\r\n\r\nIn order to solve this, user is given the ability to create `config-only` networks which contain network specific configurations on each host. This kind of network is saved to store but no allocation or plumbing is attempted for it. The `config-from` option comes to play when the client creates the swarm network and wants to specify which configuration network will provide the node local network specific configurations.\r\n\r\nNow user can create a, say, macvlan swarm network toward the swarm manager specifying that the configuration information comes from another network which will be present on the nodes, with\r\n\r\n```\r\ndocker network create -d macvlan --scope=swarm --config-from mv-config swarm-mv-nw\r\n```\r\nafter he has created the config networks on the swarm nodes with:\r\n\r\n```\r\nnode1# docker network create --config-only --subnet 192.168.10.0/24 --gateway 192.168.10.1 --opt parent=enp8s0 --macvlan_mode=bridge mv-conf\r\n\r\nnode2# docker network create --config-only --subnet 192.168.20.0/24 --gateway 192.168.20.1 --opt parent=eth1 --macvlan_mode=bridge mv-conf\r\n```\r\n\r\nNote:\r\ncommand reference and swagger changes, integration tests will be added as design review proceeds.\r\n\r\nNote: If a node-local multihost capable driver is capable to autonomously allocate its resources on each node, then there is no need for the user to create a `config-only` network and pass it during the swarm network creation as `config-from`\r\n\r\nCloses #27082\r\n\r\n- Libnetwork vendoring:\r\nFixes #29184\r\nFixes #23987\r\nRelated to#24848\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/moby/moby/issues/comments/308204675","html_url":"https://github.com/moby/moby/pull/32981#issuecomment-308204675","issue_url":"https://api.github.com/repos/moby/moby/issues/32981","id":308204675,"user":{"login":"thaJeztah","id":1804568,"avatar_url":"https://avatars1.githubusercontent.com/u/1804568?v=3","gravatar_id":"","url":"https://api.github.com/users/thaJeztah","html_url":"https://github.com/thaJeztah","followers_url":"https://api.github.com/users/thaJeztah/followers","following_url":"https://api.github.com/users/thaJeztah/following{/other_user}","gists_url":"https://api.github.com/users/thaJeztah/gists{/gist_id}","starred_url":"https://api.github.com/users/thaJeztah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaJeztah/subscriptions","organizations_url":"https://api.github.com/users/thaJeztah/orgs","repos_url":"https://api.github.com/users/thaJeztah/repos","events_url":"https://api.github.com/users/thaJeztah/events{/privacy}","received_events_url":"https://api.github.com/users/thaJeztah/received_events","type":"User","site_admin":false},"created_at":"2017-06-13T18:21:30Z","updated_at":"2017-06-13T18:21:30Z","body":"@smakam when using `bridge`, swarm does not do any magic, just attaches the tasks to the network, but no overlay / cross-node communication."}}
{"actor":{"display_login":"thaJeztah"}}