-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[feature] add driver.docker.bridge_ip client attribute #2785
Comments
master (and soon 0.6) are able to advertise the Docker IP in Consul: https://github.com/hashicorp/nomad/blob/master/website/source/docs/drivers/docker.html.md#advertising-container-ips Is this sufficient? |
I don't understand what you mean by the "docker ip"? is that the bridge ip? I don't think that will work because I need to set the https://www.nomadproject.io/docs/drivers/docker.html#dns_servers |
The IP Docker assigns to the container, so in the bridge's subnet but not the bridge's IP. The ports your container exposes are reachable on that IP from the host.
Hm, I don't think if you run Consul in Docker with bridge networking it will be bound to the bridge's IP. It will be bound to the next free IP in the bridge's subnet. That's the IP the feature I linked would advertise. However if Consul is the service you wish to discover, advertising it in Consul isn't going to help! I think for now running Consul with host networking is your best option as once services can reach Consul they can advertise/discover any other services as needed. Consul itself is just kind of a special case and needs to be in a known location. It's not possible to have the location be known with bridge networking because you don't know what IP the Consul container will be assigned even if the port is statically assigned. |
I run consul on the host. That is why it binds to the bridge. You cannot
talk to the host except through bridge
…On Thu, Jul 6, 2017, 5:54 PM Michael Schurter ***@***.***> wrote:
I don't understand what you mean by the "docker ip"? is that the bridge ip?
The IP Docker assigns to the container, so in the bridge's subnet but not
the bridge's IP. The ports your container exposes are reachable on that IP
from the host.
So if consul is bound to the docker bridge (example 172.17.0.1) then it
needs to be set to that
Hm, I don't think if you run Consul in Docker with bridge networking it
will be bound to the bridge's IP. It will be bound to the next free IP in
the bridge's subnet. That's the IP the feature I linked would advertise.
However if Consul is the service you wish to discover, advertising it in
Consul isn't going to help!
I think for now running Consul with host networking is your best option as
once services can reach Consul they can advertise/discover any other
services as needed. Consul itself is just kind of a special case and needs
to be in a known location. It's not possible to have the location be known
with bridge networking because you don't know what IP the Consul container
will be assigned even if the port is statically assigned.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2785 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKGBaFVNT6InF_DSZKyW8LtkS73duqIks5sLWWngaJpZM4OQAkP>
.
|
Ah! I understand now. Thanks for the extra details. How is Nomad connecting to Consul? As a workaround for now you can always create your own meta key with the IP: https://www.nomadproject.io/docs/agent/configuration/client.html#meta |
Nomad just connects to consul on localhost
…On Thu, Jul 6, 2017, 10:37 PM Michael Schurter ***@***.***> wrote:
Ah! I understand now. Thanks for the extra details.
How is Nomad connecting to Consul? As a workaround for now you can always
create your own meta key with the IP:
https://www.nomadproject.io/docs/agent/configuration/client.html#meta
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2785 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKGBbcJoqrdzQL45kPhPNjdxWdCe4yQks5sLafcgaJpZM4OQAkP>
.
|
Makes sense! I'll try to get this in before we cut 0.6, but it's going to be close. :) |
@schmichael ... just curios, how soon in 0.6 landing? 👍 😄 |
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. |
this way things that need to talk to something that is on the host machine and bound to the bridge ip (ie consul dns) can use it
https://www.nomadproject.io/docs/drivers/docker.html#client-attributes
The text was updated successfully, but these errors were encountered: