SlideShare a Scribd company logo
1 of 17
Download to read offline
Docker Swarm Mode
Learn and Share
Clarence Bakirtzidis 12/08/2016
Image credit: http://blog.arungupta.me/wp-content/uploads/2015/11/docker-swarm-logo.png
What is a Docker swarm?
• A group of Docker Hosts arranged in a cluster
• Allows for deployment of containers into the cluster without
necessarily caring about which specific hosts these containers run
on (see: “pets vs. cattle”)
• Docker 1.11 and earlier had no built in swarm capability
• A separate component, “Docker Swarm”, could be used in
conjunction with a group of Docker hosts to turn them into a swarm
What is Docker “swarm mode”?
• “Docker Engine 1.12 includes swarm mode for natively managing a cluster of Docker Engines called
a Swarm. Use the Docker CLI to create a swarm, deploy application services to a swarm, and
manage swarm behavior.” [1]
• Differences to the previous Docker Swarm include:
• Swarm mode is built-in to the Docker Engine and is simpler to setup
• Implements desired state reconciliation with better failure handling
• Built-in load-balancing of service instances with DNS service discovery
• Supports rolling updates for services
• Service is a first-class construct in the Docker Engine
• Secure by default (automatic TLS mutual authentication and encryption between nodes)
[1] https://docs.docker.com/engine/swarm
Old Docker Swarm Architecture
Image Credit: http://www.slideshare.net/Docker/docker-online-meetup-28-productionready-docker-swarm (by Alexandre Beslic)
Swarm Mode Architecture
Image Credit: https://docs.docker.com/engine/swarm/images/swarm-diagram.png
Workers communication to managers is over gRPC (HTTP/2 based)
Swarm mode concepts
• Nodes
• Managers
• Workers
• Services
• Replicated (N tasks distributed throughout cluster)
• Global (one task per host)
Swarm mode concepts
• Tasks
• the atomic unit of scheduling within a swarm
• a task is “slot” where the scheduler places a container
• Task lifecycle goes one way (not recreated after termination)
• Containers
• an isolated process that runs your app/microservice code
Service scheduling example
Image Credit: https://docs.docker.com/engine/swarm/images/services-diagram.png
Creating a swarm
• Docker CLI includes new commands:
• docker swarm init …
• Initialise the first manager (activate swarm mode)
• docker swarm join …
• Add additional managers or workers to the swarm
Managing swarm nodes
• docker node [promote|demote] …
• docker node rm …
• docker node ps …
• docker node update …
Deploying services to the swarm
• docker service create [--replicas n] [—mode replicated|global] …
• docke service inspect …
• docker service ls …
• docker service rm …
• docker service ps …
Scaling and updating services
• docker service scale SERVICE=REPLICAS [SERVICE=REPLICAS...]
• docker service update …
Maintenance support
• Docker swarm mode supporting rolling updates
• Stop the first task
• Schedule update for the stopped task
• Start the container for the updated task
• Configurable update failure action (pause, continue)
• Nodes (managers or workers) can be put into DRAIN availability
• Gracefully shuts down tasks and prevents future tasks from being schedule on node
• Creates new tasks on other available node(s) to satisfy desire state for service
Handling failures
• Failed tasks
• New tasks are automatically created on other available node(s)
• Failed nodes
• Manager
• New leader is elected if quorum of more than half of the manager nodes are available
• Manually create a new manager or promote a worker to a manager
• New tasks are automatically created on other available node(s)
• Worker
• New tasks are automatically created on other available node(s)
Demo
• https://github.com/clarenceb/swarmmode-dojo
Other features
• Distributed Application Bundles (DAB)
• Experimental feature in 1.12
• Can create via Compose 1.8: docker-compose build
• Deploy DAB via: docker stack deploy
The End
• Next steps
• Try out the Swarm mode tutorial at:

https://docs.docker.com/engine/swarm/swarm-tutorial/

More Related Content

What's hot

Going Production with Docker and Swarm
Going Production with Docker and SwarmGoing Production with Docker and Swarm
Going Production with Docker and SwarmC4Media
 
