@@ -671,52 +671,26 @@ constraint expressions. Multiple constraints find nodes that satisfy every
671671expression (AND match). Constraints can match node or Docker Engine labels as
672672follows:
673673
674+ node attribute | matches | example
675+ -------------------|--------------------------|-----------------------------------------------
676+ ` node.id ` | Node ID | ` node.id==2ivku8v2gvtg4 `
677+ ` node.hostname ` | Node hostname | ` node.hostname!=node-2 `
678+ ` node.role ` | Node role | ` node.role==manager `
679+ ` node.labels ` | User-defined node labels | ` node.labels.security==high `
680+ ` engine.labels ` | Docker Engine's labels | ` engine.labels.operatingsystem==ubuntu-14.04 `
674681
675- <table >
676- <tr >
677- <th>node attribute</th>
678- <th>matches</th>
679- <th>example</th>
680- </tr >
681- <tr >
682- <td><tt>node.id</tt></td>
683- <td>Node ID</td>
684- <td><tt>node.id==2ivku8v2gvtg4</tt></td>
685- </tr >
686- <tr >
687- <td><tt>node.hostname</tt></td>
688- <td>Node hostname</td>
689- <td><tt>node.hostname!=node-2</tt></td>
690- </tr >
691- <tr >
692- <td><tt>node.role</tt></td>
693- <td>Node role</td>
694- <td><tt>node.role==manager</tt></td>
695- </tr >
696- <tr >
697- <td><tt>node.labels</tt></td>
698- <td>user defined node labels</td>
699- <td><tt>node.labels.security==high</tt></td>
700- </tr >
701- <tr >
702- <td><tt>engine.labels</tt></td>
703- <td>Docker Engine's labels</td>
704- <td><tt>engine.labels.operatingsystem==ubuntu 14.04</tt></td>
705- </tr >
706- </table >
707682
708-
709- ` engine.labels ` apply to Docker Engine labels like operating system,
710- drivers, etc. Swarm administrators add ` node.labels ` for operational purposes by
711- using the [ ` docker node update ` ] ( node_update.md ) command.
683+ ` engine.labels ` apply to Docker Engine labels like operating system, drivers,
684+ etc. Swarm administrators add ` node.labels ` for operational purposes by using
685+ the [ ` docker node update ` ] ( node_update.md ) command.
712686
713687For example, the following limits tasks for the redis service to nodes where the
714688node type label equals queue:
715689
716690``` bash
717691$ docker service create \
718692 --name redis_2 \
719- --constraint ' node.labels.type == queue' \
693+ --constraint node.labels.type== queue \
720694 redis:3.0.6
721695```
722696
@@ -730,7 +704,7 @@ of datacenters or availability zones. The example below illustrates this:
730704$ docker service create \
731705 --replicas 9 \
732706 --name redis_2 \
733- --placement-pref ' spread=node.labels.datacenter' \
707+ --placement-pref spread=node.labels.datacenter \
734708 redis:3.0.6
735709```
736710
0 commit comments