+ All Categories
Home > Technology > Docker Machine & Docker Swarm

Docker Machine & Docker Swarm

Date post: 16-Apr-2017
Category:
Upload: guillermo-lucero
View: 1,080 times
Download: 8 times
Share this document with a friend
13
Docker Machine & Swarm Gustavo Dacunda – Guillermo Lucero
Transcript
Page 1: Docker Machine & Docker Swarm

Docker Machine & Swarm

Gustavo Dacunda – Guillermo Lucero

Page 2: Docker Machine & Docker Swarm

• Docker Machine• Providers & OS• Demo• Container manageability today• Manageability with Docker Swarm• Swarm in a nutshell• Docker Swarm architecture• Setup using the hosted discovery service• Swarm Scheduler• Constraints• Affinities• Demo

Agenda

Page 3: Docker Machine & Docker Swarm

Docker Machine Docker Client Docker Machine Docker Compose (Mac only) Docker Kitematic VirtualBoxDocker Toolbox

$ docker-machine create --driver [Provider] dev

Page 4: Docker Machine & Docker Swarm

Remote Provider

Local Provider

Providers & Distributions

Boot2Docker 1.5+

Ubuntu 12.04+

RancherOS 0.3+

Debian 8.0+

RedHat Enterprise Linux 7.0+

CentOS 7+

Fedora 21+

Page 5: Docker Machine & Docker Swarm

Today

tcp://host:2375 tcp://host:2375tcp://host:2375

Page 6: Docker Machine & Docker Swarm

With Docker Swarm

......

Swarm Manager

tcp://host:2375

tcp://host:2375 tcp://host:2375tcp://host:2375

Page 7: Docker Machine & Docker Swarm

Swarm in a nutshell

Exposes several Docker Engines as a single virtual Engine

Serves the standard Docker API

Extremely easy to get started

Batteries included but swappable

Page 8: Docker Machine & Docker Swarm

Swarm Manager

Token service

tcp://host:2375

Docker Swarm Architecture

......tcp://

host:2375tcp://

host:2375tcp://

host:2375

Service Discovery Scheduler

Page 9: Docker Machine & Docker Swarm

Create a cluster$ swarm create

Add nodes to a cluster$ swarm join –add=<node_ip> token://<token>

Start Swarm$ swarm manage –addr=<swarm_ip> token://<token>

Or you can use your own etcd, zookeeper or consul

Setup using the hosted discovery service

Page 10: Docker Machine & Docker Swarm

Swarm Scheduler

Scheduler strategies Spread Binpack Random

Scheduler filters Constraint Affinity Port Dependency Health

Page 11: Docker Machine & Docker Swarm

Constraints

Standard constraints induced from Docker infodocker run –e "constraint:operatingsystem==*fedora*"docker run –e "constraint:storagedriver==*aufs*"

Custom constraints with host labelsdocker –d –label "region==us-east"docker run –e "constraint:region==us-east"

Pin a container to a specific hostdocker run –e "constraint:node==Ubuntu-2"

Page 12: Docker Machine & Docker Swarm

Containers affinitiesdocker run –name web nginxdocker run –e "affinity:container==web" logger

Containers Anti-affinitiesdocker run –name redis-master redisdocker run –name redis-slave –e "affinity:container!=redis*"

Images affinitiesdocker run –e "affinity:image==redis" redis

Affinities

Page 13: Docker Machine & Docker Swarm

Demo


Recommended