From d5ce81172fc77134b45858b35d8e0f73f34f2714 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 10 Feb 2020 11:13:26 +0100 Subject: [PATCH] docs: service create: use markdown table for constraints Signed-off-by: Sebastiaan van Stijn (cherry picked from commit abeb7babdfb6e05760b22b931bcce84dfdcced39) Signed-off-by: Sebastiaan van Stijn --- docs/reference/commandline/service_create.md | 50 +++++--------------- 1 file changed, 12 insertions(+), 38 deletions(-) diff --git a/docs/reference/commandline/service_create.md b/docs/reference/commandline/service_create.md index 80c7244bd8..2f62e5560b 100644 --- a/docs/reference/commandline/service_create.md +++ b/docs/reference/commandline/service_create.md @@ -671,44 +671,18 @@ constraint expressions. Multiple constraints find nodes that satisfy every expression (AND match). Constraints can match node or Docker Engine labels as follows: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
node attributematchesexample
node.idNode IDnode.id==2ivku8v2gvtg4
node.hostnameNode hostnamenode.hostname!=node-2
node.roleNode rolenode.role==manager
node.labelsuser defined node labelsnode.labels.security==high
engine.labelsDocker Engine's labelsengine.labels.operatingsystem==ubuntu 14.04
+node attribute | matches | example +-------------------|--------------------------|----------------------------------------------- +`node.id` | Node ID | `node.id==2ivku8v2gvtg4` +`node.hostname` | Node hostname | `node.hostname!=node-2` +`node.role` | Node role | `node.role==manager` +`node.labels` | User-defined node labels | `node.labels.security==high` +`engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-14.04` -`engine.labels` apply to Docker Engine labels like operating system, -drivers, etc. Swarm administrators add `node.labels` for operational purposes by -using the [`docker node update`](node_update.md) command. +`engine.labels` apply to Docker Engine labels like operating system, drivers, +etc. Swarm administrators add `node.labels` for operational purposes by using +the [`docker node update`](node_update.md) command. For example, the following limits tasks for the redis service to nodes where the node type label equals queue: @@ -716,7 +690,7 @@ node type label equals queue: ```bash $ docker service create \ --name redis_2 \ - --constraint 'node.labels.type == queue' \ + --constraint node.labels.type==queue \ redis:3.0.6 ``` @@ -730,7 +704,7 @@ of datacenters or availability zones. The example below illustrates this: $ docker service create \ --replicas 9 \ --name redis_2 \ - --placement-pref 'spread=node.labels.datacenter' \ + --placement-pref spread=node.labels.datacenter \ redis:3.0.6 ```