Alles Docker oder Was ?

77
BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENF HAMBURG KOPENHAGEN LAUSANNE MÜNCHEN STUTTGART WIEN ZÜRICH Alles Docker oder was? Grundlagen und Vorteile von Container-Architekturen Anatole Tresch, Principal Consultant

Transcript of Alles Docker oder Was ?

Page 1: Alles Docker oder Was ?

BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENF HAMBURG KOPENHAGEN LAUSANNE MÜNCHEN STUTTGART WIEN ZÜRICH

Alles Docker oder was?Grundlagen und Vorteile von Container-Architekturen

Anatole Tresch, Principal Consultant

Page 2: Alles Docker oder Was ?

Alles Docker oder was?2 25.11.15

BIO

Anatole Tresch

● Principal Consultant, Trivadis AG (Switzerland)● Star Spec Lead JSR 354, Most significant spec lead 2015● Expert Group Member● Technical Architect, Lead Engineer● Apache PPMC Member

● Twitter: @atsticks● [email protected][email protected]

Page 3: Alles Docker oder Was ?

Alles Docker oder was?3 25.11.15

Agenda

● Motivation

● Containers

● Docker

● Docker in Practice

Page 4: Alles Docker oder Was ?

Why Docker will rule the world!4 10.02.16

Page 5: Alles Docker oder Was ?

Alles Docker oder was?5 25.11.15

Docker?

● > 50000 pulls

● > 4000 Github stars

● > 100 significant contributors

● > 150 projects on top of Docker

● 1000s of dockerized applications

● Integrated with Jenkins, Travis, Chef, Puppet, Vagrant and Openstack

● Used by Ebay, Uber, Mozilla, Cloudfare, Rackspace and more...

http://docker.com

Page 6: Alles Docker oder Was ?

Alles Docker oder was?6 10.02.16

Let‘s go back to the

history of computation...

Page 7: Alles Docker oder Was ?

Alles Docker oder was?7 10.02.16

We started with...

Page 8: Alles Docker oder Was ?

Alles Docker oder was?8 10.02.16

Abstract symbols and formulas...

Page 9: Alles Docker oder Was ?

Alles Docker oder was?9 10.02.16

...and improved...

Page 10: Alles Docker oder Was ?

Alles Docker oder was?10 10.02.16

We scaled !

Page 11: Alles Docker oder Was ?

Alles Docker oder was?11 10.02.16

Page 12: Alles Docker oder Was ?

Alles Docker oder was?12 10.02.16

We started with automation...

Page 13: Alles Docker oder Was ?

Alles Docker oder was?13 10.02.16

Page 14: Alles Docker oder Was ?

Alles Docker oder was?14 10.02.16

...and miniaturization...

Page 15: Alles Docker oder Was ?

Alles Docker oder was?15 10.02.16

Page 16: Alles Docker oder Was ?

Alles Docker oder was?16 10.02.16

...and then we added electricity...

Page 17: Alles Docker oder Was ?

Alles Docker oder was?17 10.02.16

First we used it…

… as engines for our mechanical devices...

Page 18: Alles Docker oder Was ?

Alles Docker oder was?18 10.02.16

Then we used itfor performing the calculations itself...

Page 19: Alles Docker oder Was ?

Alles Docker oder was?19 10.02.16

Page 20: Alles Docker oder Was ?

Alles Docker oder was?20 10.02.16

...and things evolved further...

Page 21: Alles Docker oder Was ?

Alles Docker oder was?21 10.02.16

We made computers talking with each other.

So they can collaborate.

Page 22: Alles Docker oder Was ?

Alles Docker oder was?22 10.02.16

We started small…

...and evolved quickly...

Page 23: Alles Docker oder Was ?

Alles Docker oder was?23 10.02.16

...until...

Page 24: Alles Docker oder Was ?

Alles Docker oder was?24 10.02.16

Page 25: Alles Docker oder Was ?

Alles Docker oder was?25 25.11.15

Recapitulation...

Thick Client/Server appon thick client

Well defined stack:● OS● Runtime● Middleware

Monolithic physicalinfrastructure

1995 Today

Thin apps (mobile, tablet)

Assembled using (micro)services

Running on any resources (public, private, virtualized)

Page 26: Alles Docker oder Was ?

Why Docker will rule the world!26 10.02.16

Container

Page 27: Alles Docker oder Was ?

Alles Docker oder was?27 25.11.15

