Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Peer discovery with swarmkit API for Docker plugin v2 #2805

Closed
lukemarsden opened this issue Feb 15, 2017 · 2 comments
Closed

Peer discovery with swarmkit API for Docker plugin v2 #2805

lukemarsden opened this issue Feb 15, 2017 · 2 comments

Comments

@lukemarsden
Copy link

Currently if you docker plugin install weave net comes up on every node but the nodes don't know how to find eachother. Implement this by copying the way weave-kube does it but plugging it into the swarm nodes API instead.

cc @bboreham

@brb
Copy link
Contributor

brb commented Mar 3, 2017

The list of approaches I considered:

  1. To use GET /nodes (Docker API reference) to get a list of nodes to connect to when starting the plugin. Unfortunately, /nodes can be called only from a master node, so it cannot be used when starting the plugin on a worker node.
  2. Accidentally I found out that GET /info returns the list of master nodes. So, when starting the plugin on a worker, we pass -ipalloc-init observer, while on a master node we pass --ipalloc-init consensus=$NUMBER_OF_MASTERS. In both cases, we pass the list of master peers to weave to connect to. It works fine, but it's not clear whether it is safe to use the info from /info. See Undocumented field in GET /info response moby/moby#31386.
  3. To use GET /nodes and DiscoverNew events which the plugin receives when a node joins the Swarm cluster.

I implemented the 2nd one, because of the simplicity, and because at the time of testing I couldn't receive DiscoverNew events. However, after cleaning up my testing env I am able to receive the events. Depending on moby/moby#31386 I might need to implement the 3rd option.

@marccarre
Copy link
Contributor

Fixed by #2727.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants