-
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
Add meta for Nomad Variables #19329
Comments
Hi @prabirshrestha! So the idea here is that you'd like to have a separate "meta" block for semi-structured metadata? Changing the variable spec from (HCL example): path = "path/to/variable"
namespace = "default"
items {
key1 = "value 1"
key2 = "value 2"
} to path = "path/to/variable"
namespace = "default"
items {
key1 = "value 1"
key2 = "value 2"
}
meta {
meta_key1 = "meta value 1"
meta_key2 = "meta value 2"
} If I remember some of the design discussions I had with @angrycub over Variables, this was something we originally considered but deferred as a "maybe some day". The contents of the If we were to implement this, there's a few details to work out:
|
Here is the tool that I'm looking to add gitops support for nomad vars. Currently we use meta for jobs so only jobs that have been created by the tool will be deleted if it no longer exists in git repo. This allows slow migration and won't accidently delete nomad jobs. // Adding metadata to identify the jobs managed by the Nomoporator
metadata := make(map[string]string)
metadata["nomoporater"] = "true"
metadata["uid"] = "nomoporator"
job.SetMeta(metadata) I would like to do the same for variables. What you are proposed is exactly what I'm looking for. Since meta was not supported, I had actually thoughts of adding a special known variables with list of keys. The only reason I see it may not work is when one adds loops they would need to filter the key out. items {
key1 = "value 1"
key2 = "value 2"
nomoporater_managed_keys = "key1,key2"
} I don't see me requiring encryption for meta, but I'm ok if it is encrypted as long as I can decrypt it when I fetch using the api in my tool. I expect to use very few variables. Its primarily for my homelab, so the only things I will put is most likely domain and few secrets used by the jobs. At somepoint I may even migrate to using vault of secrets, but want to have minimal maintenance for my homelab hence one of the major reasons of choosing nomad over k8s. |
Thanks for that extra context on your use case @prabirshrestha.
Clever!
Yeah that makes sense. Right now the Variables ACL capability has a separate |
can't use meta due to hashicorp/nomad#19329
Currently nomad variables only supports key value pair. I would like it to attach extra meta properties to nomad variables.
My primary uses case is to allow gitops for nomad vars, ie. sync my git state for nomad vars with an actual nomad cluster. To do so I need to know if a nomad var was synced with my git sync tool or was manually added.
This can also be used to add other information such as description, examples, owner, doc links and so on.
The text was updated successfully, but these errors were encountered: