Run high-available web-application in the Cloud on Docker Swarm Mode. The latest Docker Engine version (1.12+) comes with interesting features that streamline setting-up new cluster and maintenance tasks for Ops. Throughout the talk engineers will learn how to set up a new Docker Swarm cluster, scale in and out and make nodes join and leave cluster in automated fashion. Furthermore single region and multi-region cluster scenarios will be discussed.
3. Who I am
● Staff Engineer at Slack
● Previously at Microsoft,
Rackspace
● 10+ years of experience as
○ Software Engineer
○ Systems Engineer
○ DevOps'in for the last 8 years
Simone Soldateschi
@soldasimo
simone.soldateschi@gmail.com
Friday: 5.50pm-6.30pm
+ during breaks
4. ● Container Orchestration Engines, COEs
● Docker Swarm Mode, why
● Cloud Infrastructure, abs
● Service Management, how
Agenda
8. The path to Docker Swarm Mode
«If you are using a Docker version prior to 1.12.0,
you can use standalone swarm,
but we recommend updating.»
https://docs.docker.com/engine/swarm/
10. Key Features
● Cluster management with Docker Engine
● Declarative service model
● Auto Scaling
● Multi-host networking
● Service Discovery
● Load balancing
● Secure by default (TLS)
● Rolling updates
● Developer oriented
18. Raft consensus
Given N managers:
● Raft tolerates up to (N-1)/2 failures.
● Raft requires a quorum of (N/2)+1 members to agree
on values proposed to the cluster.
28. A day in the life of a Docker Service
create scale rm
ls
logs rollback
ps
update
?
?
inspect
29. $ docker service create --name web -p 80:80 nginx
overall progress: 1 out of 1 tasks
1/1: running [=================================>]
verify: Service converged
Docker service
$ docker service scale web=3
web scaled to 3
overall progress: 3 out of 3 tasks
1/3: running [=================================>]
2/3: running [=================================>]
3/3: running [=================================>]
verify: Service converged
$ docker service rm web
30. A day in the life of a Docker Stack
deploy services rm
ls
?
ps
39. Demo Time
● Stand up development Swarm cluster
● Start services
● Start monitoring
● Scale and Load-test
40. Stand up Dev Swarm cluster
$ git clone
https://github.com/siso/vagrant-docker-swarm.git
$ cd vagrant-docker-swarm
$ AUTO_START_SWARM=true vagrant up
47. Lesson Learned
● Options are good. Many COEs to choose from.
● Docker Swarm Mode is great for greenfield project.
● Prototype, then automate. Don’t do both.
Hi!
Thanks for joining me. :)
My name is Simone Soldateschi.
I am going to share with you a project I worked on based on load-balanced high-available multi-region webapp with Docker Swarm.
Let’s see a screencast of a session in which webstack service scale up by doubling the number of containers 4 times, and load-test with Apache ab.
Additional content I would use to exemplify thoughts, or anticipatedly respond frequently-asked-questions.