Download - Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Transcript
Page 1: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Patrick Chanezon, Docker Inc.@chanezon

The Docker Ecosystem

With slides from @jpetazzo @timpark @vieux @tnachen IBM

on Microsoft Azure

Ride the Whale!

Page 2: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

French

Polyglot

Platforms

San Francisco

Developer Relations

@chanezon

Page 3: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

1995 2015

Page 4: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Docker in the cloud market

Page 5: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Cloud Market

PublicHybridPrivate

IT Pros Devops DevelopersArchitects

Page 6: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

History of containerization

• 1960’s mainframe

• 1990’s hardware virtualization

• 1990’s OS virt precursors: BSD Jails, Solaris zones

• 2006 Cloud IaaS

• 2009 platform virtualization (PaaS)

• 2013 Docker

See @bcantrill’s deck http://www.slideshare.net/bcantrill/docker-and-the-future-of-containers-in-production

Page 7: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

7

Page 8: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Page 9: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Happy birthday!

Page 10: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Why Docker success now?

• Cloud adoption

• Portability

• Hybrid

• Devops

Page 11: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

It’s an ecosystem

Page 12: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Linux Container Ecosystem

Page 13: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Docker

Page 14: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Page 15: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Page 16: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Isolation using Linux kernel features

namespaces

pid

mnt

net

uts

ipc

user

cgroups

memory

cpu

blkio

devices

Page 17: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Docker language stacks

https://registry.hub.docker.com/_/java/

Page 18: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Docker now

A platform to build, ship, and run any app, anywhere

docker engine

docker hub

docker-machine

docker-compose

docker-swarm

Page 19: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Docker, the community

>700 contributors

~20 core maintainers

>40,000 Dockerized projects on GitHub

>60,000 repositories on Docker Hub

>25000 meetup members,>140 cities, >50 countries

>2,000,000 downloads of boot2docker

Page 20: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Docker Inc, the company

Headcount: ~130

Revenue: t-shirts and stickers featuring the cool blue whale

SAAS delivered through Docker Hub

Support & Training

soon: Docker Hub Enterprise, behind the firewall

Page 21: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

It’s all about Devops

Page 22: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Separation of concerns:Dave the Developer

Inside my container: my code

my libraries

my package manager

my app

my data

Page 23: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Separation of concerns:Oscar the Ops guy

Outside the container: logging

remote access

network configuration

monitoring

Page 24: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Docker on Microsoft

Page 25: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Containers

Page 26: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Microsoft engaging with the Docker ecosystem

Page 27: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Windows Server Containers

Page 28: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Deploy almost anywhere

Page 29: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

More Windows options

• Nano Server

• Hyper-V Containers

http://azure.microsoft.com/blog/2015/04/08/microsoft-unveils-new-container-technologies-for-the-next-generation-cloud

Page 30: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Docker on Azure

Page 31: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Azure Portal Ubuntu Docker VM

Page 32: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Azure x-plat CLI

VMNAME=jpetazzoIMAGE=b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04-LTS-amd64-server-20140724-en-us-30GBUSER=jpetazzoPASSWORD=1234abcdABCD@LOCATION="West US"

azure vm docker create $VMNAME \$IMAGE $USER $PASSWORD -l "$LOCATION"

export DOCKER_HOST=tcp://$VMNAME.cloudapp.net:4243docker --tls versionazure vm endpoint create $VMNAME 80

Page 33: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

docker-machine

docker-machine create -d azure \

—azure-subscription-id="c4f51be3-784c-xxx-7c50ad9e1b7c" \

--azure-subscription-cert="/Users/pat/.ssh/docker-azure-

cert.pem" \

--azure-location="East US" \

--azure-size=Small \

--azure-username="pat" \

pat-docker-machine-n

Page 34: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Linux Container Ecosystem

Page 35: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Plugins

Page 36: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Weave

Page 37: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Flocker

Page 38: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Powerstrip

Prototyping Docker Plugins

https://clusterhq.com/blog/powerstrip-prototype-docker-extensions-today/

Page 39: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Orchestration

Page 40: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Docker Swarm

Page 41: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Docker Swarm 0.2.0

@abronan - @aluzzardi - @vieux

Page 42: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Running containers on

multiple hosts

Page 43: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Today

Docker

CLI

Docker

CLIDocker

CLI

Page 44: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Introducing Docker Swarm

us-west us-east

Docker

CLIDocker

CLI

Swarm

Page 45: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Swarm in a nutshell

• Docker REST API (>85%)

• Resource management (CPU, Mem, Networking)

• Advanced scheduling with constraints and affinities

• Multiple Discovery Backends (hub, etcd, consul, zookeeper)

• TLS: Encryption & Authentication

Page 46: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

TimelineOct

Nov

Dec

Jan

Feb

Jun

Proof of Concept

DockerCon EU

Open Repository

First Release Candidate

Swarm Beta Release

Global Hack Day

Open Proposal

Page 47: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Setup using the hosted discovery service

• 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

Contributions are welcome :

Page 48: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Resource Management

• Memory

$ docker run -m 1g …

• CPU

$ docker run -c 1 …

• Ports

$ docker run -p 80:80 …

• More to come, ex: network interfaces

Page 49: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Constraints

• Standard constraints induced from docker info

docker run -e “constraint:operatingsystem==*fedora*” …

docker run -e “constraint:storagedriver==*aufs*” …

• Custom constraints with host labels

docker -d --label “region==us-east”

docker run -e “constraint:region==us-east” …

• Pin a container to a specific host

docker run –e “constraint:node==ubuntu-2” …

Page 50: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Affinities

• Containers affinities

docker run --name web nginx

docker run -e “affinity:container==web” logger

• Containers Anti-affinities

docker run --name redis-master redis

docker run --name redis-slave -e “affinity:container!=redis*”

• Images affinities

docker run -e “affinity:image==redis” redis

Page 51: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

New in 0.2.0: Soft Affinities/Constraints

• Containers affinities

docker run -e “affinity:container~!=—name web nginx

docker run -e “affinity:container==web” logger

• Containers Anti-affinities

docker run --name redis-master redis

docker run --name redis-slave -e “affinity:container!=redis*”

• Images affinities

docker run -e “affinity:image==redis” redis

Page 52: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Swarm Scheduler

2 steps:

• 1- Apply filters to exclude nodes

- ports

- labels

- health

• 2- Use a strategy to pick the best node

- random

- binpack

- spread

Contributions are welcome :

Page 53: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Swarm Beta: Integrations

• Fully integrated with Machine

• Partially integrated with Compose

• Mesos integration has started in collaboration with Mesosphere.

Page 54: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Mesos

Page 55: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Page 56: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Page 57: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Page 58: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Page 59: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Page 60: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Page 61: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

CoreOS

Page 62: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

CoreOS

Page 63: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Fleet

Page 64: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Docker & etcd

Page 65: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Cluster Architecture

https://coreos.com/docs/cluster-management/setup/cluster-architectures/

Page 66: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

CoreOS / Docker / Spring Boot

https://github.com/chanezon/azure-linux/tree/master/coreos/cloud-init

Page 67: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Deis

Page 68: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Page 69: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Deis (http://deis.io)

• Open source PaaS platform that builds on CoreOS.• Replicates the popular Heroku devops workflow.

• Primary mechanism for pushing applications is through git.• Developer experience is not unlike Azure Websites…• …but is built on Linux so full support for open source stacks.

• Enables us to win migrations from Salesforce to Azure.• Hackfest in November to enable Deis for Tagboard.

• Enables us to win startups that expect this workflow.

Page 70: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Page 71: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Page 72: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

tpark:www$ git push deis master

• Git pushes master to deis git remote on endpoint• Deis senses static web application• Selects Heroku Buildpack• Uses buildpack to build application Docker container.• Pushes this container to a private Docker registry.• Orchestrates the creation or update of this container

on the cluster.• Updates routing mesh to route to these containers.

Page 73: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Router Mesh

deis-1 deis-2 deis-3 deis-4

www

CoreOS CoreOS CoreOS CoreOS

Page 74: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

tpark:www$ deis scale www=3

• Deis pushes the container to two more cluster nodes.• Updates routing mesh to pass traffic to these nodes.

Page 75: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Router Mesh

deis-1 deis-2 deis-3 deis-4

www www www

Page 76: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

tpark:api$ git push deis master

• Git pushes master to deis git remote on endpoint• Deis senses node.js application• Selects Heroku node.js Buildpack• Uses buildpack to build application Docker container.• Pushes this container to a private Docker registry.• Orchestrates the creation or update of this container

on the cluster.• Updates routing mesh to route to these containers.

Page 77: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Router Mesh

deis-1 deis-2 deis-3 deis-4

www

api

www

api

www api

Page 78: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Router Mesh

deis-1 deis-2 deis-3 deis-4

www

api

www

api

www api

Page 79: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Router Mesh

deis-1 deis-2 deis-3 deis-4

www

api

www

api

www

api

Page 80: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

tpark:api$ deis config:set DATABASE_URL=postgres://user:[email protected]:5432/db

• Applications in Deis are configured through environmental variables.

• MUST READ: http://12factor.net/• Key point: Code is separated from config. • Enables generic containers that are configured at runtime.• Every app container spun up by Deis will have a copy of these

config environmental variables.

Page 81: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

tpark:api$ deis logs

• Deis automatically rolls and consolidates logs from all containers.

Page 82: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Router Mesh

deis-1 deis-2 deis-3 deis-4

www

api

www

api

www

api

Page 83: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Router Mesh

deis-1 deis-2 deis-3 deis-4

www

api

www

api

www

api

Page 84: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Kubernetes

Page 85: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Kubernetes (http://kubernetes.io)

Page 86: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

KubernetesMaster / Scheduler

host-1 host-2 host-3 host-n

…..Container Agent Container Agent Container Agent Container Agent

Linux Linux Linux Linux

Page 87: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

KubernetesScheduler

host-1 host-2 host-3 host-n

…..Container Agent Container Agent Container Agent Container Agent

Linux Linux Linux Linux

Container

Container

Page 88: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Page 89: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Kubernetes

host-1

Container

host-2 host-3 host-4 host-n

Container

Container

Container

Container

ContainerContainer

ContainerContainer

Page 90: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Kubernetes

host-1 host-2 host-3 host-4 host-n

Frontend

Worker

my_app pod

MyAppMyApp MyApp

Replication Controller

3

Page 91: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Kubernetes

host-1 host-2 host-3 host-4 host-n

Frontend

Worker

my_app pod

MyAppMyApp MyApp

Replication Controller

3

Page 92: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Kubernetes

host-1 host-2 host-3 host-4 host-n

…MyAppMyApp MyApp

Replication Controller

Pod Pod

Pod

Pod

PodPod

PodPod

Replication Controller

Page 93: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Kubernetes

host-1 host-2 host-3 host-4 host-n

…MyAppstaging

MyAppstaging

MyAppstaging

MyAppprod

MyAppprod

MyAppprod

MyAppprod

MyAppprod

MyApp Production Service{ environment: prod }

MyApp Staging Service{ environment: staging }

Labels and Services

Page 94: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Cloud Foundry & IBM BlueMix

Page 95: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Cloud Foundry Diego & Lattice

cf docker-push my-app cloudfoundry/lattice-app

Page 96: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

IBM BluemixThe Digital Innovation Platform

Page 97: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

97

Customer Managed

Service Provider Managed

IBM SoftLayer

Bluemix started as a public PaaSBluemix started with a major focus on developer productivity in the public cloud.

Infrastructure as

a Service

Code

Data

Runtime

Middleware

OS

Virtualization

Servers

Storage

Networking

Code

Data

Runtime

Middleware

OS

Virtualization

Servers

Storage

Networking

Platform as

a Service

Page 98: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

98

Customer Managed

Service Provider Managed

IBM SoftLayer

We listened. Now we’re evolving to become even more flexible.

Capabilities in Bluemix now span PaaS and IaaS and can be delivered as a public,

dedicated, or on-premises* implementation.

Infrastructure as

a Service

Code

Data

Runtime

Middleware

OS

Virtualization

Servers

Storage

Networking

Code

Data

Runtime

Middleware

OS

Virtualization

Servers

Storage

Networking

Platform as

a Service

*Bluemix Local coming Summer 2015

Built on open

technologies:

Page 99: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

How does Bluemix work?Bluemix is underlined by three key open compute technologies: Cloud Foundry, Docker, and

OpenStack. It extends each of these with a growing number of services, robust DevOps tooling,

integration capabilities, and a seamless developer experience.

99

Flexible Compute Options to Run Apps / Services

Instant Runtimes Containers Virtual Machines

Platform Deployment Options that Meet Your Workload Requirements

Bluemix

Public

Bluemix

Dedicated

Bluemix

Local*

DevOps

Tooling Your Own Hosted Apps / Services

Integration and

API Mgmt

Powered by IBM SoftLayer In Your Data Center

+ + +

+ +

+ Always focused on what’s next

Catalog of Services that Extend Apps’ Functionality

Web Data Mobile AnalyticsCognitive IoT Security Yours

+

*Bluemix Local coming Summer 2015

Page 100: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Containers in BluemixBluemix now comes with a fully integrated, high performance Docker experience, meaning monitoring,

logging, elasticity, enterprise images, and VM abstraction are all standard.

100

Docker Value IBM Value-add Customer Value

Docker Hub Registry holds a

repository of 75000+ Docker

images

• IBM hosted public registry containing IBM images - linked to

Docker Hub

• Client unique registry available on and off premises

• Enterprise-ready images

Access to the images you require to deploy

containers that meet your business needs and

strategy

Open-source, standardized,

lightweight, self sufficient LXC

container technology

• Enhanced performance with bare metal deployment

• Run images to local datacenter or cloud

• Deployment choice with pSeries & zSeries

Flexibility to choose the right hybrid cloud mix for your business

Build, ship, and run standardized

containers

• Integrated monitoring & logging

• Elasticity to grow storage & container needs

• Life-cycle management of containers and data volumes

• No VMs to manage

Docker ease of use combined with enterprise-

level integrity and confidence

Container connections using

links and service discovery

• Private network communication

• External IP address

• Subnet Range

Extends and connects Docker containers to

production-ready enterprise environments

Page 101: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Others

Page 102: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Page 103: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Joyent TritonThe network is the computer… v2:-)

Page 104: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

CleverCloud

Page 105: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

RancherOS

Page 106: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Orchestration summary• Docker Swarm: Docker-style, provision with docker-machine

• Mesos: Twitter-style, aligned with Swarm

• Fleet: CoreOS-style, simple

• Kubernetes: Google-style, heavy-duty, many concepts

• Deis: Heroku-style workflow

• Cloud Foundry Diego, IBM BlueMix: PaaS -> orchestration

• Also: Joyent, Tutum, Flynn

Page 107: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Fire up your first container today!

on Microsoft Azure

Ride the Whale!

Page 108: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Learning

• https://github.com/chanezon/azure-linux

• Docker container to get started

docker run –ti chanezon/linux

• CoreOS cluster, fleet

• Deis

• Weave

• docker-machine

• Deploy Java app

Page 109: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

10

3

References• talk about cloud platforms: Managing complexity in giant systems http://www.slideshare.net/chanezon/tackling-

complexity-in-giant-systems-approaches-from-several-cloud-providers

• talk about Devops, the Microsoft Wayhttp://www.slideshare.net/chanezon/devops-the-microsoft-way

• MS Open Tech https://msopentech.com/ Blog, VM Depot

• P@ Linux on Azure pages https://github.com/chanezon/azure-linux/

• Tim’s CoreOS tutorial https://github.com/timfpark/coreos-azure

• Tim’s Deis documentation

• @jpetazzo’s presentations http://www.slideshare.net/jpetazzo/

• @bcantrill’s deck http://www.slideshare.net/bcantrill/docker-and-the-future-of-containers-in-production

• @vieux deck on Swarm

• @htchen deck on Mesos + Swarm https://speakerdeck.com/tnachen/docker-swarm-plus-mesos

Page 110: Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure

Q&A