Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

alaypatel07
Copy link
Owner

No description provided.

Copy link
Collaborator

@hexfusion hexfusion left a 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'
Copy link
Collaborator

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.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Thanks

Copy link
Collaborator

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?

Copy link
Owner Author

@alaypatel07 alaypatel07 Aug 6, 2019

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?

etcd-v2/docker-compose.yml Show resolved Hide resolved
environment:
ETCDCTL_API: 3
ETCDCTL_ENDPOINTS: http://etcd-1:2379,http://etcd-2:2379,http://etcd-3:2379

Copy link
Collaborator

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-1resolve?

/cc @retroflexer

Copy link
Owner Author

@alaypatel07 alaypatel07 Aug 6, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants