Comments (8)
It should definitely be configurable.
Although I'm not sure the discovery service will always stay that simple.
Instead of a ENV var I think we should go toward a new flag with multiple backends like etcd://
zk://
and discovery://
What do you think ?
from classicswarm.
I understand that the API for the service will definitely change.
Only an ENV var would be bad, some something on par with -H
and DOCKER_HOST
. So --discovery-url
and SWARM_DISCOVERY_URL
seems appropriate. I agree that etcd://
, etc would be better but the current code has no hooks for plugability of the discovery back-end. Should one be added? Should I do this?
from classicswarm.
I would love to see discovery back-end "plugins"
I think the most difficult is to agree on the UI, here what I have in mind:
1
swarm join/manage --discovery token=XXXXXXXXX
etcd=URL
zk=URL
file=/path/to/file
2
swarm join/manage --discovery-token=XXXXXXXXX
--discovery-etcd=URL
--discovery-zk=URL
--discovery-file=/path/to/file
3
swarm join/manage --token=XXXXXXXXX
--etcd=URL
--zk=URL
--file=/path/to/file
4
swarm join/manage --discovery token://XXXXXXXXX #or hub://
etcd://URL
zk://URL
file://path/to/file
@aluzzardi @ibuildthecloud what do you think ?
from classicswarm.
+1 to discovery plugins
I like option 4 above
from classicswarm.
Option 2 would make it easier/more logical to relate/translate env-vars to options (e.g. SWARM_DISCOVERY_TOKEN
<===> discovery-token
etc.)
Other options may have their advantages though, so if those outweigh ^^, don't let my comment stop you.
from classicswarm.
I came here to raise this issue, so 👍
My only input would be that this is important enough that we should start with a simple ENV/flag for now, and work towards discovery plugins in the long-term.
from classicswarm.
I like options 1 and 4 better as they don't require adding "static" flags to swarm every time we add a discovery backend, thus making plugins later down the road easier to implement.
I guess the discovery interface could expose a few functions:
- Scheme() (or Type) returning the discovery scheme (e.g.
token
,zk
, ...). That way we can load a bunch of discovery interfaces and dynamically figure out what service they handle. - Callback() (or something else) that gets called every time there's a change in the list of nodes. I believe it has to be a callback system rather than a periodic fetch as we have right now since some discovery services work in a push model (
etcd
,zookeeper
).
from classicswarm.
I like option 4. I took the liberty of programming the implementation just for fun, but then realized I did it a bit different.. The PR is #163
What I did was
swarm manage/join --discovery-url hub:// --token XXXX
swarm manage/join --discovery-url hub://customdomain/path --token XXXX
swarm manage/join --discovery-url hub://http://customdomain/path --token XXXX
or
swarm manage/join --discovery-url etcd:// --token XXXX
So the main difference is that every discovery implementation would have some concept of a token. The reason I did this was because of swarm create
. Imagine you do swarm create --discovery-url etcd://blah
. You would imagine that it returns a new "cluster ID", or token. Then on the next command line you can do swarm manage --discovery-url etcd://blah --token foo
. So the discovery url never changes.
from classicswarm.
Related Issues (20)
- wrong ip to node HOT 1
- How to set the unique environments for tasks on every node in docker swarm? HOT 1
- Concerns about future HOT 15
- Docker: Unable to ping another host from inside of container running in swarm HOT 3
- Help: Network Alias HOT 1
- Feature Suggestion: docker swarm <stack-name> logs should provide aggregated logs from all services HOT 1
- Ingress routing broke after service update with start first HOT 1
- Pull request validation fails, https://jenkins.dockerproject.org not available HOT 1
- Bind Volumes mess up with users and groups... HOT 8
- Please help me ....................................What is alternative method to get discover token for docker-machine swarm ????? HOT 1
- CI: replace custom "dockerswarm/dind" image with official docker:dind image
- Plans on IPv6 support in swarm HOT 1
- docker swarm manager doesn't join on proper ip:port HOT 1
- Port redirection not working with docker swarm HOT 1
- How to access private repos of docker hub? HOT 1
- max_replicas_per_node in paused/drained nodes drives to -> no suitable node when updating service HOT 9
- Grafana v6.6.3 does not work on dockerswarm HOT 1
- service creation failing HOT 1
- Can nodes in a swarm have different versions of docker-ce ? HOT 1
- Why have all issues been closed? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from classicswarm.