Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 275af80

Browse files
committed
docs: service create: use markdown table for constraints
Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit abeb7babdfb6e05760b22b931bcce84dfdcced39) Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: d5ce81172fc77134b45858b35d8e0f73f34f2714 Component: cli
1 parent 969ddd8 commit 275af80

1 file changed

Lines changed: 12 additions & 38 deletions

File tree

components/cli/docs/reference/commandline/service_create.md

Lines changed: 12 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -671,52 +671,26 @@ constraint expressions. Multiple constraints find nodes that satisfy every
671671
expression (AND match). Constraints can match node or Docker Engine labels as
672672
follows:
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

713687
For example, the following limits tasks for the redis service to nodes where the
714688
node 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

Comments
 (0)