-
Notifications
You must be signed in to change notification settings - Fork 20
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 --address option to set registered service address #14
Conversation
Thanks for the contribution. I seems that something is wrong with current travis configuration so I will have to fix that and ask you to rebase your PR afterwards. In the meantime you need to give me a meaningful use case for this feature. On initial design we purposefully missed the option to explicitly set the address of registered service in such "remote-agent" scenario. Here are the reasons for that:
Before going deeper into detail I rush to say that I already failed in effort to not encourage to make bad decisions. I think that allowing to set remote address as
See, the typical scenario for consul deployment is to setup agent on your every instance. Consul run in the 'client' mode is very lightweight and does not cost you much of the resources. People are successfully running consul clusters with thousands of nodes because it was simply designed for such scenario. Including the service's address in its own invocation (so it becomes hosts configuration) is in my honest opinion an anti-pattern. If you require the service to have fixed address backed in its own configuration then you are undermining the whole idea of service discovery (especially using consul). Having consul agent on the same host is the right way of doing that. Also, see what gives you the
No matter if it's 1, 10, or 10k hosts. This is because we assume that you should contact with the local consul agent that will handle the registration of service in the cluster. When you make 'ianitor' to contact with remote agent then you end up with requirement to provide unique configuration for every host. Today, it is easily achievable thanks to existing configuration management tools (puppet, chef, ansible, whatever) but still:
And the most important issue: renders 'ianitor' useless. IMO it is better to use JSON in this such situation because 'ianitor' will not provide you any extra value in this kind of deployment. I don't say that this feature is definitely bad but I need to have a realistic example of situation where it is really not reasonable to have consul agent installed on the same host as the service run by |
Fix travis config.
After long time I think that maybe it is worth reconsidering again. I have rebased it on the separate branch to make sure tests pass. |
Hi, As such, I think this should be merged as an option. Thanks! :) |
Sorry, I was sick and forgot about this. I could merge it and release but don't remember why this build failed. |
closing in favor of #18 |
Sorry folks it took so long. I could not find out what was the reason of CI failures, so I forgot about this issue. This feature is now merged (from #18) and released as 0.1.0 |
When ianitor is used on a host that is not running a Consul agent, and you use --consul-agent to connect to a remote agent or peer to register the service, the address that was registered was the remote Consul agent or peer, not the host where the service resides. This option allows you to specify the IP address to use, as well as the port, in this circumstance.