Commit Graph

160 Commits

Author SHA1 Message Date
Victor Vieux fc1e7bbca2 use docker/docker/pkg/discovery
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-01-12 00:38:06 -08:00
Mary Anthony 1bfdf55a52 Updating READMEs
Signed-off-by: Mary Anthony <mary@docker.com>
2016-01-12 00:34:57 -08:00
Sebastiaan van Stijn fe0a2a9427 Fix broken links in discovery README
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2015-12-07 00:43:17 +01:00
Alexandre Beslic 501b9609dd fix typos and add note in discovery README for token usage scenarios
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-12-06 01:04:30 -08:00
Alexandre Beslic 8a2897e141 Add configurable discovery
This PR allows to configure the discovery path using the
--discovery-opt flag (with "kv.path=path/to/nodes"). We
can point to "docker/nodes" and use the docker discovery.

If docker instances are advertising to the cluster using
the `--cluster-advertise` flag, the swarm join command
becomes unnecessary.

Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-11-02 06:10:50 -08:00
Andrea Luzzardi 58558f5224 Fix various golint issues.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-10-19 13:58:21 -07:00
Andrea Luzzardi 1d008a7ddd Merge pull request #1254 from dhiltgen/tls_kv
Add TLS support for libkv
2015-10-12 14:31:03 -07:00
Daniel Hiltgen 3661b6e63b Add TLS support for libkv
This adds TLS support into the KV store for swarm.  The manage, join,
and list commands all have a new CLI argument, matching the docker engine
discovery backend.  This required adding the tlsconfig utility
package from docker engine.

Here's an example showing re-use of the cluster certs for the KV store:

    swarm manage --tlsverify \
        --tlscacert /etc/docker/ssl/ca.pem
        --tlscert /etc/docker/ssl/cert.pem
        --tlskey /etc/docker/ssl/key.pem
        --discovery-opt kv.cacertfile=/etc/docker/ssl/ca.pem
        --discovery-opt kv.certfile=/etc/docker/ssl/cert.pem
        --discovery-opt kv.keyfile=/etc/docker/ssl/key.pem
        --advertise 192.168.122.47:3376
        etcd://192.168.122.47:2379

Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
2015-10-12 13:33:08 -07:00
Alexandre Beslic ab249c4756 Fix tests by adding mocks for additional Watch calls
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-10-08 11:20:04 -07:00
Alexandre Beslic fa5cd27d82 Initialize the key/directory before watching on kv discovery
Before that change, etcd and zookeeper would fail to instantiate
the discovery without the key being already there in the store or
created beforehand and implicitely by a 'swarm join'.

Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-10-06 17:12:16 -07:00
Raoof Mohammed 52a184c1db doc: spell check swarm in discovery readme
Signed-off-by: Raoof Mohammed <raoof.md@gmail.com>
2015-10-02 13:29:25 -04:00
Victor Vieux 02bd0e9b76 Merge pull request #1202 from abronan/update_libkv
Update libkv Godeps
2015-09-17 22:58:22 -07:00
Alexandre Beslic 1cb265d0b6 update libkv Godeps
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-09-17 07:52:00 -07:00
Alexandre Beslic 3869d5eee8 Fix token discovery, error chan for Watch was not passed back to the caller
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-09-07 05:25:52 -07:00
Victor Vieux 6678a167fe update discovery url
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-09-02 21:04:04 -07:00
Morgan Bauer f6caa46c98
Add reliance on external internet connectivity
Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
2015-09-01 15:00:30 -07:00
Victor Vieux 28bc55ed6b improve usage for discovery
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-08-01 16:53:07 -07:00
Peggy Li 0572a6778c Fix 'Scheduler' typos and update User Guide link
Signed-off-by: Peggy Li <peggyli.224@gmail.com>
2015-07-20 20:41:33 -07:00
Andrea Luzzardi f38c034499 Leader Election: Use same path prefix as discovery.
Fixes #1037

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-07-09 01:16:47 -07:00
Alexandre Beslic 814a8168ee update libkv godeps, fix zookeeper discovery list
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-07-04 18:37:13 -07:00
Alexandre Beslic b0fe6000b7 revert to using s.heartbeat for store failover
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-06-30 17:38:51 -07:00
Alexandre Beslic 56e4dbb480 use const for failover watch time and minor comment fix in tests
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-06-30 14:04:41 -07:00
Alexandre Beslic 03a7be2919 fix issue with zookeeper and occasional SOH character return
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-06-30 14:04:05 -07:00
Alexandre Beslic f50cd10061 migrate from pkg/store to docker/libkv
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-06-29 16:19:21 -07:00
Victor Vieux 52db3436a2 add ttl placeholder to discovery
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-06-10 17:03:48 -07:00
Andrea Luzzardi 7394be0704 Replace --addr with --advertise
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-26 17:43:14 -07:00
Andrea Luzzardi fa2809d431 Merge pull request #841 from abronan/consul_ttl_check
Additional check for ttl < 10s and Consul
2015-05-26 15:00:22 -07:00
Victor Vieux 62e46100cb Merge pull request #851 from aluzzardi/discovery-prefix
discovery: KV Path is now an optional prefix.
2015-05-26 14:57:56 -07:00
Andrea Luzzardi 1a58a85b44 discovery: KV Path is now an optional prefix.
"consul://addr1" will store discovery entries into "docker/swarm/nodes"
"consul://addr2/foo" will store entries in "foo/docker/swarm/nodes"

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-26 14:25:23 -07:00
Alexandre Beslic 814932ccb7 Simplify check
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-26 12:32:00 -07:00
Victor Vieux be10798096 use proper append in test
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-05-26 11:49:36 -07:00
Victor Vieux 41c2060ab5 use heatbeat in second, not ms
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-05-26 11:19:04 -07:00
Alexandre Beslic 96241c6b79 pull out the log.Fatal from pkg/store to the discovery level
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-26 11:01:17 -07:00
Victor Vieux ad8a9724e2 Merge pull request #835 from aluzzardi/leader-election
Leader election
2015-05-26 10:11:19 -07:00
Rajdeep Dua 46390b005f Added TestCase for ContainsEntry
Signed-off-by: Rajdeep Dua <dua_rajdeep@yahoo.com>
2015-05-26 03:29:59 -07:00
Andrea Luzzardi b4efc08dfc api: Integrate leader election.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-22 21:23:34 -07:00
Madhu Venugopal 23ecada9d7 Adding export Init method for the exported discovery components
Since Swarm discovery is used by libnetwork without the swarm main(), it
is forced to use annonymous import in order to force-trigger the
unexported init() methods. Using annonymous import is highly discouraged
in a Non-Main and Non-Test packages.

