-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docker-compose.yml for etcd-v2 cluster #1
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added come clarification on etcd version
@@ -0,0 +1,98 @@ | |||
version: '2' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This version is of the docker-compose spec not etcd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets also change the path as this is v3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hexfusion I let the path etcd-v2 so we could define an etcd-v3 for docker-compose version 3. It only allows 1 compose file per directory?
Suggestions to the new directory name?
environment: | ||
ETCDCTL_API: 3 | ||
ETCDCTL_ENDPOINTS: http://etcd-1:2379,http://etcd-2:2379,http://etcd-3:2379 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice can you tell me how DNS works here? Meaning how does etcd-1
resolve?
/cc @retroflexer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah sure. Docker creates a new local cluster named etcd-dev. You can actually do a docker inspect network etcd-dev
and it should give the runtime config for this network.
This puts all the 4 containers in the same bridge. The DNS gets resolved via hostname. Quoting docker-compose documentation Each container can now lookup the hostname web or db and get back the appropriate container’s IP address.
This is achieved by docker configuring 3 files inside the container described here
No description provided.