From a73be0d5a62e24e6286048f950ada3229e3d0745 Mon Sep 17 00:00:00 2001 From: Aaron Lehmann Date: Mon, 13 Feb 2017 17:00:30 -0800 Subject: [PATCH] swarm: Add note about placement preferences Docker 1.14 is adding a new feature called "placement preferences". This adds a note about them, and a pointer to the "service create" reference that explains them in detail. Signed-off-by: Aaron Lehmann --- engine/swarm/services.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/engine/swarm/services.md b/engine/swarm/services.md index a7a90fc98ad..2f561ec7095 100644 --- a/engine/swarm/services.md +++ b/engine/swarm/services.md @@ -289,7 +289,18 @@ $ docker service create \ Service constraints let you set criteria for a node to meet before the scheduler deploys a service to the node. You can apply constraints to the service based upon node attributes and metadata or engine metadata. For more -information on constraints, refer to the `docker service create` [CLI reference](/engine/reference/commandline/service_create.md). +information on constraints, refer to the `docker service create` +[CLI reference](/engine/reference/commandline/service_create.md). + +Use placement preferences to divide tasks evenly over different categories of +nodes. An example of where this may be useful is balancing tasks between +multiple datacenters or availability zones. In this case, you can use a +placement preference to spread out tasks to multiple datacenters and make the +service more resilient in the face of a localized outage. You can use +additional placement preferences to further divide tasks over groups of nodes. +For example, you can balance them over multiple racks within each datacenter. +For more information on constraints, refer to the `docker service create` +[CLI reference](/engine/reference/commandline/service_create.md). ### Reserving memory or number of CPUs for a service @@ -553,15 +564,14 @@ $ docker service create \ --name myservice \ ``` - + > **Important:** If your volume driver accepts a comma-separated list as an option, > you must escape the value from the outer CSV parser. To escape a `volume-opt`, > surround it with double quotes (`"`) and surround the entire mount parameter > with single quotes (`'`). -> +> > For example, the `local` driver accepts mount options as a comma-separated > list in the `o` parameter. This example shows the correctly to escape the list. -> > $ docker service create \ > --mount 'type=volume,src=,dst=,volume-driver=local,volume-opt=type=nfs,volume-opt=device=:,"volume-opt=o=addr=,vers=4,soft,timeo=180,bg,tcp,rw"' > --name myservice \