Introducing exported Init() methods on these files so that libnetwork
can use Discovery as a library without having a main package.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-20 20:18:13 -07:00
Andrea Luzzardi 2ff9679938 store: CreateStore -> NewStore
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-19 20:13:29 -07:00
Alexandre Beslic b8d72c291d Cleanup, fix Integration tests and use of a single global Session in Consul
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 15:27:39 -07:00
Alexandre Beslic ec478d8ed5 Add integration tests for engines departure with node removal and ephemeral behavior
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 12:08:56 -07:00
Alexandre Beslic f81de46ab4 Fix Consul and etcd with latest changes, use etcd v2.0.11 for integration tests, remove call to SyncCluster for now (breaks the integration tests)
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 10:25:31 -07:00
Alexandre Beslic 4408a9cc8c Add Ephemeral for Consul, Zookeeper and Etcd (Etcd abd Consul are using TTLs in the background)
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 10:25:31 -07:00
Andrea Luzzardi 08dc3c7c7b discovery: Add the Entries.Diff helper.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:54:51 -07:00
Andrea Luzzardi 0c9e8c8803 discovery: Added kv tests using the mock Store.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:15 -07:00
Andrea Luzzardi 2106966d54 discovery: Watch tests for file and some other tests.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi 9399a8835c golint fixes.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi 0c72bcaf40 discovery cleanup: heartbeat is a time.Duration.
- Use a time.Duration instead of a uint64 for hb
- Flags can accept durations: --heartbeat 25s

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi f33c03af93 discovery: Push watch errors to a channel
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi 97984881c3 discovery: New channel based API.
- Watch() issues updates by channel rather than by callback
- Fetch() is gone
- Watch() can be stopped at any time by closing the stop channel
- Watch() is now resilient to errors and will try over and over

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:13 -07:00
Andrea Luzzardi c77f7332a0 store: Fixes to etcd and zk WatchTree
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-15 13:37:51 -07:00