I have a docker swarm with 3 replicas for service for which the deploy setup is as follows:
<code>deploy:
mode: replicated
replicas: 3
placement:
max_replicas_per_node: 1
constraints:
- node.hostname == worker-`{{.Task.Slot}}`
</code>
<code>deploy:
mode: replicated
replicas: 3
placement:
max_replicas_per_node: 1
constraints:
- node.hostname == worker-`{{.Task.Slot}}`
</code>
deploy:
mode: replicated
replicas: 3
placement:
max_replicas_per_node: 1
constraints:
- node.hostname == worker-`{{.Task.Slot}}`
I have 3 workers with hostnames like: worker-1
, worker-2
and worker-3
and I want the service.1
to be in worker-1
, service.2
to be in worker-2
, and so on.
but with the mentioned setup I get the following error:
Error response from daemon: rpc error: code = Unknown desc = value 'worker-{{.Task.Slot}}' is invalid
Any idea what is wrong and what can I do to achieve this?