Skip to content

Commit d8bdf4e

Browse files
committed
docs(service create): note global mode still honors constraints
A global service is one task per matching node, not one per node in the swarm. Say that next to --mode and --constraint. Fixes #592 Signed-off-by: Dean Chen <862469039@qq.com>
1 parent 8659aa5 commit d8bdf4e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

docs/reference/commandline/service_create.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,9 @@ $ docker service create \
676676

677677
The service mode determines whether this is a _replicated_ service or a _global_
678678
service. A replicated service runs as many tasks as specified, while a global
679-
service runs on each active node in the swarm.
679+
service runs one task on each active node in the swarm. Placement
680+
`--constraint` expressions still apply: a global service only schedules
681+
that task on nodes that match, not on every node.
680682

681683
The following command creates a global service:
682684

@@ -690,7 +692,8 @@ $ docker service create \
690692
### <a name="constraint"></a> Specify service constraints (--constraint)
691693

692694
You can limit the set of nodes where a task can be scheduled by defining
693-
constraint expressions. Constraint expressions can either use a _match_ (`==`)
695+
constraint expressions. They apply to both replicated and global services
696+
(and to jobs). Constraint expressions can either use a _match_ (`==`)
694697
or _exclude_ (`!=`) rule. Multiple constraints find nodes that satisfy every
695698
expression (AND match). Constraints can match node or Docker Engine labels as
696699
follows:

0 commit comments

Comments
 (0)