Skip to content

An implementation of zero downtime deployment pattern using Traefik priority

Notifications You must be signed in to change notification settings

rodolpheche/bluegreen-traefik-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blue/Green deployment with Docker Swarm & Traefik

An implementation of zero downtime deployment pattern using Traefik priority

Requirements

Binaries

  • docker
  • curl

Swarm

Init cluster and create network

docker swarm init
docker network create -d overlay front-network

Getting started

Prepare workspace

git clone https://github.com/rodolpheche/bluegreen-traefik-docker
cd bluegreen-traefik-docker

Deploy Traefik

docker stack deploy -c stacks/docker-stack-http.yml http

Access http://127.0.0.1:8080 to display Traefik UI

Deploy Blue version

docker stack deploy -c stacks/docker-stack-appli-blue.yml appli-blue

Access http://127.0.0.1 to display Blue version

Launch script to check zero downtime

./bin/check-no-downtime.sh

Deploy Green version

docker stack deploy -c stacks/docker-stack-appli-green.yml appli-green

Switch from Blue to Green

docker service update --label-add "traefik.http.routers.colors-green.priority=100" appli-green_colors
docker service update --label-add "traefik.http.routers.colors-blue.priority=0" appli-blue_colors

Access http://127.0.0.1 to display green version

Clean up

docker stack rm http appli-green appli-blue

About

An implementation of zero downtime deployment pattern using Traefik priority

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages