I have the following in my compose file:
postgres:
deploy:
mode: global
placement:
constraints:
- node.labels.server == data
And my node has the following when I inspect it:
"Spec": {
"Labels": {
"server": "data"
},
"Role": "worker",
"Availability": "active"
},
However, when i deploy my stack postgres doesn't install anywhere...
What am I missing?
[UPDATE]
This is in the docker-compose.prod.yml btw in case you're wondering where the rest of the config is
[UPDATE]
This is running my compose as a stack across multiple servers. Using this command to fire it off:
docker stack deploy --compose-file docker-compose.yml --compose-file docker-compose.prod.yml stackname--with-registry-auth
Here is the output of ps:
root@sonatribe-1:~# docker service ps postgres --no-trunc
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
Elsewhere on other services I have stuff like this to ensure certain stuff is run on a manager node:
deploy:
mode: global
placement:
constraints:
- node.role == manager
And that works fine - it's only the one using:
node.labels.server == data
That doesn't work