Commit Graph

21 Commits

Author SHA1 Message Date
Madhu Venugopal 7cbc3e76f6 Handle endpoint & network object in notifyEvent avoiding id lookup
Join & Leave Serf processing happens in a separate goroutine and there
are cases as in https://github.com/docker/libnetwork/issues/985, it can
cause lookup failures when endpoint delete processing happens before
Serf gets a chance to handle the leave processing.

The fix is to avoid such lookups in this goroutine, but handle the
endpoint and network objects directly.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-03-29 11:19:23 -07:00
Alessandro Boch 5dc5acfa58 Handle datastore update in Ipam and overlay drivers
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-02-16 13:49:49 -08:00
Jana Radhakrishnan 6f8712cd01 Merge pull request #907 from aboch/dsc
discoverapi.Discover interface
2016-02-02 13:17:46 -08:00
Alessandro Boch 247e8034b8 Introduce discoverapi.Discover interface
- Move DiscoverNew() and DiscoverDelete() methods into the new interface
- Add DatastoreUpdate notification
- Now this interface can be implemented by any drivers, not only network drivers

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-01-28 12:13:04 -08:00
Alessandro Boch 187e179e6b Remove overlay's ipAllocator
- A vestige of experimental overlay driver

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-01-27 16:55:59 -08:00
Alexander Morozov 46077fcfb1 Fix mutex copy
If we use peerMap as value, then we copy its mutex on
`pMap = d.peerDb.mp[nid]` and lock entirely different mutexes every
time.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-12-07 14:20:13 -08:00
Madhu Venugopal 5a0dbbd986 log an error if advertise is configured with a non-local ip-address
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-26 12:21:06 -07:00
Jana Radhakrishnan a226c36b75 Pass down store configs to driver
- Renamed netlabel prefixes to accomodate both global
       and local store configs.
     - Added a `private` marker.
     - Skipping the data store configs for remote driver
       so that external plugins don't get it as there is
       no secure and sane way to coordinate providing
       data store access to external plugins.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-06 17:28:47 -07:00
Jana Radhakrishnan 71e14dd52a Remove always-on watch for networks and endpoints
Always on watching of networks and endpoints can
affect scalability of the cluster beyond a few nodes.
Remove pro active watching and watch only the objects
you are interested in.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-06 14:15:49 -07:00
Alessandro Boch ddcfab5f81 libnetwork <-> ipam driver interaction
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-03 16:18:19 -07:00
Madhu Venugopal 1081687e38 Allowing local joins to happen even when serf is not initialized
With the new Discovery model, join can happen even before serf is
initliazed. It could also happen due to misconfiguration of
--cluster-advertise. The local endpoint join must succeed and later when
the serf initializes and joins the cluster, it will push the local db to
the cluster.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-02 12:20:29 -07:00
Madhu Venugopal fac4e67c16 serfJoin doesnt happen if self notification comes later
With the recently introduced docker discovery, the self node discovery
notification can reach the overlay driver after the remote node
discovery notification.  In scenarios such as 2 node setup, it seems more
likely. In those scenarios, the serfJoin is not triggered and hence the
neighborship is not formed between the 2 nodes.

The fix is to retain the knowledge of the neighbor and reuse it
immediately after the serfInit is done. Since we do the serfJoin just
once, there is no harm in changing the neighIP to a new value even if it
is not used.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-01 21:50:54 -07:00
Madhu Venugopal 0066225da5 Integration with Docker Discovery
* integrated hostdiscovery package with the new Docker Discovery
* Integrated hostdiscovery package with libnetwork core
* removed libnetwork_discovery tag
* Introduced driver apis for discovery events
* moved overlay driver to make use of the discovery events
* Using Docker Discovery service.
* Changed integration-tests to make use of the new discovery

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-01 12:32:55 -07:00
Srini Brahmaroutu e8593bdb65 Docker GCCGO CI is causing compilation errors as the varibale is declared and not used.
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-09-25 22:32:43 +00:00
Madhu Venugopal 7305922385 Moving overlay configure out of Init and into network create
Ideally, both overlay and libnetwork core must be changed to support
kv-store connection retry. But this is a stop-gap measure to unblock the
discovery related PRs.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-09-24 19:10:37 -07:00
Chun Chen 8babc3d4d3 Add local datastore to persist states of LocalScope network
Signed-off-by: Chun Chen <ramichen@tencent.com>
2015-09-21 17:58:51 +08:00
Jana Radhakrishnan d565a4df48 Push driver config during `Init`
Currently the driver configuration is pushed through a separate
api. This makes driver configuration possible at any arbitrary
time. This unncessarily complicates the driver implementation.
More importantly the driver does not get access to it's
configuration before it can do the handshake with libnetwork.
This make the internal drivers a little bit different to
external plugins which can get their configuration before the handshake
with libnetwork.

This PR attempts to fix that mismatch between internal drivers and
external plugins.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-09-19 08:43:34 -07:00
Santhosh Manohar 1426728a64 For the endpoints on overlay network set the MTU to 1450 to avoid fragmentation when the vxlan header gets added
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2015-09-02 09:58:36 -07:00
Alessandro Boch fd43ee1323 Introduce Sandbox entity
- Maps 1 to 1 with container's networking stack
- It holds container's specific nw options which
  before were incorrectly owned by Endpoint.
- Sandbox creation no longer coupled with Endpoint Join,
  sandbox and endpoint have now separate lifecycle.
- LeaveAll naturally replaced by Sandbox.Delete
- some pkg and file renaming in order to have clear
  mapping between structure name and entity ("sandbox")
- Revisited hosts and resolv.conf handling
- Removed from JoinInfo interface capability of setting hosts and resolv.conf paths
- Changed etchosts.Build() to first write the search domains and then the nameservers

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-27 11:19:02 -07:00
Dave Tucker 6bba1cd7b1 Use IANA assigned VXLAN port
Fixes #358

Signed-off-by: Dave Tucker <dt@docker.com>
2015-07-03 03:43:02 +01:00
Jana Radhakrishnan 6e4a572529 Overlay driver
This commit brings in the first implementation of
overlay driver which makes use of vxlan tunneling
protocol to create logical networks across multiple
hosts.

This is very much alpha code and should be used for
demo and testing purposes only.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-18 15:06:24 -07:00