-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
F sockaddr 0.7 #2563
F sockaddr 0.7 #2563
Conversation
The following is now possible: ``` $ consul agent -dev -client="{{GetPrivateIP}}" -bind='{{GetInterfaceIP "en0"}}' ```
LGTM! |
I played a little bit with this, and I can state that it doesn't solve #473. (and possibly others) As an example, I tried this: "addresses": { and the result is: Error starting agent: DNS address resolution failed: Multiple addresses found ("127.0.0.1 10.98.164.146"), please configure one. This is great for being able to find a single address using macros to hunt, but you still have to make sure you only find a single address for things to work. The underlying go networking layer does not support binding to a list of addresses/interfaces. It's all or nothing. (Even worse, it's only "all" tcp4 or tcp6, never both, so all acts unique for go vs. nearly every other lang!) This has apparently been an ongoing topic for quite a long time over there: golang/go#9334 Also, looked at some of the other referenced issue numbers and there seem to be a lot of examples that would return multiple addresses being thrown around that won't work. Not sure if you want to go back and clarify on those. |
@rhyas Thank you for giving this a twirl, and yes, that's correct. Internally we don't iterate over multiple addresses... yet. That's next. For now you do have to apply a |
Is someone actually working on the iteration over multiples internally? I ask, because I'm taking a stab at that. I have it working for HTTP/S and passing all the automated tests. I'm working on DNS now. Not sure it will be as straightforward for RPC, because there doesn't appear to be a handy mux class in use. But HTTP/DNS are the two most common needs, so at least those would be a big step forward. |
As of today, no, no one has taken this on. Please feel free to give this a twirl if you've got cycles available (multiple listeners would be very welcome work by everyone). I would not bother with RPC (it's about to be deprecated in favor of exclusively relying on the HTTP interfaces). |
I have this line in consul 0.7.4 config.json, but it seems to be ignored and instead ends up on eth0 (default) with 10.2.x.x. It is possible that edit: It's running in docker with the following initial arguments (because of a setup.sh):
|
@RRAlex Until I get around to fixing the tests that I broke in #2786, a few questions:
|
For context, I'm running the consul docker container as a single node cluster, as back-end to a single vault (also with hashicorp's container). Right now I have to give it a static IP or wipe consul db on every boot as I think the UUID identification has only recently been added (?). As for To test this, as I can't build it right now, is there a container I can pull from somewhere with your version? |
@RRAlex Please be careful with your Vault data! The UUID-based NodeID lookups were added in 0.7.4 (Feb 6th). I don't personally use Consul in any Docker containers for anything that I do or work on so I'm not sure what the situation is there (we run Consul on the host itself and not in a container). Because Consul can only advertise one address, I'm a little concerned about the notion that binding to |
It's really just to make it available to docker swarm, I can recreate the whole content of the vault+consul anytime, so no worries there. |
Support late binding to IP addresses based on runtime information via the hashicorp/go-sockaddr library. This is a revised version of #2546 targeted specifically at the 0.7.X branch. Example syntax:
Fixes: #1478 #1620 #1570 #1110 #725 #1079
Possibly helps address: #2330 #2505 #473 #1914
And is the first step toward addressing: #2217 #1185
Known issues: