SlideShare a Scribd company logo
Walid AshrafResearcher , Software Developer, Instructor
about.me/WalidAshraf
INTRODUCTION TO DOCKER
SWARM
Docker Swarm - Walid Ashraf
Docker Basic Architecture
 Native Client
 UCP
 Third party
Docker Swarm - Walid Ashraf
INTRODUCTION TO
DOCKER SWARM
Docker Swarm - Walid Ashraf
Docker Swarm - Walid Ashraf
What is Swarm
Docker Swarm is native clustering for Docker.
• It turns a pool of Docker hosts into a single, virtual Docker host.
Docker Swarm serves the standard Docker API, any tool that already
communicates with a Docker daemon can use Swarm to transparently scale
to multiple hosts.
Docker Swarm - Walid Ashraf
Docker Swarm - Walid Ashraf
Docker Discovery Service
A key Value store for configurations
Defaults to a hosted discovery service with Docker Swarm.
The service maintains a list of IPs in your cluster. This page describes the different types of hosted discovery available to you.
Discovery service replacements (Libkv abstraction):
• Consul
• Etcd
• ZooKeeper
Should be replicated
Docker Swarm - Walid Ashraf
Swarm Manager
It’s the cluster admin or master
All communications with nodes passes through it
Supports HA
• 1 Primary (the Actual Admin)
• Multiple Secondary Managers (Transfers to primary)
• In case of primary failure (leader election occurs)
Docker Swarm - Walid Ashraf
How this works
The Manager deploys the required services (Containers) to a host(s) based on the configurations.
The Manager checks with the discovery service for available nodes
The Client Issue a command to the swarm manager
Docker Swarm - Walid Ashraf
Filtering:
The ability to mask some of the nodes
Constraints
•node to refer to the node by ID or name
•storagedriver
•executiondriver
•kernelversion
•operatingsystem
Resources
•Containerslots Number of containers on a host
•Port
Containers
•Affinity filters
•container name or id
•an image on the host
•a custom label applied to the container
•Depencecy
Docker Swarm - Walid Ashraf
Scheduling
Random
Spread
• Default
• Least no of containers
• CPU and RAM aware
Binpack
• Most no of containers
• CPU and RAM aware
Docker Swarm - Walid Ashraf
CREATING SWARM
INFRASTRUCTURE
Docker Swarm - Walid Ashraf
1 – Create Master
docker swarm init --advertise-addr <MANAGER-IP>
$ docker swarm init --advertise-addr 192.168.99.100
docker info
Swarm: active
NodeID: dxn1zf6l61qsb1josjja83ngz
Is Manager: true
Managers: 1
Nodes: 1
docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
dxn1zf6l61qsb1josjja83ngz * manager1 Ready Active Leader
Docker Swarm - Walid Ashraf
2 – Add Nodes
$ docker swarm join  --token SWMTKN-1-
49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c
 192.168.99.100:2377
Docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
03g1y59jwfg7cf99w4lt0f662 worker2 Ready Active
9j68exjopxe7wfl6yuxml7a7j worker1 Ready Active
dxn1zf6l61qsb1josjja83ngz * manager1 Ready Active Leader
Docker Swarm - Walid Ashraf
DEPLOYING A
SERVICE
Docker Swarm - Walid Ashraf
What is a service
A service is a container in swarm mode.
Examples of services might include an HTTP server, a database, or any other type of
executable program that you wish to run in a distributed environment.
Things to be configured in a service
The port where the swarm will make the service available outside the swarm
An overlay network for the service to connect to other services in the swarm
CPU and memory limits and reservations
A rolling update policy
The number of replicas of the image to run in the swarm
Docker Swarm - Walid Ashraf
Docker Swarm - Walid Ashraf
Replicated and global services
Docker Swarm - Walid Ashraf
Creating a service
$docker service create --replicas 1 --name helloworld alpine ping docker.com
$ docker service ls
•ID NAME SCALE IMAGE COMMAND
•9uk4639qpg7n helloworld 1/1 alpine ping docker.com
$ docker service inspect --pretty helloworld
•ID: 9uk4639qpg7npwf3fn2aasksr
•Name: helloworld
•Mode: REPLICATED
•Replicas: 1
•Placement:
•UpdateConfig:
•Parallelism: 1
•ContainerSpec:
•Image: alpine
•Args: ping docker.com
$ docker service ps helloworld
•ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
•8p1vev3fq5zm0mi8g0as41w35 helloworld.1 helloworld alpine Running 3 minutes Running worker2
Docker Swarm - Walid Ashraf
Scaling a service
$ docker service scale helloworld=5
$ docker service ps helloworld
ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE
8p1vev3fq5zm0mi8g0as41w35 helloworld.1 helloworld alpine Running 7 minutes Running worker2
c7a7tcdq5s0uk3qr88mf8xco6 helloworld.2 helloworld alpine Running 24 seconds Running worker1
6crl09vdcalvtfehfh69ogfb1 helloworld.3 helloworld alpine Running 24 seconds Running worker1
auky6trawmdlcne8ad8phb0f1 helloworld.4 helloworld alpine Running 24 seconds Accepted manager1
ba19kca06l18zujfwxyc5lkyn helloworld.5 helloworld alpine Running 24 seconds Running worker2
Docker Swarm - Walid Ashraf
Delete a service
$ docker service rm helloworld
helloworld
High Availability
Security
OTHER CONSIDERATIONS
Docker Swarm - Walid Ashraf
Thinking about High Availability
Docker Swarm - Walid Ashraf
HA over Multiple clouds 
Docker Swarm - Walid Ashraf
Implementing High Availability
Note: Default Discovery service needs a key value configuration manager
Manager1
swarm manage -H :4000 <tls-config-flags> --replication --advertise 192.168.42.200:4000
consul://192.168.42.10:8500/nodes
Manager 2
swarm manage -H :4000 <tls-config-flags> --replication --advertise 192.168.42.201:4000
consul://192.168.42.10:8500/nodes
Docker Swarm - Walid Ashraf
TLS for Docker Swarm
Docker Swarm - Walid Ashraf
References
https://docs.docker.com/swarm/
https://docs.docker.com/engine/swarm/swarm-tutorial
Docker Swarm - Walid Ashraf

More Related Content

PPTX
Docker introduction
dotCloud
 
PDF
Kubernetes Networking
CJ Cullen
 
PPTX
Kubernetes presentation
GauranG Bajpai
 
PDF
Kubernetes - introduction
Sparkbit
 
PDF
Midi technique - présentation docker
Olivier Eeckhoutte
 
PDF
Kubernetes vs Docker Swarm | Container Orchestration War | Kubernetes Trainin...
Edureka!
 
PDF
How VXLAN works on Linux
Etsuji Nakai
 
PPTX
Docker Networking Overview
Sreenivas Makam
 
Docker introduction
dotCloud
 
Kubernetes Networking
CJ Cullen
 
Kubernetes presentation
GauranG Bajpai
 
Kubernetes - introduction
Sparkbit
 
Midi technique - présentation docker
Olivier Eeckhoutte
 
Kubernetes vs Docker Swarm | Container Orchestration War | Kubernetes Trainin...
Edureka!
 
How VXLAN works on Linux
Etsuji Nakai
 
Docker Networking Overview
Sreenivas Makam
 

What's hot (20)

PDF
OpenShift Overview
roundman
 
PDF
Docker and Kubernetes 101 workshop
Sathish VJ
 
PPTX
DevOps with Kubernetes
EastBanc Tachnologies
 
PDF
Docker Containers Deep Dive
Will Kinard
 
PDF
Podman Overview and internals.pdf
Saim Safder
 
PDF
Introduction to docker
Walid Ashraf
 
PDF
Containerd + buildkit breakout
Docker, Inc.
 
PPTX
Kubernates vs Openshift: What is the difference and comparison between Opensh...
jeetendra mandal
 
PDF
Docker Introduction
Peng Xiao
 
PDF
Kubernetes - A Comprehensive Overview
Bob Killen
 
PPTX
Container Orchestration with Docker Swarm and Kubernetes
Will Hall
 
PDF
Présentation docker et kubernetes
Kiwi Backup
 
PDF
DevJam 2019 - Introduction to Kubernetes
Ronny Trommer
 
PDF
Introduction to Docker - VIT Campus
Ajeet Singh Raina
 
PPT
Docker introduction
Phuc Nguyen
 
PDF
Red Hat OpenShift Container Platform Overview
James Falkner
 
PPTX
Kubernetes 101
Vishwas N
 
PPTX
Ceph Introduction 2017
Karan Singh
 
PDF
Getting Started with Kubernetes
VMware Tanzu
 
PDF
AWS ECS vs EKS
Norberto Enomoto
 
OpenShift Overview
roundman
 
Docker and Kubernetes 101 workshop
Sathish VJ
 
DevOps with Kubernetes
EastBanc Tachnologies
 
Docker Containers Deep Dive
Will Kinard
 
Podman Overview and internals.pdf
Saim Safder
 
Introduction to docker
Walid Ashraf
 
Containerd + buildkit breakout
Docker, Inc.
 
Kubernates vs Openshift: What is the difference and comparison between Opensh...
jeetendra mandal
 
Docker Introduction
Peng Xiao
 
Kubernetes - A Comprehensive Overview
Bob Killen
 
Container Orchestration with Docker Swarm and Kubernetes
Will Hall
 
Présentation docker et kubernetes
Kiwi Backup
 
DevJam 2019 - Introduction to Kubernetes
Ronny Trommer
 
Introduction to Docker - VIT Campus
Ajeet Singh Raina
 
Docker introduction
Phuc Nguyen
 
Red Hat OpenShift Container Platform Overview
James Falkner
 
Kubernetes 101
Vishwas N
 
Ceph Introduction 2017
Karan Singh
 
Getting Started with Kubernetes
VMware Tanzu
 
AWS ECS vs EKS
Norberto Enomoto
 
Ad

Viewers also liked (20)

PPTX
Docker Ecosystem - Part II - Compose
Mario IC
 
PDF
Scaling Jenkins with Docker: Swarm, Kubernetes or Mesos?
Carlos Sanchez
 
PDF
Migración de datos con OpenERP-Kettle
raimonesteve
 
PPSX
Business Intelligence and Big Data Analytics with Pentaho
Uday Kothari
 
PDF
Introduction to GPU Programming
Chakkrit (Kla) Tantithamthavorn
 
PDF
Docker Ecosystem: Engine, Compose, Machine, Swarm, Registry
Mario IC
 
PDF
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
Giovanni Toraldo
 
PPTX
Indic threads pune12-accelerating computation in html 5
IndicThreads
 
PPTX
Continuous Development with Jenkins - Stephen Connolly at PuppetCamp Dublin '12
Puppet
 
DOCX
Advanced ETL2 Pentaho
Sunny U Okoro
 
PPTX
NGINX Plus PLATFORM For Flawless Application Delivery
Ashnikbiz
 
PPTX
Building Data Integration and Transformations using Pentaho
Ashnikbiz
 
PPTX
Scaling Jenkins with Docker and Kubernetes
Carlos Sanchez
 
PPTX
Elementos ETL - Kettle Pentaho
valex_haro
 
PDF
Tao zhang
harishk2
 
PDF
Pentaho | Data Integration & Report designer
Hamdi Hmidi
 
PDF
Jenkins Peru Meetup Docker Ecosystem
Mario IC
 
PDF
Docker swarm introduction
Evan Lin
 
PDF
Building a data warehouse with Pentaho and Docker
Wellington Marinho
 
PPTX
Load Balancing Apps in Docker Swarm with NGINX
NGINX, Inc.
 
Docker Ecosystem - Part II - Compose
Mario IC
 
Scaling Jenkins with Docker: Swarm, Kubernetes or Mesos?
Carlos Sanchez
 
Migración de datos con OpenERP-Kettle
raimonesteve
 
Business Intelligence and Big Data Analytics with Pentaho
Uday Kothari
 
Introduction to GPU Programming
Chakkrit (Kla) Tantithamthavorn
 
Docker Ecosystem: Engine, Compose, Machine, Swarm, Registry
Mario IC
 
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
Giovanni Toraldo
 
Indic threads pune12-accelerating computation in html 5
IndicThreads
 
Continuous Development with Jenkins - Stephen Connolly at PuppetCamp Dublin '12
Puppet
 
Advanced ETL2 Pentaho
Sunny U Okoro
 
NGINX Plus PLATFORM For Flawless Application Delivery
Ashnikbiz
 
Building Data Integration and Transformations using Pentaho
Ashnikbiz
 
Scaling Jenkins with Docker and Kubernetes
Carlos Sanchez
 
Elementos ETL - Kettle Pentaho
valex_haro
 
Tao zhang
harishk2
 
Pentaho | Data Integration & Report designer
Hamdi Hmidi
 
Jenkins Peru Meetup Docker Ecosystem
Mario IC
 
Docker swarm introduction
Evan Lin
 
Building a data warehouse with Pentaho and Docker
Wellington Marinho
 
Load Balancing Apps in Docker Swarm with NGINX
NGINX, Inc.
 
Ad

Similar to Introduction to docker swarm (20)

PDF
Docker Swarm 0.2.0
Docker, Inc.
 
PDF
What’s new in Swarm 1.1
k z
 
PDF
Dockertaipei 20150528-dockerswarm
Wei-Ting Kuo
 
PDF
DockerCon SF 2015: Orchestration for Sysadmins
Docker, Inc.
 
PDF
AstriCon 2017 - Docker Swarm & Asterisk
Evan McGee
 
PDF
Swarm mode
Dharmit Shah
 
PDF
Paolucci voxxed-days-berlin-2016-age-of-orchestration
Grzegorz Duda
 
PDF
Docker 進階實務班
Philip Zheng
 
PDF
廣宣學堂: 容器進階實務 - Docker進深研究班
Paul Chao
 
PDF
The age of orchestration: from Docker basics to cluster management
Nicola Paolucci
 
PPTX
Introducing Docker Swarm - the orchestration tool by Docker
Ramit Surana
 
PDF
What's New in Docker 1.12?
Ajeet Singh Raina
 
PDF
Orchestrating Docker with OpenStack
Erica Windisch
 
PDF
Docker 1.12 and swarm mode
Wesley Charles Blake
 
PDF
Introduction to Docker - Learning containerization XP conference 2016
XP Conference India
 
PDF
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
Alessandro Arrichiello
 
PDF
Docker Compose to Production with Docker Swarm
Mario IC
 
PPTX
Docker Security workshop slides
Docker, Inc.
 
PPTX
Docker Introduction and its Usage in Machine Learning
yogendra18
 
PDF
Killer Docker Workflows for Development
Chris Tankersley
 
Docker Swarm 0.2.0
Docker, Inc.
 
What’s new in Swarm 1.1
k z
 
Dockertaipei 20150528-dockerswarm
Wei-Ting Kuo
 
DockerCon SF 2015: Orchestration for Sysadmins
Docker, Inc.
 
AstriCon 2017 - Docker Swarm & Asterisk
Evan McGee
 
Swarm mode
Dharmit Shah
 
Paolucci voxxed-days-berlin-2016-age-of-orchestration
Grzegorz Duda
 
Docker 進階實務班
Philip Zheng
 
廣宣學堂: 容器進階實務 - Docker進深研究班
Paul Chao
 
The age of orchestration: from Docker basics to cluster management
Nicola Paolucci
 
Introducing Docker Swarm - the orchestration tool by Docker
Ramit Surana
 
What's New in Docker 1.12?
Ajeet Singh Raina
 
Orchestrating Docker with OpenStack
Erica Windisch
 
Docker 1.12 and swarm mode
Wesley Charles Blake
 
Introduction to Docker - Learning containerization XP conference 2016
XP Conference India
 
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
Alessandro Arrichiello
 
Docker Compose to Production with Docker Swarm
Mario IC
 
Docker Security workshop slides
Docker, Inc.
 
Docker Introduction and its Usage in Machine Learning
yogendra18
 
Killer Docker Workflows for Development
Chris Tankersley
 

Recently uploaded (20)

PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
The Future of Artificial Intelligence (AI)
Mukul
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Software Development Methodologies in 2025
KodekX
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 

Introduction to docker swarm

  • 1. Walid AshrafResearcher , Software Developer, Instructor about.me/WalidAshraf INTRODUCTION TO DOCKER SWARM
  • 2. Docker Swarm - Walid Ashraf Docker Basic Architecture  Native Client  UCP  Third party
  • 3. Docker Swarm - Walid Ashraf INTRODUCTION TO DOCKER SWARM
  • 4. Docker Swarm - Walid Ashraf
  • 5. Docker Swarm - Walid Ashraf What is Swarm Docker Swarm is native clustering for Docker. • It turns a pool of Docker hosts into a single, virtual Docker host. Docker Swarm serves the standard Docker API, any tool that already communicates with a Docker daemon can use Swarm to transparently scale to multiple hosts.
  • 6. Docker Swarm - Walid Ashraf
  • 7. Docker Swarm - Walid Ashraf Docker Discovery Service A key Value store for configurations Defaults to a hosted discovery service with Docker Swarm. The service maintains a list of IPs in your cluster. This page describes the different types of hosted discovery available to you. Discovery service replacements (Libkv abstraction): • Consul • Etcd • ZooKeeper Should be replicated
  • 8. Docker Swarm - Walid Ashraf Swarm Manager It’s the cluster admin or master All communications with nodes passes through it Supports HA • 1 Primary (the Actual Admin) • Multiple Secondary Managers (Transfers to primary) • In case of primary failure (leader election occurs)
  • 9. Docker Swarm - Walid Ashraf How this works The Manager deploys the required services (Containers) to a host(s) based on the configurations. The Manager checks with the discovery service for available nodes The Client Issue a command to the swarm manager
  • 10. Docker Swarm - Walid Ashraf Filtering: The ability to mask some of the nodes Constraints •node to refer to the node by ID or name •storagedriver •executiondriver •kernelversion •operatingsystem Resources •Containerslots Number of containers on a host •Port Containers •Affinity filters •container name or id •an image on the host •a custom label applied to the container •Depencecy
  • 11. Docker Swarm - Walid Ashraf Scheduling Random Spread • Default • Least no of containers • CPU and RAM aware Binpack • Most no of containers • CPU and RAM aware
  • 12. Docker Swarm - Walid Ashraf CREATING SWARM INFRASTRUCTURE
  • 13. Docker Swarm - Walid Ashraf 1 – Create Master docker swarm init --advertise-addr <MANAGER-IP> $ docker swarm init --advertise-addr 192.168.99.100 docker info Swarm: active NodeID: dxn1zf6l61qsb1josjja83ngz Is Manager: true Managers: 1 Nodes: 1 docker node ls ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS dxn1zf6l61qsb1josjja83ngz * manager1 Ready Active Leader
  • 14. Docker Swarm - Walid Ashraf 2 – Add Nodes $ docker swarm join --token SWMTKN-1- 49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c 192.168.99.100:2377 Docker node ls ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS 03g1y59jwfg7cf99w4lt0f662 worker2 Ready Active 9j68exjopxe7wfl6yuxml7a7j worker1 Ready Active dxn1zf6l61qsb1josjja83ngz * manager1 Ready Active Leader
  • 15. Docker Swarm - Walid Ashraf DEPLOYING A SERVICE
  • 16. Docker Swarm - Walid Ashraf What is a service A service is a container in swarm mode. Examples of services might include an HTTP server, a database, or any other type of executable program that you wish to run in a distributed environment. Things to be configured in a service The port where the swarm will make the service available outside the swarm An overlay network for the service to connect to other services in the swarm CPU and memory limits and reservations A rolling update policy The number of replicas of the image to run in the swarm
  • 17. Docker Swarm - Walid Ashraf
  • 18. Docker Swarm - Walid Ashraf Replicated and global services
  • 19. Docker Swarm - Walid Ashraf Creating a service $docker service create --replicas 1 --name helloworld alpine ping docker.com $ docker service ls •ID NAME SCALE IMAGE COMMAND •9uk4639qpg7n helloworld 1/1 alpine ping docker.com $ docker service inspect --pretty helloworld •ID: 9uk4639qpg7npwf3fn2aasksr •Name: helloworld •Mode: REPLICATED •Replicas: 1 •Placement: •UpdateConfig: •Parallelism: 1 •ContainerSpec: •Image: alpine •Args: ping docker.com $ docker service ps helloworld •ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE •8p1vev3fq5zm0mi8g0as41w35 helloworld.1 helloworld alpine Running 3 minutes Running worker2
  • 20. Docker Swarm - Walid Ashraf Scaling a service $ docker service scale helloworld=5 $ docker service ps helloworld ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE 8p1vev3fq5zm0mi8g0as41w35 helloworld.1 helloworld alpine Running 7 minutes Running worker2 c7a7tcdq5s0uk3qr88mf8xco6 helloworld.2 helloworld alpine Running 24 seconds Running worker1 6crl09vdcalvtfehfh69ogfb1 helloworld.3 helloworld alpine Running 24 seconds Running worker1 auky6trawmdlcne8ad8phb0f1 helloworld.4 helloworld alpine Running 24 seconds Accepted manager1 ba19kca06l18zujfwxyc5lkyn helloworld.5 helloworld alpine Running 24 seconds Running worker2
  • 21. Docker Swarm - Walid Ashraf Delete a service $ docker service rm helloworld helloworld
  • 23. Docker Swarm - Walid Ashraf Thinking about High Availability
  • 24. Docker Swarm - Walid Ashraf HA over Multiple clouds 
  • 25. Docker Swarm - Walid Ashraf Implementing High Availability Note: Default Discovery service needs a key value configuration manager Manager1 swarm manage -H :4000 <tls-config-flags> --replication --advertise 192.168.42.200:4000 consul://192.168.42.10:8500/nodes Manager 2 swarm manage -H :4000 <tls-config-flags> --replication --advertise 192.168.42.201:4000 consul://192.168.42.10:8500/nodes
  • 26. Docker Swarm - Walid Ashraf TLS for Docker Swarm
  • 27. Docker Swarm - Walid Ashraf References https://docs.docker.com/swarm/ https://docs.docker.com/engine/swarm/swarm-tutorial
  • 28. Docker Swarm - Walid Ashraf

Editor's Notes

  • #27: https://docs.docker.com/swarm/configure-tls/