From 2169ef3b2e078423c02d284bb1866b77956f63cf Mon Sep 17 00:00:00 2001 From: Aaron Lehmann Date: Fri, 14 Oct 2016 18:01:13 -0700 Subject: [PATCH] swarm: Document rollback, failure threshold, and monitor flags These are new flags to service create/update being added in a Docker engine PR. Signed-off-by: Aaron Lehmann --- engine/swarm/services.md | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/engine/swarm/services.md b/engine/swarm/services.md index ec00fba7a7..f8f774465f 100644 --- a/engine/swarm/services.md +++ b/engine/swarm/services.md @@ -266,7 +266,40 @@ $ docker service create \ 0u6a4s31ybk7yw2wyvtikmu50 ``` -### Configure mounts +The `--update-max-failure-ratio` flag controls what fraction of tasks can fail +during an update before the update as a whole is considered to have failed. For +example, with `--update-max-failure-ratio 0.1 --update-failure-action pause`, +after 10% of the tasks being updated fail, the update will be paused. + +An individual task update is considered to have failed if the task doesn't +start up, or if it stops running within the monitoring period specified with +the `--update-monitor` flag. The default value for `--update-monitor` is 30 +seconds, which means that a task failing in the first 30 seconds after its +started counts towards the service update failure threshold, and a failure +after that is not counted. + +## Roll back to the previous version of a service + +In case the updated version of a service doesn't function as expected, it's +possible to roll back to the previous version of the service using +`docker service update`'s `--rollback` flag. This will revert the service +to the configuration that was in place before the most recent +`docker service update` command. + +Other options can be combined with `--rollback`; for example, +`--update-delay 0s` to execute the rollback without a delay between tasks: + +```bash +$ docker service update \ + --rollback \ + --update-delay 0s + my_web + +my_web + +``` + +## Configure mounts You can create two types of mounts for services in a swarm, `volume` mounts or `bind` mounts. You pass the `--mount` flag when you create a service. The