Commit Graph

13 Commits

Author SHA1 Message Date
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 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 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 f50cd10061 migrate from pkg/store to docker/libkv
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-06-29 16:19:21 -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 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
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
Alexandre Beslic 403f95f86c Remove placeholder TLS parameter in discovery interface and New method
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-12 14:19:30 -07:00
Alexandre Beslic 6f67ca3a58 replace variadic method options for simple Config struct, correct Consul Watch method
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-12 14:00:55 -07:00
Alexandre Beslic 59e1e9b942 Change existing discovery backends to 'kv' using metatada storage backends in the store package
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-11 17:23:55 -07:00