Container Orchestration with Docker Swarm
Container Orchestration with Docker SwarmContainer Orchestration with Docker Swarm
Container Orchestration with Docker SwarmFrederik Mogensen
 
Introduction to docker swarm
Introduction to docker swarmIntroduction to docker swarm
Introduction to docker swarmWalid Ashraf
 
Introction to docker swarm
Introction to docker swarmIntroction to docker swarm
Introction to docker swarmHsi-Kai Wang
 
Using Docker Swarm Mode to Deploy Service Without Loss by Dongluo Chen & Nish...
Using Docker Swarm Mode to Deploy Service Without Loss by Dongluo Chen & Nish...Using Docker Swarm Mode to Deploy Service Without Loss by Dongluo Chen & Nish...
Using Docker Swarm Mode to Deploy Service Without Loss by Dongluo Chen & Nish...Docker, Inc.
 
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) ItalyClustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) ItalyGiovanni Toraldo
 
Docker 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016]
Docker 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016]Docker 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016]
Docker 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016]Brice Argenson
 
Docker Machine & Docker Swarm
Docker Machine & Docker SwarmDocker Machine & Docker Swarm
Docker Machine & Docker SwarmGuillermo Lucero
 
Docker Swarm Introduction
Docker Swarm IntroductionDocker Swarm Introduction
Docker Swarm Introductionrajdeep
 
Docker Swarm 45-min Workshop (Mountain View Docker Meetup 2/24/2016)
Docker Swarm 45-min Workshop (Mountain View Docker Meetup 2/24/2016)Docker Swarm 45-min Workshop (Mountain View Docker Meetup 2/24/2016)
Docker Swarm 45-min Workshop (Mountain View Docker Meetup 2/24/2016)Mike Goelzer
 
Swarm - A Docker Clustering System
Swarm - A Docker Clustering SystemSwarm - A Docker Clustering System
Swarm - A Docker Clustering Systemsnrism
 
Load Balancing Apps in Docker Swarm with NGINX
Load Balancing Apps in Docker Swarm with NGINXLoad Balancing Apps in Docker Swarm with NGINX
Load Balancing Apps in Docker Swarm with NGINXNGINX, Inc.
 
Docker Swarm Meetup (15min lightning)
Docker Swarm Meetup (15min lightning)Docker Swarm Meetup (15min lightning)
Docker Swarm Meetup (15min lightning)Mike Goelzer
 
Everything you need to know about Docker
Everything you need to know about DockerEverything you need to know about Docker
Everything you need to know about DockerAlican Akkuş
 
Docker Swarm Mode Orchestration
Docker Swarm Mode OrchestrationDocker Swarm Mode Orchestration
Docker Swarm Mode OrchestrationAlican Akkuş
 
Docker Online Meetup #28: Production-Ready Docker Swarm
Docker Online Meetup #28: Production-Ready Docker SwarmDocker Online Meetup #28: Production-Ready Docker Swarm
Docker Online Meetup #28: Production-Ready Docker SwarmDocker, Inc.
 
Docker session IV: Docker Compose and Docker Swarm
Docker session IV: Docker Compose and Docker SwarmDocker session IV: Docker Compose and Docker Swarm
Docker session IV: Docker Compose and Docker SwarmDegendra Sivakoti
 

What's hot (20)

Going Production with Docker and Swarm
Going Production with Docker and SwarmGoing Production with Docker and Swarm
Going Production with Docker and Swarm
 
Docker swarm
Docker swarmDocker swarm
Docker swarm
 
Container Orchestration with Docker Swarm
Container Orchestration with Docker SwarmContainer Orchestration with Docker Swarm
Container Orchestration with Docker Swarm
 
Introduction to docker swarm
Introduction to docker swarmIntroduction to docker swarm
Introduction to docker swarm
 
Introction to docker swarm
Introction to docker swarmIntroction to docker swarm
Introction to docker swarm
 
Docker swarm reloaded
Docker swarm reloadedDocker swarm reloaded
Docker swarm reloaded
 