Challenges 2016

How to ensure servicesinteract consistently?

How to avoid dependency hell?

How to avoid N x NDifferent configs?

How to fail-over, migrate & scale quickly?

How to ensure compatibility?

How to ensure decouplingon client side? Manage

Javascript...How to ensure location

Transparency andResilience at Big Scale?

Page 28: Alles Docker oder Was ?

Alles Docker oder was?28 25.11.15

Mul

tiple

Sta

cks

Mul

tiple

HW

env

Challenges

Smooth and quick migration?

Do services andapps interact

appropriately?

Page 29: Alles Docker oder Was ?

Alles Docker oder was?29 25.11.15

Results in N x N compatibility nightmareStatic website

? ? ? ? ? ? ?

Web frontend

? ? ? ? ? ? ?

Background workers

? ? ? ? ? ? ?

User DB ? ? ? ? ? ? ?

Analytics DB

? ? ? ? ? ? ?

Queue ? ? ? ? ? ? ?

Development VM

QA Server Prod Server

Onsite Cloud

Pulic Cloud

Contributors Laptop

Customer Services

Page 30: Alles Docker oder Was ?

Alles Docker oder was?30 10.02.16

Why Containers help?

Page 31: Alles Docker oder Was ?

Alles Docker oder was?31 10.02.16

Let‘s look at the „real“ thing...

Page 32: Alles Docker oder Was ?

Alles Docker oder was?32 25.11.15

Mul

tiple

Goo

dsM

ultip

le m

etho

dsfo

r st

orin

g/tr

ansp

ort

Cargo Transport Pre 1960

Can I transport quicklyand smoothly (egfrom boat to trainTo truck)

Do I worry abouthow goods interact(eg coffe beansnext to spices)

Page 33: Alles Docker oder Was ?

Alles Docker oder was?33 25.11.15

Results in N x N compatibility matrix nightmare

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

Page 34: Alles Docker oder Was ?

Alles Docker oder was?34 10.02.16

What was the solution?

Page 35: Alles Docker oder Was ?

Alles Docker oder was?35 10.02.16

Containers !

Page 36: Alles Docker oder Was ?

Alles Docker oder was?36 25.11.15

Mul

tiple

Goo

dsM

ultip

le m

etho

dsfo

r st

orin

g/tr

ansp

ort

Containers!

Can I transport quicklyand smoothly (egfrom boat to trainTo truck)

Do I worry abouthow goods interact(eg coffe beansnext to spices)

Page 37: Alles Docker oder Was ?

Alles Docker oder was?37 25.11.15

N x N compatibility problem solved !

Page 38: Alles Docker oder Was ?

Alles Docker oder was?38 25.11.15

Benefits

● 90 % of all cargo shipped in containers

● Order of magnitude cost and time

benefits

● Massive reduction in losses due to theft

or damage

● Freight cost reduced from >26% to < 3%

● Massive Globalization

● 500 ships deliver 200M containers/year

● An new eco-system !

Page 39: Alles Docker oder Was ?

Alles Docker oder was?39 10.02.16

And what about Docker ?

Page 40: Alles Docker oder Was ?

Alles Docker oder was?40 10.02.16

= container system for code !

Page 41: Alles Docker oder Was ?

Alles Docker oder was?41 25.11.15

Docker ContainersM

ultip

le S

tack

sM

ultip

le H

W e

nv

Smooth and quick migration?

Do services andapps interact

appropriately?

Page 42: Alles Docker oder Was ?

Alles Docker oder was?42 25.11.15

In other words...M

ultip

le S

tack

sM

ultip

le H

W e

nv

Smooth and quick migration?

Do services andapps interact

appropriately?

Page 43: Alles Docker oder Was ?

Alles Docker oder was?43 25.11.15

Compatibility nightmare solved !Static website

? ? ? ? ? ? ?

Web frontend

? ? ? ? ? ? ?

Background workers

? ? ? ? ? ? ?

User DB ? ? ? ? ? ? ?

Analytics DB

? ? ? ? ? ? ?

Queue ? ? ? ? ? ? ?

Development VM

QA Server Prod Server

Onsite Cloud

Pulic Cloud

Contributors Laptop

Customer Services

Page 44: Alles Docker oder Was ?

Alles Docker oder was?44 25.11.15

Physical and Software Containers ?Aspect Physical Container Software Container

Content Agnostic Any type of cargo Any system and its dependencies

Hardware Agnostic Standard shape and interface allow to move between transport systems without modification or opening

Can run consistently on virtually any hardware – Vms, bare metal, openstack, public cloud – without any modification

Content Isolation Containers can be stacked and shipped together

Resource, network, content isolation.Stacking by orchestration layer.

Automation Easy (loading, unloading, moving) Standard operations: start, stop, status, search, commit,... Matches perfectly with auto-scaling, CI/CD, hybrid clouds

Efficiency No opening or modification needed. Lightweight, no perf or startup penalty, quick to move and manipulate

Separation of concerns Shippers: content, worriors: outside Developers: code, Ops: infrastructure

Page 45: Alles Docker oder Was ?

Alles Docker oder was?45 25.11.15

Advantages

● Clean and portable runtime environment

● Solves dependency hell, eliminates compatibility issues (almost)

● Allows multiple versions running in parallel

● Supports test automatation, integration, packaging

● Cheap, overhead-less

● Instant replay and reset of images

Page 46: Alles Docker oder Was ?

Alles Docker oder was?46 10.02.16

Page 47: Alles Docker oder Was ?

Alles Docker oder was?47 25.11.15

Docker Basics

● Build

● build images that contain your application’s entire environment, or application

operating system

● Ship

● Share images (dockerhub.com, private registry)

● Run

● Docker Daemon, Docker Registry

● Docker Client

Page 48: Alles Docker oder Was ?

Alles Docker oder was?48 25.11.15

Docker Components

Page 49: Alles Docker oder Was ?

Alles Docker oder was?49 25.11.15

Docker – Simple Example

Source: http://blog.arungupta.me/getting-started-with-docker/

Page 50: Alles Docker oder Was ?

Alles Docker oder was?50 25.11.15

Docker – Simple Example

Source: http://blog.arungupta.me/getting-started-with-docker/

Page 51: Alles Docker oder Was ?

Alles Docker oder was?51 10.02.16

Let‘s dive deeper...

Page 52: Alles Docker oder Was ?

Alles Docker oder was?52 10.02.16

Page 53: Alles Docker oder Was ?

Alles Docker oder was?53 25.11.15

Containers vs VMs

● Containers are isolated

● Containers share OS, and where

appropriate bins/libs

● Short Startup < 1 second

Page 54: Alles Docker oder Was ?

Alles Docker oder was?54 25.11.15

Why are Containers so lightweight ?

Original App:● No OS!

VMs Containers

Copy of App:● No OS!

● Can share bins/libs

Modofied App:

● Contains only diffs

between A nd A'

Page 55: Alles Docker oder Was ?

Alles Docker oder was?55 25.11.15

Docker Extension Points

Docker Functionality

● Versioning

● Lifecycle Management

● Networking

● Storage

Other Docker Products

● Machine

● Clustering (Swarm)

● Cloud Integration (Tutum)

● Orchestration (DataCenter)

Storage Storage

Storage Storage

Networking

Networking

NetworkingNetworking

NetworkingStorage Storage

StorageStorage

Page 56: Alles Docker oder Was ?

Alles Docker oder was?56 25.11.15

Size matters!

Page 57: Alles Docker oder Was ?

Alles Docker oder was?57 25.11.15

Participating Companies

Source: Lawrence Hecht / TheNewStack

Page 58: Alles Docker oder Was ?

Alles Docker oder was?58 25.11.15

Usage

Source: Lawrence Hecht / TheNewStack Books

Page 59: Alles Docker oder Was ?

Alles Docker oder was?59 25.11.15

Deployment Infrastructure

Source: Lawrence Hecht / TheNewStack

Page 60: Alles Docker oder Was ?

Why Docker will rule the world!60 10.02.16

Docker in Practice

Page 61: Alles Docker oder Was ?

Alles Docker oder was?61 10.02.16

For Operations Docker provides

● A standard format for an „executable“

● A unified API for operating these executables

For Developers Docker provides

● Isolated, repeatable and relocatable runtime environment setup

● Isolation between containers and against the host

● Fast and Simple in Use

Page 62: Alles Docker oder Was ?

Alles Docker oder was?62 10.02.16

Nice.

What can I do with it ?

Page 63: Alles Docker oder Was ?

Alles Docker oder was?63 10.02.16

Developers

● Use Microservices !

● Let the infrastructure handle load-balancing, scaling and fail-over

● Focus on the business logic

● Build CI/CD pipelines

● Do canary production testing

● Use Containers as deployable artifact

● Use Containers as building blocks when exploring new solution designs

Page 64: Alles Docker oder Was ?

Alles Docker oder was?64 10.02.16

Operations

● Use containers as the default deployment format

● Execute containers fully automated

● Load-balancing

● Auto-scaling (up and down)

● Resilience and Fail-Over Handling

● Monitoring and Logging

● Use a Datacenter OS

● Dynamic Resource Management

● Global Service Location

● Integration with classic Hypervisor technology

Page 65: Alles Docker oder Was ?

Alles Docker oder was?65 25.11.15

Apache Mesos Apache Mesos Apache Mesos

The Leading Edge...

Ceph Storage Cluster

Orchetration (Kubernetes/Marathon/...)

Cloud Provider 1 Cloud Provider 2 On Premise

VM

Software Defined Network SDN

Distributed Configuration

Ceph Storage Cluster Ceph Storage Cluster

Hypervisor

OrchetrationOrchetration

SDN SDN

VM

Page 66: Alles Docker oder Was ?

Alles Docker oder was?66 25.11.15

The Leading Edge

● Distributed Storage allows to move

your data within minutes.

● Services automatically scale.

● No Outages anymore.

● Cloud Provider has no idea what is

happening inside (which is good)

● Very high degree of automation.

● Microservices and Resilient

Architecture are at its core.

● Machine Learning not yet concidered!

In 5-10 years computation and storage will

be

→ commodity

→ dynamically (automatically?) managed

→ fully distributed and provider transparent

→ resilient

→ 10-20x cheaper

→ This is the 4th revolution of IT

Page 67: Alles Docker oder Was ?

Alles Docker oder was?67 10.02.16

Sounds like Future ?

Page 68: Alles Docker oder Was ?

Alles Docker oder was?68 10.02.16

NO.

Page 69: Alles Docker oder Was ?

Alles Docker oder was?69 10.02.16

It is already here.

Page 70: Alles Docker oder Was ?

Alles Docker oder was?70 10.02.16

Open Source.

Page 71: Alles Docker oder Was ?

Alles Docker oder was?71 10.02.16

Tested.

Page 72: Alles Docker oder Was ?

Alles Docker oder was?72 10.02.16

Production Ready.

Page 73: Alles Docker oder Was ?

Why Docker will rule the world!73 10.02.16

Summary

Page 74: Alles Docker oder Was ?

Alles Docker oder was?74 25.11.15

Summary

● Containers and Microservices are a natural match.

● Use a computational platform to get the maximum benefits.

● Scalability and Resiliency moved from development into operations.

● Get comfortable with modern software design principles.

● Changes affect everything: your infrastructure, your organization, your data, your

skills.

● Containers are at the core.

● The change is disruptive, but IMO inevitable! *

* with no alternative! Compare the impact on taxi companies when Uber.com entered the market

Page 75: Alles Docker oder Was ?

Alles Docker oder was?75 10.02.16

Act NOW !

Thank You !

Page 76: Alles Docker oder Was ?

Alles Docker oder was?76 25.11.15

Referenzen● Docker: http://docker.com, Docker e-books: http://thenewstack.io/ebookseries/ , Performance:

http://de.slideshare.net/Flux7Labs/performance-of-docker-vs-vms, Basics:

http://de.slideshare.net/larrycai/learn-docker-in-90-minutes?related=1

● Docker vs. VMs:

https://dzone.com/articles/vms-vs-docker-dan-jones-in-network-world?utm_source=Weekly%20Digest

&utm_medium=email&utm_content=cloud&utm_campaign=wd%202016-02-17● Linux Containers: https://linuxcontainers.org/

● Open Container: announcement: https://coreos.com/blog/app-container-and-the-open-container-project

● Appc:

http://thenewstack.io/coalition-for-app-container-spec-shows-docker-is-not-the-standard-for-everyone/

● Apache Mesos: http://mesos.apache.org

● Mesosphere: http://mesosphere.com

● Kubernetes: http://kubernetes.io

● Martin Fowler: Microservices. http://martinfowler.com/articles/microservices.html

Page 77: Alles Docker oder Was ?

Alles Docker oder was?77 10.02.16

Alles Docker oder was?Anatole TreschPrincipal Consultant

Tel. +41 58 459 53 [email protected]