Jinna Baalu
Jinna Baalu

Reputation: 7819

Rollingout updates in docker swarm

Created a micro service application with spring initializer and deployed using docker.

For rolling out the latest changes creating the docker image with the latest code changes

docker stack deploy -c stack.yml mystack

application is running with 2 replicas. Updating the services with docker service update.

docker service update --force service-name

Can anyone please help me with sample stack and best practice to deploy for zero downtime.

Upvotes: 3

Views: 2757

Answers (1)

Ryabchenko Alexander
Ryabchenko Alexander

Reputation: 12390

You can find nice text here https://blog.capstonec.com/2018/06/28/zero-downtime-deployment-with-docker-rolling-updates/

Below is an excerpt from the Docker reference documentation which can be found at: https://docs.docker.com/compose/compose-file/#update_config.

  • parallelism: The number of containers to update at a time.
  • delay: The time to wait between updating a group of containers.
  • failure_action: What to do if an update fails. One of continue, rollback, or pause (default: pause).
  • monitor: Duration after each task update to monitor for failure (ns|us|ms|s|m|h) (default 0s).
  • max_failure_ratio: Failure rate to tolerate during an update.
  • order: Order of operations during updates. One of stop-first (old task is stopped before starting new one), or start-first(new task is started first, and the running tasks will briefly overlap) (default stop-first) Note: Only supported for v3.4 and higher.

Upvotes: 1

Related Questions