Using Docker Swarm Mode to Deploy Service Without Loss by Dongluo Chen & Nish...
Using Docker Swarm Mode to Deploy Service Without Loss by Dongluo Chen & Nish...Using Docker Swarm Mode to Deploy Service Without Loss by Dongluo Chen & Nish...
Using Docker Swarm Mode to Deploy Service Without Loss by Dongluo Chen & Nish...
 
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) ItalyClustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
 
Docker 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016]
Docker 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016]Docker 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016]
Docker 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016]
 
Docker Machine & Docker Swarm
Docker Machine & Docker SwarmDocker Machine & Docker Swarm
Docker Machine & Docker Swarm
 
Docker Swarm Introduction
Docker Swarm IntroductionDocker Swarm Introduction
Docker Swarm Introduction
 
Docker Swarm 45-min Workshop (Mountain View Docker Meetup 2/24/2016)
Docker Swarm 45-min Workshop (Mountain View Docker Meetup 2/24/2016)Docker Swarm 45-min Workshop (Mountain View Docker Meetup 2/24/2016)
Docker Swarm 45-min Workshop (Mountain View Docker Meetup 2/24/2016)
 
Swarm - A Docker Clustering System
Swarm - A Docker Clustering SystemSwarm - A Docker Clustering System
Swarm - A Docker Clustering System
 
What's New in Docker 1.12?
What's New in Docker 1.12?What's New in Docker 1.12?
What's New in Docker 1.12?
 
Load Balancing Apps in Docker Swarm with NGINX
Load Balancing Apps in Docker Swarm with NGINXLoad Balancing Apps in Docker Swarm with NGINX
Load Balancing Apps in Docker Swarm with NGINX
 
Docker Swarm Meetup (15min lightning)
Docker Swarm Meetup (15min lightning)Docker Swarm Meetup (15min lightning)
Docker Swarm Meetup (15min lightning)
 
Everything you need to know about Docker
Everything you need to know about DockerEverything you need to know about Docker
Everything you need to know about Docker
 
Docker Swarm Mode Orchestration
Docker Swarm Mode OrchestrationDocker Swarm Mode Orchestration
Docker Swarm Mode Orchestration
 
Docker Online Meetup #28: Production-Ready Docker Swarm
Docker Online Meetup #28: Production-Ready Docker SwarmDocker Online Meetup #28: Production-Ready Docker Swarm
Docker Online Meetup #28: Production-Ready Docker Swarm
 
Docker session IV: Docker Compose and Docker Swarm
Docker session IV: Docker Compose and Docker SwarmDocker session IV: Docker Compose and Docker Swarm
Docker session IV: Docker Compose and Docker Swarm
 

Viewers also liked

Docker meetup
Docker meetupDocker meetup
Docker meetupsyed1
 
Docker Networking - Current Status and goals of Experimental Networking
Docker Networking - Current Status and goals of Experimental NetworkingDocker Networking - Current Status and goals of Experimental Networking
Docker Networking - Current Status and goals of Experimental NetworkingSreenivas Makam
 
Lesson Learned from Using Docker Swarm at Pronto
Lesson Learned from Using Docker Swarm at ProntoLesson Learned from Using Docker Swarm at Pronto
Lesson Learned from Using Docker Swarm at ProntoKan Ouivirach, Ph.D.
 
Docker Networking – Running multi-host applications
Docker Networking – Running multi-host applicationsDocker Networking – Running multi-host applications
Docker Networking – Running multi-host applicationsChristina Rasimus
 
Docker Multi Host Networking, Rachit Arora, IBM
Docker Multi Host Networking, Rachit Arora, IBMDocker Multi Host Networking, Rachit Arora, IBM
Docker Multi Host Networking, Rachit Arora, IBMNeependra Khare
 
Orchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresOrchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresDocker, Inc.
 
Docker Networking Deep Dive
Docker Networking Deep DiveDocker Networking Deep Dive
Docker Networking Deep DiveDocker, Inc.
 

Viewers also liked (7)

Docker meetup
Docker meetupDocker meetup
Docker meetup
 
Docker Networking - Current Status and goals of Experimental Networking
Docker Networking - Current Status and goals of Experimental NetworkingDocker Networking - Current Status and goals of Experimental Networking
Docker Networking - Current Status and goals of Experimental Networking
 
Lesson Learned from Using Docker Swarm at Pronto
Lesson Learned from Using Docker Swarm at ProntoLesson Learned from Using Docker Swarm at Pronto
Lesson Learned from Using Docker Swarm at Pronto
 
Docker Networking – Running multi-host applications
Docker Networking – Running multi-host applicationsDocker Networking – Running multi-host applications
Docker Networking – Running multi-host applications
 
Docker Multi Host Networking, Rachit Arora, IBM
Docker Multi Host Networking, Rachit Arora, IBMDocker Multi Host Networking, Rachit Arora, IBM
Docker Multi Host Networking, Rachit Arora, IBM
 
Orchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresOrchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failures
 
Docker Networking Deep Dive
Docker Networking Deep DiveDocker Networking Deep Dive
Docker Networking Deep Dive
 

Similar to swarmmode-dojo

Docker-Presentation.pptx
Docker-Presentation.pptxDocker-Presentation.pptx
Docker-Presentation.pptxVipobav
 
Docker swarm
Docker swarmDocker swarm
Docker swarmKalkey
 
Up and running with docker
Up and running with dockerUp and running with docker
Up and running with dockerMichelle Liu
 
Docker Basic to Advance
Docker Basic to AdvanceDocker Basic to Advance
Docker Basic to AdvanceParas Jain
 
Docker: From Zero to Hero
Docker: From Zero to HeroDocker: From Zero to Hero
Docker: From Zero to Herofazalraja
 
Introduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxDataIntroduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxDataInfluxData
 
Docker Container Security
Docker Container SecurityDocker Container Security
Docker Container SecuritySuraj Khetani
 
Use Docker to Deliver Cognitive Services Running Cross Platform and Multi Clo...
Use Docker to Deliver Cognitive Services Running Cross Platform and Multi Clo...Use Docker to Deliver Cognitive Services Running Cross Platform and Multi Clo...
Use Docker to Deliver Cognitive Services Running Cross Platform and Multi Clo...Docker, Inc.
 
Online Meetup: What's new in docker 1.13.0
Online Meetup: What's new in docker 1.13.0 Online Meetup: What's new in docker 1.13.0
Online Meetup: What's new in docker 1.13.0 Docker, Inc.
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101Naukri.com
 

Similar to swarmmode-dojo (20)

Docker
DockerDocker
Docker
 
Docker-Presentation.pptx
Docker-Presentation.pptxDocker-Presentation.pptx
Docker-Presentation.pptx
 
Dokcer swarm
Dokcer swarmDokcer swarm
Dokcer swarm
 
Docker toolbox
Docker toolboxDocker toolbox
Docker toolbox
 
Docker swarm
Docker swarmDocker swarm
Docker swarm
 
Docker swarm
Docker swarmDocker swarm
Docker swarm
 
Docker
DockerDocker
Docker
 
Up and running with docker
Up and running with dockerUp and running with docker
Up and running with docker
 
Docker Basic to Advance
Docker Basic to AdvanceDocker Basic to Advance
Docker Basic to Advance
 
Docker introduction - Part 1
Docker introduction - Part 1Docker introduction - Part 1
Docker introduction - Part 1
 
Docker: From Zero to Hero
Docker: From Zero to HeroDocker: From Zero to Hero
Docker: From Zero to Hero
 
Introduction To Docker
Introduction To  DockerIntroduction To  Docker
Introduction To Docker
 
Introduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxDataIntroduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxData
 
Docker Container Security
Docker Container SecurityDocker Container Security
Docker Container Security
 
Use Docker to Deliver Cognitive Services Running Cross Platform and Multi Clo...
Use Docker to Deliver Cognitive Services Running Cross Platform and Multi Clo...Use Docker to Deliver Cognitive Services Running Cross Platform and Multi Clo...
Use Docker to Deliver Cognitive Services Running Cross Platform and Multi Clo...
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Online Meetup: What's new in docker 1.13.0
Online Meetup: What's new in docker 1.13.0 Online Meetup: What's new in docker 1.13.0
Online Meetup: What's new in docker 1.13.0
 
Docker slides
Docker slidesDocker slides
Docker slides
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
 
Docker-machine
Docker-machineDocker-machine
Docker-machine
 

Recently uploaded

Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 

Recently uploaded (20)

Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 

swarmmode-dojo

  • 1. Docker Swarm Mode Learn and Share Clarence Bakirtzidis 12/08/2016 Image credit: http://blog.arungupta.me/wp-content/uploads/2015/11/docker-swarm-logo.png
  • 2. What is a Docker swarm? • A group of Docker Hosts arranged in a cluster • Allows for deployment of containers into the cluster without necessarily caring about which specific hosts these containers run on (see: “pets vs. cattle”) • Docker 1.11 and earlier had no built in swarm capability • A separate component, “Docker Swarm”, could be used in conjunction with a group of Docker hosts to turn them into a swarm
  • 3. What is Docker “swarm mode”? • “Docker Engine 1.12 includes swarm mode for natively managing a cluster of Docker Engines called a Swarm. Use the Docker CLI to create a swarm, deploy application services to a swarm, and manage swarm behavior.” [1] • Differences to the previous Docker Swarm include: • Swarm mode is built-in to the Docker Engine and is simpler to setup • Implements desired state reconciliation with better failure handling • Built-in load-balancing of service instances with DNS service discovery • Supports rolling updates for services • Service is a first-class construct in the Docker Engine • Secure by default (automatic TLS mutual authentication and encryption between nodes) [1] https://docs.docker.com/engine/swarm
  • 4. Old Docker Swarm Architecture Image Credit: http://www.slideshare.net/Docker/docker-online-meetup-28-productionready-docker-swarm (by Alexandre Beslic)
  • 5. Swarm Mode Architecture Image Credit: https://docs.docker.com/engine/swarm/images/swarm-diagram.png Workers communication to managers is over gRPC (HTTP/2 based)
  • 6. Swarm mode concepts • Nodes • Managers • Workers • Services • Replicated (N tasks distributed throughout cluster) • Global (one task per host)
  • 7. Swarm mode concepts • Tasks • the atomic unit of scheduling within a swarm • a task is “slot” where the scheduler places a container • Task lifecycle goes one way (not recreated after termination) • Containers • an isolated process that runs your app/microservice code
  • 8. Service scheduling example Image Credit: https://docs.docker.com/engine/swarm/images/services-diagram.png
  • 9. Creating a swarm • Docker CLI includes new commands: • docker swarm init … • Initialise the first manager (activate swarm mode) • docker swarm join … • Add additional managers or workers to the swarm
  • 10. Managing swarm nodes • docker node [promote|demote] … • docker node rm … • docker node ps … • docker node update …
  • 11. Deploying services to the swarm • docker service create [--replicas n] [—mode replicated|global] … • docke service inspect … • docker service ls … • docker service rm … • docker service ps …
  • 12. Scaling and updating services • docker service scale SERVICE=REPLICAS [SERVICE=REPLICAS...] • docker service update …
  • 13. Maintenance support • Docker swarm mode supporting rolling updates • Stop the first task • Schedule update for the stopped task • Start the container for the updated task • Configurable update failure action (pause, continue) • Nodes (managers or workers) can be put into DRAIN availability • Gracefully shuts down tasks and prevents future tasks from being schedule on node • Creates new tasks on other available node(s) to satisfy desire state for service
  • 14. Handling failures • Failed tasks • New tasks are automatically created on other available node(s) • Failed nodes • Manager • New leader is elected if quorum of more than half of the manager nodes are available • Manually create a new manager or promote a worker to a manager • New tasks are automatically created on other available node(s) • Worker • New tasks are automatically created on other available node(s)
  • 16. Other features • Distributed Application Bundles (DAB) • Experimental feature in 1.12 • Can create via Compose 1.8: docker-compose build • Deploy DAB via: docker stack deploy
  • 17. The End • Next steps • Try out the Swarm mode tutorial at:
 https://docs.docker.com/engine/swarm/swarm-tutorial/