1.约束在管理节点
placement:
constraints:
- node.role == manager
写成一行也可以
placement:
constraints: [node.role == manager]
2.约束在工作节点
placement:
constraints:
- node.role == worker
3.约束在指定节点
placement:
constraints:
- node.hostname == GZ-SWARM-86
4.约束在指定标签
节点增加标签
# app=linuxhub
docker node update --label-add app="linuxhub" GZ-SWARM-86
placement:
constraints:
- node.labels.app == linuxhub
网友评论