-
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 request: add runtime/env var of host ip #2429
Comments
👍 |
What exactly do you think the host ip would be given that there can be many network devices, multiple IPs per NIC, etc? |
good question, for a "standard" setup I'd like to get the private ip, |
If you are on a bridge network, that private IP wouldn't be routable? I do not want to add an environment variable that doesn't have clear behavior or benefit. It may be better to add an option to the client config to allow the operator to set the |
@dadgar AFAIK it is routable on a bridge network |
@bsphere Sorry you are right about the routing. Did my point about the DNS make sense though? |
It'll definitely improve the integration with consul and seems like a good
feature. But it won't solve the issue of passing arguments or env vars of
locally running services such as nsq.
On Mar 14, 2017 23:17, "Alex Dadgar" <notifications@github.com> wrote:
@bsphere <https://github.com/bsphere> Sorry you are right about the
routing. Did my point about the DNS make sense though?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2429 (comment)>,
or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AB2LTC07MX-HW-LDTXYiz4f6qEbmpQGlks5rlwPRgaJpZM4MaP5c>
.
|
Can you not just register those with consul and do a lookup of their IP using DNS?
Thanks,
Alex Dadgar
…On Mar 14, 2017, 10:54 PM -0700, Gal Ben-Haim ***@***.***>, wrote:
It'll definitely improve the integration with consul and seems like a good
feature. But it won't solve the issue of passing arguments or env vars of
locally running services such as nsq.
On Mar 14, 2017 23:17, "Alex Dadgar" ***@***.***> wrote:
@bsphere <https://github.com/bsphere> Sorry you are right about the
routing. Did my point about the DNS make sense though?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2429 (comment)>,
or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AB2LTC07MX-HW-LDTXYiz4f6qEbmpQGlks5rlwPRgaJpZM4MaP5c>
.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
We run consul-template in each container. We want all the consul-template in each container to point to the consul installed in the host machine. So that loads on the consul are minimized. To get the host ip of the containers right now we are exposing an portmap. It would be great if the host ip (Nomad client_addr) is exposed inside the containers. |
I'm experiencing this problem as well, currently we are pointing all of our containers in our cluster to our master consul nodes. But we really want them to just query the consul node local to the host that they are running on. Is anyone aware of a workaround that could work in the meantime? |
[ Edit: dont use this. @LinusU Here is my workaround. The script that starts nomad on my machines generates the config.
I then pass the
Is this applicable to your situation? |
Hehe, that's quite clever 😄 I think I could use something similar, thanks! |
@hmalphettes I would not do that. The node class is used to optimize the scheduler by detecting feasibility of placements at a class level. This allows skipping nodes that we know wont work when picking a new placement. So by making the node class unique you will loose that and it goes against the purpose of the node class. Instead use this which already provides the IP:
I had actually forgotten about this but I think have the above lets us close this issue as there is a direct work around. Thoughts? |
that seem like a solid hack @dadgar :) |
yeah you close the issue. can you add it to the documentation?
…On 27 March 2017 at 01:16, Alex Dadgar ***@***.***> wrote:
@hmalphettes <https://github.com/hmalphettes> I would not do that. The
node class is used to optimize the scheduler by detecting feasibility of
placements at a class level. This allows skipping nodes that we know wont
work when picking a new placement. So by making the node class unique you
will loose that and it goes against the purpose of the node class.
Instead use this which already provides the IP:
env {
HOST_IP = "${attr.unique.network.ip-address}"
}
I have actually forgotten about this but I think have the above lets us
close this issue as there is a direct work around. Thoughts?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2429 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB2LTFY8CmfyEp2OO6LX81Vp3wT0fRyCks5rpuPSgaJpZM4MaP5c>
.
|
Thanks all! Docs cc7cdc1 |
|
@bsphere It worked for me: Starting nomad:
Running this job:
Resulted in this resolve.conf
|
hmm. maybe because I use advertise addresses are a private AWS ip |
@bsphere If you run This value is actually separate from the bind_addr. |
@dadgar its the private ip address.. i'll have to try it again. is there a way to use those runtime values in a template? |
is |
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. |
It is needed to add the host ip as a dns server to a the docker driver (for querying consul).
I know about NOMAD_IP_<port_label> but not all running jobs have open ports...
The text was updated successfully, but these errors were encountered: