swarmkit
swarmkit copied to clipboard
Implement control-plane placement templating
- What I did
First pass on implementing templating of tasks for placement purposes. When combined with multiple nodes nodes labeled like srv=1, srv=2, allows for pinning of individual instances to nodes like so:
services:
srv:
deploy:
replicas: 2
placement:
constraints:
- node.labels.srv=={{Task.Slot}}
- How I did it Re-uses the most of the existing templating code, not sure about where to template the task struct though.
- How to test it Actually no idea. Open to suggestions how to make this production-level code instead of an experiment.
- Description for the changelog Added support for partial templates in placement constraints.