Apply rolling updates to a service

Estimated reading time:
4 minutes

In a previous step of the tutorial, you scaled the number of
instances of a service. In this part of the tutorial, you deploy a service based
on the Redis 3.0.6 container tag. Then you upgrade the service to use the
Redis 3.0.7 container image using rolling updates.

If you haven’t already, open a terminal and ssh into the machine where you
run your manager node. For example, the tutorial uses a machine named
manager1.

Deploy your Redis tag to the swarm and configure the swarm with a 10 second
update delay. Note that the following example shows an older Redis tag:

The --update-delay flag configures the time delay between updates to a
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.

By default the scheduler updates 1 task at a time. You can pass the
--update-parallelism flag to configure the maximum number of service tasks
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.