Is it possible to specify a boolean or condition in the placement constraints of docker composes? I'm looking for something that can emulate this syntax:
services:
service1:
deploy:
placement:
constraints:
- <condition1> || <condition2>
I've looked for this, but after 1 year and 6 months, Swarm still doesn't support the 'or operation'.
Therefore, the current equivalent operation is to group all other labels except the condition into 'not equal' operations.
if you want label == (1 | 2) then..
constraints:
- label != 3
- label != 4
...
- label != n
This looks bad but is currently the only possible way in swarm.
No it is not possible. You can't do what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With