mirror of https://github.com/docker/docs.git
update rolling update tutorial to reflect default parallelism and update on failure
Signed-off-by: Charles Smith <charles.smith@docker.com> (cherry picked from commit 6440cacd49226e97b2dcb64eb31cb32b87b1ff18) Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
parent
c46db363d6
commit
7f6a1d9fb7
|
|
@ -29,7 +29,6 @@ update delay:
|
||||||
--replicas 3 \
|
--replicas 3 \
|
||||||
--name redis \
|
--name redis \
|
||||||
--update-delay 10s \
|
--update-delay 10s \
|
||||||
--update-parallelism 1 \
|
|
||||||
redis:3.0.6
|
redis:3.0.6
|
||||||
|
|
||||||
0u6a4s31ybk7yw2wyvtikmu50
|
0u6a4s31ybk7yw2wyvtikmu50
|
||||||
|
|
@ -37,18 +36,21 @@ update delay:
|
||||||
|
|
||||||
You configure the rolling update policy at service deployment time.
|
You configure the rolling update policy at service deployment time.
|
||||||
|
|
||||||
The `--update-parallelism` flag configures the number of service tasks that
|
|
||||||
the scheduler can update simultaneously. When updates to individual tasks
|
|
||||||
return a state of `RUNNING` or `FAILED`, the scheduler schedules another
|
|
||||||
task to update until all tasks are updated.
|
|
||||||
|
|
||||||
The `--update-delay` flag configures the time delay between updates to a
|
The `--update-delay` flag configures the time delay between updates to a
|
||||||
service task or sets of tasks.
|
service task or sets of tasks. You can describe the time `T` as a
|
||||||
|
combination of the number of seconds `Ts`, minutes `Tm`, or hours `Th`. So
|
||||||
|
`10m30s` indicates a 10 minute 30 second delay.
|
||||||
|
|
||||||
You can describe the time `T` as a combination of the number of seconds
|
By default the scheduler updates 1 task at a time. You can pass the
|
||||||
`Ts`, minutes `Tm`, or hours `Th`. So `10m30s` indicates a 10 minute 30
|
`--update-parallelism` flag to configure the maximum number of service tasks
|
||||||
second delay.
|
that the scheduler updates simultaneously.
|
||||||
|
|
||||||
|
By default, when an update to an individual task returns a state of
|
||||||
|
`RUNNING`, the scheduler schedules another task to update until all tasks
|
||||||
|
are updated. If, at any time during an update a task returns `FAILED`, the
|
||||||
|
scheduler pauses the update. You can control the behavior using the
|
||||||
|
`--update-failure-action` flag for `docker service create` or
|
||||||
|
`docker service update`.
|
||||||
|
|
||||||
3. Inspect the `redis` service:
|
3. Inspect the `redis` service:
|
||||||
|
|
||||||
|
|
@ -77,13 +79,15 @@ applies the update to nodes according to the `UpdateConfig` policy:
|
||||||
redis
|
redis
|
||||||
```
|
```
|
||||||
|
|
||||||
The scheduler applies rolling updates as follows:
|
The scheduler applies rolling updates as follows by default:
|
||||||
|
|
||||||
* Stop the initial number of tasks according to `--update-parallelism`.
|
* Stop the first task.
|
||||||
* Schedule updates for the stopped tasks.
|
* Schedule update for the stopped task.
|
||||||
* Start the containers for the updated tasks.
|
* Start the container for the updated task.
|
||||||
* After an update to a task completes, wait for the specified delay
|
* If the update to a task returns `RUNNING`, wait for the
|
||||||
period before stopping the next task.
|
specified delay period then stop the next task.
|
||||||
|
* If, at any time during the update, a task returns `FAILED`, pause the
|
||||||
|
update.
|
||||||
|
|
||||||
5. Run `docker service inspect --pretty redis` to see the new image in the
|
5. Run `docker service inspect --pretty redis` to see the new image in the
|
||||||
desired state:
|
desired state:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue