SlideShare a Scribd company logo
THE STATE OF THE SWARM
HOW CLOSE TO PRODUCTION READY ARE WE ?
7 / 1 /2016
HI
▸ Mathieu Buffenoir
▸ twitter://@MBuffenoir
▸ mail://mat.buff@gmail.com
▸ founder bity.com (running on docker on exoscale)
▸ VP swiss bitcoin association
▸ https://github.com/skippbox/docker-on-cluster-howtos
WHAT’S NEW IN DOCKER ECOSYSTEM ?
▸ Docker 1.9
▸ Networking in the swarm
▸ Compose 1.5
▸ environnement variable
▸ Docker-machine
▸ Added cloud providers support
WHAT DO WE NEED IN PRODUCTION ?
▸ Provisioning / orchestration (Swarm)
▸ Service discovery (consul / etc / zookeeper …)
▸ Logging (ELK, Loggly , syslog …)
▸ Monitoring (Promotheus, sensu, sysdig …)
LET’S CREATE A LITTLE DEMO
INFRASTRUCTURE
DEMO INFRA
DOCKER MACHINE
▸ cloud provider drivers (12 as of today) or bare
metal
▸ some handy features
▸ ssh / scp
▸ One command to control your node or cluster
directly from your shell:
▸ eval $(docker-machine env --swarm swarm-
master)
▸ docker ps
ONE COMMAND TO CREATE A CLUSTER NODE
docker-machine create --driver exoscale 
--exoscale-api-key $CLOUDSTACK_KEY 
--exoscale-api-secret-key $CLOUDSTACK_SECRET_KEY 
--exoscale-instance-profile small 
--exoscale-disk-size 10 
--exoscale-image ubuntu-14.04 
--exoscale-security-group swarm 
--swarm 
--swarm-master 
--swarm-discovery="consul://$(docker-machine ip consul):8500" 
--engine-opt="cluster-store=consul://$(docker-machine ip consul):8500" 
--engine-opt="cluster-advertise=eth0:2376" 
--engine-label="apps" 
swarm-master
KV STORE (CONSUL)
▸ Consul
▸ services
▸ nodes
▸ key-value
▸ multi-datacenter
▸ health- check
▸ REST or DNS api
COMPOSE FEATURES
▸ control your cluster straight from your shell
▸ networking support
▸ environment variables
▸ support for docker log driver
▸ scaling
▸ filters
The node filters are:
constraint
health
The container configuration filters are:
affinity
dependency
port
OUR DEMO INFRA COMPOSE FILE
ghost:
image: ghost
restart: always
ports:
- 2368
volumes:
- /home/ubuntu/conf-files/
config.js:/var/lib/ghost/config.js
environment:
- DB_URI=swarm_db_1
- NODE_ENV=production
log_driver: "syslog"
log_opt:
syslog-address: "udp://
185.19.29.213:5000"
syslog-tag: "ghost"
db:
image: postgres:9.3
restart: always
environment:
DB_PASSWORD: postgres
DB_USER: postgres
DB_NAME: ghost
ports:
- 5432
lb:
image: lalu/haproxy-consul
restart: always
volumes:
- /home/ubuntu/conf-files/
haproxy.ctmpl:/tmp/haproxy.ctmpl
- /home/ubuntu/conf-files/consule-
template.conf:/tmp/consule-
template.conf
ports:
- "80:80"
- "8001:8001"
command: -consul 185.19.29.213:8500
COMPOSE COMMANDS
▸ docker-compose up (-d) <container>
▸ docker-compose stop / start / restart <container>
▸ docker-compose ps
▸ docker-compose logs
OVERLAY NETWORK
▸ /etc/hosts
▸ dns with consul
▸ Kernel >3.16
▸ - udp 4789 Data plane (VXLAN)
▸ - tcp/udp 7946 Control plane
▸ no more links support (use service discovery)
▸ need to run compose with —x-networking argument
SERVICE DISCOVERY
▸ registrator informs consul when services come on/offline
▸ patch to support overlay network (now merged)
▸ currently support only one network
SCALING
COMPOSE
▸ As simple as:
▸ docker-compose —x-networking scale app=5
CONSUL-TEMPLATE
▸official haproxy image extended with consul-
template
#templating system snippet
backend ghost
option forwardfor # add the X-Forwarded-For header
http-request set-header X-Forwarded-Port %[dst_port]
balance roundrobin{{range service "ghost"}}
server {{.ID}} {{.Address}}:{{.Port}}{{end}}
LOGGING
EASILY SET UP AN ELK WITH COMPOSE
▸ docker-compose up -d
▸ add this in your docker-compose.ml file service definition
log_driver: "syslog"
log_opt:
syslog-address: "udp://185.19.29.213:5000"
syslog-tag: "ghost"
MONITORING
CADVISOR
▸ Collect per host container metrics
▸ Some visualisations
▸ not centralised enough
PROMOTHEUS
▸ Graphing



▸ Alerting
ALERT HighMemoryAlert
IF container_memory_usage_bytes{image="ubuntu:14.04"} > 1000000000
FOR 1m
WITH {}
SUMMARY "High Memory usage for Ubuntu container"
DESCRIPTION "High Memory usage for Ubuntu container on {{$labels.instance}} for
container {{$labels.name}} (current value: {{$value}})"
WHAT IS STILL MISSING ?
▸ secret handling
▸ ansible vault
▸ hashicorp vault
▸ Lots of discussion about this on github
▸ Discovery service with multiple overlay network support
▸ support for multiple networks in consul (not sure if it can be achieved
with competitors either yet)
▸ Support in provisioning docker module (Ansible is really good with that)
THANKS TO
▸ Exoscale
▸ hashicorp
▸ gliderlabs
▸ sirile
▸ progrium
▸ Docker for all the tools
QUESTIONS ?
@MBUFFENOIR
https://github.com/skippbox/docker-on-cluster-howtos

More Related Content

PPTX
Intro- Docker Native for OSX and Windows
Thomas Chacko
 
PPTX
Architecting .NET Applications for Docker and Container Based Deployments
Ben Hall
 
PDF
Ansible docker
QNIB Solutions
 
PPTX
Docker 1.11 Presentation
Sreenivas Makam
 
PDF
Developer workflow with docker
Lalatendu Mohanty
 
PDF
Docker 101 - from 0 to Docker in 30 minutes
Luciano Fiandesio
 
PDF
Docker - introduction
Michał Kurzeja
 
PDF
Docker From Scratch
Giacomo Vacca
 
Intro- Docker Native for OSX and Windows
Thomas Chacko
 
Architecting .NET Applications for Docker and Container Based Deployments
Ben Hall
 
Ansible docker
QNIB Solutions
 
Docker 1.11 Presentation
Sreenivas Makam
 
Developer workflow with docker
Lalatendu Mohanty
 
Docker 101 - from 0 to Docker in 30 minutes
Luciano Fiandesio
 
Docker - introduction
Michał Kurzeja
 
Docker From Scratch
Giacomo Vacca
 

What's hot (20)

PDF
Docker 101 @KACST Saudi HPC 2016
Walid Shaari
 
PDF
Docker Started
Victor S. Recio
 
PDF
Running Docker with OpenStack | Docker workshop #1
dotCloud
 
PDF
Bare Metal to OpenStack with Razor and Chef
Matt Ray
 
PDF
Docker - From Walking To Running
Giacomo Vacca
 
PPTX
Docker Networking - Common Issues and Troubleshooting Techniques
Sreenivas Makam
 
PDF
Docker Introduction
Robert Reiz
 
ODP
Docker - The Linux Container
Balaji Rajan
 
PDF
Docker Introduction
Sparkbit
 
PDF
Docker Introduction
MANAOUIL Karim
 
PDF
Docker by Example - Basics
Ganesh Samarthyam
 
PDF
Introduction to docker
Justyna Ilczuk
 
PDF
Docker introduction
Layne Peng
 
PDF
Docker
Chen Chun
 
PDF
A Hands-on Introduction to Docker
CodeOps Technologies LLP
 
PDF
Containers: The What, Why, and How
Sneha Inguva
 
PDF
Infrastructure Deployment with Docker & Ansible
Robert Reiz
 
PPTX
Docker Machine & Docker Swarm
Guillermo Lucero
 
PDF
Docker and Containers for Development and Deployment — SCALE12X
Jérôme Petazzoni
 
PDF
A Gentle Introduction To Docker And All Things Containers
Jérôme Petazzoni
 
Docker 101 @KACST Saudi HPC 2016
Walid Shaari
 
Docker Started
Victor S. Recio
 
Running Docker with OpenStack | Docker workshop #1
dotCloud
 
Bare Metal to OpenStack with Razor and Chef
Matt Ray
 
Docker - From Walking To Running
Giacomo Vacca
 
Docker Networking - Common Issues and Troubleshooting Techniques
Sreenivas Makam
 
Docker Introduction
Robert Reiz
 
Docker - The Linux Container
Balaji Rajan
 
Docker Introduction
Sparkbit
 
Docker Introduction
MANAOUIL Karim
 
Docker by Example - Basics
Ganesh Samarthyam
 
Introduction to docker
Justyna Ilczuk
 
Docker introduction
Layne Peng
 
Docker
Chen Chun
 
A Hands-on Introduction to Docker
CodeOps Technologies LLP
 
Containers: The What, Why, and How
Sneha Inguva
 
Infrastructure Deployment with Docker & Ansible
Robert Reiz
 
Docker Machine & Docker Swarm
Guillermo Lucero
 
Docker and Containers for Development and Deployment — SCALE12X
Jérôme Petazzoni
 
A Gentle Introduction To Docker And All Things Containers
Jérôme Petazzoni
 
Ad

Similar to The state of the swarm (20)

PDF
Tensorflow in Docker
Eric Ahn
 
PDF
From zero to Docker
Giovanni Toraldo
 
PDF
Introduction to Docker & CoreOS - Symfony User Group Cologne
D
 
PDF
Containerizing Web Application with Docker
msyukor
 
PPTX
Introction to docker swarm
Hsi-Kai Wang
 
PPTX
Real World Experience of Running Docker in Development and Production
Ben Hall
 
PDF
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Partner S.A.
 
PPTX
Introduction to docker
Christophe Muller
 
PDF
Hybrid (Windows + Linux) Apps with Docker Swarm
Runcy Oommen
 
PDF
Introducing Docker
Francesco Pantano
 
PDF
Things I've learned working with Docker Support
Sujay Pillai
 
PDF
Workshop Consul .- Service Discovery & Failure Detection
Vincent Composieux
 
PDF
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
Leo Lorieri
 
PPTX
Docker workshop
Evans Ye
 
PDF
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
謝 宗穎
 
PPTX
Introduction to Docker
Kevin Littlejohn
 
PPTX
Continuous delivery with docker
Johan Janssen
 
PDF
Kubernetes laravel and kubernetes
William Stewart
 
PPTX
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
NLJUG
 
PDF
Docker 0.11 at MaxCDN meetup in Los Angeles
Jérôme Petazzoni
 
Tensorflow in Docker
Eric Ahn
 
From zero to Docker
Giovanni Toraldo
 
Introduction to Docker & CoreOS - Symfony User Group Cologne
D
 
Containerizing Web Application with Docker
msyukor
 
Introction to docker swarm
Hsi-Kai Wang
 
Real World Experience of Running Docker in Development and Production
Ben Hall
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Partner S.A.
 
Introduction to docker
Christophe Muller
 
Hybrid (Windows + Linux) Apps with Docker Swarm
Runcy Oommen
 
Introducing Docker
Francesco Pantano
 
Things I've learned working with Docker Support
Sujay Pillai
 
Workshop Consul .- Service Discovery & Failure Detection
Vincent Composieux
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
Leo Lorieri
 
Docker workshop
Evans Ye
 
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
謝 宗穎
 
Introduction to Docker
Kevin Littlejohn
 
Continuous delivery with docker
Johan Janssen
 
Kubernetes laravel and kubernetes
William Stewart
 
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
NLJUG
 
Docker 0.11 at MaxCDN meetup in Los Angeles
Jérôme Petazzoni
 
Ad

Recently uploaded (20)

PPTX
Blue and Dark Blue Modern Technology Presentation.pptx
ap177979
 
PPTX
The Latest Scam Shocking the USA in 2025.pptx
onlinescamreport4
 
PPT
Transformaciones de las funciones elementales.ppt
rirosel211
 
PDF
Slides: PDF Eco Economic Epochs for World Game (s) pdf
Steven McGee
 
PDF
KIPER4D situs Exclusive Game dari server Star Gaming Asia
hokimamad0
 
PPTX
办理方法西班牙假毕业证蒙德拉贡大学成绩单MULetter文凭样本
xxxihn4u
 
PPTX
dns domain name system history work.pptx
MUHAMMADKAVISHSHABAN
 
PPTX
谢尔丹学院毕业证购买|Sheridan文凭不见了怎么办谢尔丹学院成绩单
mookxk3
 
PPTX
The Internet of Things (IoT) refers to a vast network of interconnected devic...
chethana8182
 
PDF
BGP Security Best Practices that Matter, presented at PHNOG 2025
APNIC
 
PPTX
Crypto Recovery California Services.pptx
lionsgate network
 
PPTX
AI ad its imp i military life read it ag
ShwetaBharti31
 
PPTX
Google SGE SEO: 5 Critical Changes That Could Wreck Your Rankings in 2025
Reversed Out Creative
 
PDF
DNSSEC Made Easy, presented at PHNOG 2025
APNIC
 
PPTX
B2B_Ecommerce_Internship_Simranpreet.pptx
LipakshiJindal
 
PPTX
LESSON-2-Roles-of-ICT-in-Teaching-for-learning_123922 (1).pptx
renavieramopiquero
 
PPTX
Different Generation Of Computers .pptx
divcoder9507
 
PDF
Data Protection & Resilience in Focus.pdf
AmyPoblete3
 
PDF
Latest Scam Shocking the USA in 2025.pdf
onlinescamreport4
 
PPTX
Parallel & Concurrent ...
yashpavasiya892
 
Blue and Dark Blue Modern Technology Presentation.pptx
ap177979
 
The Latest Scam Shocking the USA in 2025.pptx
onlinescamreport4
 
Transformaciones de las funciones elementales.ppt
rirosel211
 
Slides: PDF Eco Economic Epochs for World Game (s) pdf
Steven McGee
 
KIPER4D situs Exclusive Game dari server Star Gaming Asia
hokimamad0
 
办理方法西班牙假毕业证蒙德拉贡大学成绩单MULetter文凭样本
xxxihn4u
 
dns domain name system history work.pptx
MUHAMMADKAVISHSHABAN
 
谢尔丹学院毕业证购买|Sheridan文凭不见了怎么办谢尔丹学院成绩单
mookxk3
 
The Internet of Things (IoT) refers to a vast network of interconnected devic...
chethana8182
 
BGP Security Best Practices that Matter, presented at PHNOG 2025
APNIC
 
Crypto Recovery California Services.pptx
lionsgate network
 
AI ad its imp i military life read it ag
ShwetaBharti31
 
Google SGE SEO: 5 Critical Changes That Could Wreck Your Rankings in 2025
Reversed Out Creative
 
DNSSEC Made Easy, presented at PHNOG 2025
APNIC
 
B2B_Ecommerce_Internship_Simranpreet.pptx
LipakshiJindal
 
LESSON-2-Roles-of-ICT-in-Teaching-for-learning_123922 (1).pptx
renavieramopiquero
 
Different Generation Of Computers .pptx
divcoder9507
 
Data Protection & Resilience in Focus.pdf
AmyPoblete3
 
Latest Scam Shocking the USA in 2025.pdf
onlinescamreport4
 
Parallel & Concurrent ...
yashpavasiya892
 

The state of the swarm

  • 1. THE STATE OF THE SWARM HOW CLOSE TO PRODUCTION READY ARE WE ? 7 / 1 /2016
  • 2. HI ▸ Mathieu Buffenoir ▸ twitter://@MBuffenoir ▸ mail://[email protected] ▸ founder bity.com (running on docker on exoscale) ▸ VP swiss bitcoin association ▸ https://github.com/skippbox/docker-on-cluster-howtos
  • 3. WHAT’S NEW IN DOCKER ECOSYSTEM ? ▸ Docker 1.9 ▸ Networking in the swarm ▸ Compose 1.5 ▸ environnement variable ▸ Docker-machine ▸ Added cloud providers support
  • 4. WHAT DO WE NEED IN PRODUCTION ? ▸ Provisioning / orchestration (Swarm) ▸ Service discovery (consul / etc / zookeeper …) ▸ Logging (ELK, Loggly , syslog …) ▸ Monitoring (Promotheus, sensu, sysdig …)
  • 5. LET’S CREATE A LITTLE DEMO INFRASTRUCTURE
  • 7. DOCKER MACHINE ▸ cloud provider drivers (12 as of today) or bare metal ▸ some handy features ▸ ssh / scp ▸ One command to control your node or cluster directly from your shell: ▸ eval $(docker-machine env --swarm swarm- master) ▸ docker ps
  • 8. ONE COMMAND TO CREATE A CLUSTER NODE docker-machine create --driver exoscale --exoscale-api-key $CLOUDSTACK_KEY --exoscale-api-secret-key $CLOUDSTACK_SECRET_KEY --exoscale-instance-profile small --exoscale-disk-size 10 --exoscale-image ubuntu-14.04 --exoscale-security-group swarm --swarm --swarm-master --swarm-discovery="consul://$(docker-machine ip consul):8500" --engine-opt="cluster-store=consul://$(docker-machine ip consul):8500" --engine-opt="cluster-advertise=eth0:2376" --engine-label="apps" swarm-master
  • 9. KV STORE (CONSUL) ▸ Consul ▸ services ▸ nodes ▸ key-value ▸ multi-datacenter ▸ health- check ▸ REST or DNS api
  • 10. COMPOSE FEATURES ▸ control your cluster straight from your shell ▸ networking support ▸ environment variables ▸ support for docker log driver ▸ scaling ▸ filters The node filters are: constraint health The container configuration filters are: affinity dependency port
  • 11. OUR DEMO INFRA COMPOSE FILE ghost: image: ghost restart: always ports: - 2368 volumes: - /home/ubuntu/conf-files/ config.js:/var/lib/ghost/config.js environment: - DB_URI=swarm_db_1 - NODE_ENV=production log_driver: "syslog" log_opt: syslog-address: "udp:// 185.19.29.213:5000" syslog-tag: "ghost" db: image: postgres:9.3 restart: always environment: DB_PASSWORD: postgres DB_USER: postgres DB_NAME: ghost ports: - 5432 lb: image: lalu/haproxy-consul restart: always volumes: - /home/ubuntu/conf-files/ haproxy.ctmpl:/tmp/haproxy.ctmpl - /home/ubuntu/conf-files/consule- template.conf:/tmp/consule- template.conf ports: - "80:80" - "8001:8001" command: -consul 185.19.29.213:8500
  • 12. COMPOSE COMMANDS ▸ docker-compose up (-d) <container> ▸ docker-compose stop / start / restart <container> ▸ docker-compose ps ▸ docker-compose logs
  • 13. OVERLAY NETWORK ▸ /etc/hosts ▸ dns with consul ▸ Kernel >3.16 ▸ - udp 4789 Data plane (VXLAN) ▸ - tcp/udp 7946 Control plane ▸ no more links support (use service discovery) ▸ need to run compose with —x-networking argument
  • 14. SERVICE DISCOVERY ▸ registrator informs consul when services come on/offline ▸ patch to support overlay network (now merged) ▸ currently support only one network
  • 16. COMPOSE ▸ As simple as: ▸ docker-compose —x-networking scale app=5
  • 17. CONSUL-TEMPLATE ▸official haproxy image extended with consul- template #templating system snippet backend ghost option forwardfor # add the X-Forwarded-For header http-request set-header X-Forwarded-Port %[dst_port] balance roundrobin{{range service "ghost"}} server {{.ID}} {{.Address}}:{{.Port}}{{end}}
  • 19. EASILY SET UP AN ELK WITH COMPOSE ▸ docker-compose up -d ▸ add this in your docker-compose.ml file service definition log_driver: "syslog" log_opt: syslog-address: "udp://185.19.29.213:5000" syslog-tag: "ghost"
  • 21. CADVISOR ▸ Collect per host container metrics ▸ Some visualisations ▸ not centralised enough
  • 22. PROMOTHEUS ▸ Graphing
 
 ▸ Alerting ALERT HighMemoryAlert IF container_memory_usage_bytes{image="ubuntu:14.04"} > 1000000000 FOR 1m WITH {} SUMMARY "High Memory usage for Ubuntu container" DESCRIPTION "High Memory usage for Ubuntu container on {{$labels.instance}} for container {{$labels.name}} (current value: {{$value}})"
  • 23. WHAT IS STILL MISSING ? ▸ secret handling ▸ ansible vault ▸ hashicorp vault ▸ Lots of discussion about this on github ▸ Discovery service with multiple overlay network support ▸ support for multiple networks in consul (not sure if it can be achieved with competitors either yet) ▸ Support in provisioning docker module (Ansible is really good with that)
  • 24. THANKS TO ▸ Exoscale ▸ hashicorp ▸ gliderlabs ▸ sirile ▸ progrium ▸ Docker for all the tools