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

Question about etcd backend #204

Closed
jbkc85 opened this issue Jul 11, 2015 · 6 comments
Closed

Question about etcd backend #204

jbkc85 opened this issue Jul 11, 2015 · 6 comments

Comments

@jbkc85
Copy link

jbkc85 commented Jul 11, 2015

To whom it may concern,

Is there a reason you are storing just the dockerip:dockerport in the etcd key value store instead of the entire service information like you do with Consul? I made a few modifications to the etcd.go file to store the service in JSON and was wondering if there was a specific reason that wasn't being done by default.

Example in running off of a locally hosted CoreOS cluster on Vagrant:

Current Behavior:
core@core-01 ~/registrator $ etcdctl get /original/cAdvisor/core-01:cadvisor:8080
10.1.0.18:8080

Modified Behavior:
core@core-01 ~ $ etcdctl get /services/cAdvisor/core-01:cadvisor:8080
{"ID":"core-01:cadvisor:8080","Name":"cAdvisor","Port":8080,"IP":"10.1.0.16","Tags":["version=1.4.3","maintainer=jbkc85@gmail.com"],"Attrs":{},"TTL":0,"Origin":{"HostPort":"8080","HostIP":"10.1.0.16","ExposedPort":"8080","ExposedIP":"10.1.0.17","PortType":"tcp","ContainerHostname":"a8b0c13e2f1f","ContainerID":"a8b0c13e2f1ff21b2d2b29c11805dd22fd008dbea96b700f5ff5a0e08e826d0f"}}

If you find this useful let me know and I can initiate a pull request!

Thanks,
Jason Cameron

@progrium
Copy link
Contributor

Because that is what many tools expect. Full service metadata could be stored separately as well.

@jbkc85
Copy link
Author

jbkc85 commented Jul 14, 2015

Ah, that makes sense.

If you don't mind here are a few questions as I just started using Registrator:

  1. Do you happen to have some examples of the tools already created?
  2. How would you suggest the full service metadata be stored separately without diverging too much from your codebase?

Thanks ahead of time!

@progrium
Copy link
Contributor

Mostly it's a convention people use with tools like conf.d etc.

I can't really answer the second question. But we can track the feature request here: #175

@klausenbusk
Copy link

If I understand this correctly, the skydns* backend don't support metadata?
I started a docker image like just to test

docker run -P -e "SERVICE_TAGS=master,backups" -e "SERVICE_REGION=us2"  skynetservices/skydns:2.5.2c
core@db2 ~ $ etcdctl get "/skydns/local/skydns/skydns-53/test:skydns:53"
{"host":"10.133.43.13","port":32774}

Is this the expected behavior?

@jbkc85
Copy link
Author

jbkc85 commented Sep 15, 2015

@klausenbusk Yes, I believe that is the expected behavior. Right now etcd simply stores the IP and Port. You can always modify that behavior to store the entirety of the service metadata as pointed out above, but it could potentially break other programs that utilize registrar in the process (if you are using any of them).

@klausenbusk
Copy link

Yes, I believe that is the expected behavior.

This make registrator so much less use full. The PR #76 will fix it (I think), through a little hacky. Hmm. Then I just code my own fleet register service.. :/

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

No branches or pull requests

3 participants