When I give multiple label placement constraints and deploy the stack, the services are not running in either of the mentioned constraints.
Ex:
deploy:
mode: global
placement:
constraints:
- node.labels.type == test
- node.labels.type == prod
restart_policy:
condition: on-failure
But if I give only one constraint (any one) then it is working in that label node.
I have seen the same here. The difference is there are two kinds of constraints (node type and label) are used. But I used only one kind (label).
Is it allowed to use same kind of constraints. If it is how to use it.
Update
Ex:
deploy:
mode: global
placement:
constraints:
- node.hostname == server1
- node.hostname == server2
restart_policy:
condition: on-failure
Now this should run the service on both servers. But the service is not at all starting.