-
Notifications
You must be signed in to change notification settings - Fork 2k
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
set Consul service meta from Nomad service definition #4652
Comments
What would be nice is if the job, group and task level meta would be merged and then sent to Consul when setting up the service entry. From the Consul end of things it looks like the API already supports setting the meta key: so it could be added here: nomad/command/agent/consul/client.go Lines 563 to 569 in 07bfc85
I would expect that the |
Is there any plan or progress? |
Looks like this was implemented in #6193
@jeteon Although I don't think there's any technical reason this couldn't be implemented, it would at this point be a significant backwards incompatible change. Instead, you might be able to realize a similar effect by making use of HCL2 features. |
Sorry for the delay, I had been trying to remember why I had originally opened that request. 🤭 Thanks, this seems to work as expected ... when I specify the following job "example" {
datacenters = ["dc1"]
group "cache" {
task "sleep" {
driver = "raw_exec"
config {
command = "/bin/sleep"
args = ["600"]
}
service {
meta {
region = "${node.region}"
dc = "${node.datacenter}"
}
}
resources {
cpu = 500
memory = 256
}
}
}
}
|
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. |
Nomad version
Nomad v0.8.4 (dbee1d7)
Operating system and Environment details
CentOS 7.5+, Ubuntu 14.04.5+
Issue
Using these as reference:
https://www.consul.io/docs/agent/services.html
https://www.nomadproject.io/docs/job-specification/service.html
How can I set the Consul service metadata ("meta") from Nomad's service definition?
As I can gather it doesn't seem to be doable for now.
My final use case is to propagate info like the AWS region, availability zone, machine type, etc. into the service definition.
A Consul Template based job (running on a separate machine) will then use this information to do some other things.
Regards,
Shantanu
The text was updated successfully, but these errors were encountered: