-
Notifications
You must be signed in to change notification settings - Fork 608
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
[Proposal] docker service create template support for Node labels #2942
Comments
Great proposal, and highly anticipated :)
|
Any news on this? Absolutely necessary! For now I have a MariaDB docker config, which has a file included that points to a config file mounted from host to get some specific variables for galera cluster. When I could use node labels it would allow me to avoid host bind mounts for config files. |
This feels useful for anyone running stateful apps in swarm. I'd be happy to see if this is something I can contribute to. Any pointers where to look specifically (links to files would be enough) @dperny @thaJeztah ? |
@s4ke I think that it simply folder called for |
Currently supported Templates regarding the Nodes
Currently only two templates {{ .Node.ID }} and {{ .Node.Hostname }} are supported. This is nice, but labels would put these templates on another level in terms of possibilities.
How could this look
The template could be something like {{ .Node.Spec.Labels.[label name] }}.
If the label is not found the value "", "null" or "<no value>" (as it's currently done using docker node inspect) should be used.
Summary
Dockers templates for service creation should support node labels.
The result of the template {{ .Node.Spec.Labels.example_label }} should be the same as the output of
docker node inspect -f="{{ .Spec.Labels.example_label }}" node_name
.The text was updated successfully, but these errors were encountered: