Docker and Cloud - Enables for DevOps - by ACA-IT

81

Transcript of Docker and Cloud - Enables for DevOps - by ACA-IT

Page 1: Docker and Cloud - Enables for DevOps - by ACA-IT
Page 2: Docker and Cloud - Enables for DevOps - by ACA-IT

ACA IT-SOLUTIONS | © 2015

Stijn Wijndaele

[email protected] @stijnwijndaele

Introduction?

Your Hosts For Today

Business Development Manager Cloud & Mobile Solutions

ACA IT-SOLUTIONS | © 2016

Stijn Van den Enden

[email protected] @stieno

CTO

Page 3: Docker and Cloud - Enables for DevOps - by ACA-IT
Page 4: Docker and Cloud - Enables for DevOps - by ACA-IT
Page 5: Docker and Cloud - Enables for DevOps - by ACA-IT

Wants to be the greatest IT service provider

by being fanatic about

maximising customer value

Page 6: Docker and Cloud - Enables for DevOps - by ACA-IT

'DOCKER' & CLOUD: ENABLERS For DEVOPS

Page 7: Docker and Cloud - Enables for DevOps - by ACA-IT

DevOps

DevOps is gericht op het tot stand brengen van een cultuur binnen organisaties waardoor het

ontwikkelen, valideren en releasen van software sneller, meer betrouwbaar en frequenter kan

verlopen

Page 8: Docker and Cloud - Enables for DevOps - by ACA-IT

CLOUD ?

Page 9: Docker and Cloud - Enables for DevOps - by ACA-IT

Why the Cloud ?

• Elastic Capacity • Business Agility • CapEx becomes OpEx • Enabler for DevOps

Page 10: Docker and Cloud - Enables for DevOps - by ACA-IT

Why the Cloud ?

• Elastic Capacity • Business Agility • CapEx becomes OpEx • Enabler for DevOps

Page 11: Docker and Cloud - Enables for DevOps - by ACA-IT

Elastic Capacity

Traditional: Rigid Cloud: Elastic

Capacity

Demand

Capacity

Excess Capacity Wasted $

Demand

Un-met Demand

Page 12: Docker and Cloud - Enables for DevOps - by ACA-IT

Why the Cloud ?

• Elastic Capacity • Business Agility • CapEx becomes OpEx • Enabler for DevOps

Page 13: Docker and Cloud - Enables for DevOps - by ACA-IT

Business Agility

Add New Dev EnvironmentAdd New Prod EnvironmentAdd New Environment in JapanAdd 1,000 ServersRemove 1,000 serversDeploy 2 PB Data warehouseShut down 2 PB Data warehouse

IAAS/PAAS: Infrastructure in Minutes

Old World: Infrastructure in Weeks

Everything changes with this kind of agility

+ weeks

Service Request

Page 14: Docker and Cloud - Enables for DevOps - by ACA-IT

Why the Cloud ?

• Elastic Capacity • Business Agility • CapEx becomes OpEx • Enabler for DevOps

Page 15: Docker and Cloud - Enables for DevOps - by ACA-IT

Capex becomes Opex

• no initial investments • no termination fees • no (real) commitments • clear pricing model

Page 16: Docker and Cloud - Enables for DevOps - by ACA-IT

Why the Cloud ?

• Elastic Capacity • Business Agility • CapEx becomes OpEx • Enabler for DevOps

Page 17: Docker and Cloud - Enables for DevOps - by ACA-IT

Enabler for devops

• Automation - Less repetitive tasks • Better management tools • no need to build from scratch - reuse • Focus on what matters - your business

Page 18: Docker and Cloud - Enables for DevOps - by ACA-IT

Netflix in 2015

• 69,2 million users • 42,5 billion streaming hours • 45GB bandwidth user/month

Source : DMR January 2016

Page 19: Docker and Cloud - Enables for DevOps - by ACA-IT

Netflix in 2015

• 10x Customers • 100x Traffic • 5x Devs • 2x Cost of IT infrastructure

Source : DMR January 2016

in 2008

Page 20: Docker and Cloud - Enables for DevOps - by ACA-IT

Infrastructure as CodeFrom API accessible xAAS services to automated

deployment

Page 21: Docker and Cloud - Enables for DevOps - by ACA-IT

Tools can enable change in behavior and eventually change culture ‘

[patrick debois]

Page 22: Docker and Cloud - Enables for DevOps - by ACA-IT

AMI, VMX, OVF, …

Cloud Provider

Continuous Integration

Build, test and integrate applications

Configuration Management

Configure and setup an existing machine

Orchestration Tools

Provision Infrastructure and services based on a configuration template

heat

base image

additional packages

application

code-artefact-765

Page 23: Docker and Cloud - Enables for DevOps - by ACA-IT

'DOCKER' & CLOUD: ENABLERS For DEVOPS

Page 24: Docker and Cloud - Enables for DevOps - by ACA-IT

Docker

• What is docker ? • What’s more ?

Page 25: Docker and Cloud - Enables for DevOps - by ACA-IT

Docker

• What is docker ? • What’s more ?

Page 26: Docker and Cloud - Enables for DevOps - by ACA-IT

DockerIT works on my System

Page 27: Docker and Cloud - Enables for DevOps - by ACA-IT

Supply Matrix - From Hell!

Page 28: Docker and Cloud - Enables for DevOps - by ACA-IT
Page 29: Docker and Cloud - Enables for DevOps - by ACA-IT

IT Matrix From Hell!

Page 30: Docker and Cloud - Enables for DevOps - by ACA-IT

One Size - Fits All

Page 31: Docker and Cloud - Enables for DevOps - by ACA-IT

Virtual Machine ?

Page 32: Docker and Cloud - Enables for DevOps - by ACA-IT

Compute, Storage, Network

Host OS

Hypervisor

VM1

MicroService

Guest OS

JVM

VM2

MicroService

Guest OS

JVM

Compute, Storage, Network

Host OS

container1

container2

container3

container4

JVM JVM JVM

MicroService MicroService MicroService

JVM

MicroService

Containers have own isolated resources

Performance Comparison: http://ibm.co/V55Otq

VM’s abstract underlying hardware, but limits resource utilisation

Page 33: Docker and Cloud - Enables for DevOps - by ACA-IT

Ship without worrying

Page 34: Docker and Cloud - Enables for DevOps - by ACA-IT

Docker - Layering

• Container = Writeable layer

• Image = Static layers

• Containers = Share the kernel

Page 35: Docker and Cloud - Enables for DevOps - by ACA-IT

docker build -t test/a .

FROM aca—base-ubuntu:1.1

RUN apt-get update

RUN apt-get install -y apache2

RUN touch /opt/a.txt

Let’s build Webserver A!

Our Dockerfile

Page 36: Docker and Cloud - Enables for DevOps - by ACA-IT

docker build -t test/a .

FROM aca—base-apache:2.1

RUN touch /opt/a.txt

Or even better….

Page 37: Docker and Cloud - Enables for DevOps - by ACA-IT

docker history test/a

IMAGE CREATED CREATED BY SIZE

4dc359259700 About a minute ago /bin/sh -c touch /opt/a.txt 8 B

9977b78fbad7 About a minute ago /bin/sh -c apt-get install -y apache2 54.17 MB

e83b3bf07b42 2 minutes ago /bin/sh -c apt-get update 20.67 MB

9cd978db300e 3 months ago /bin/sh -c #(nop) ADD precise.tar.xz in / 204.4 MB

6170bb7b0ad1 3 months ago /bin/sh -c #(nop) MAINTAINER Tianon Gravi <ad 0 B

511136ea3c5a 10 months ago 0 B

What is in Webserver A?

Page 38: Docker and Cloud - Enables for DevOps - by ACA-IT

docker build -t test/b .

Let’s build Webserver B!

FROM aca—base-ubuntu:1.1

RUN apt-get update

RUN apt-get install -y apache2

RUN touch /opt/b.txt

Our Dockerfile

Page 39: Docker and Cloud - Enables for DevOps - by ACA-IT

docker history test/b

IMAGE CREATED CREATED BY SIZE

c0daf4bw2ed4 5 seconds ago /bin/sh -c touch /opt/b.txt 8 B

9977b78fbad7 About a minute ago /bin/sh -c apt-get install -y apache2 54.17 MB

e83b3bf07b42 2 minutes ago /bin/sh -c apt-get update 20.67 MB

9cd978db300e 3 months ago /bin/sh -c #(nop) ADD precise.tar.xz in / 204.4 MB

6170bb7b0ad1 3 months ago /bin/sh -c #(nop) MAINTAINER Tianon Gravi <ad 0 B

511136ea3c5a 10 months ago 0 B

What is in Webserver B?

Page 40: Docker and Cloud - Enables for DevOps - by ACA-IT
Page 41: Docker and Cloud - Enables for DevOps - by ACA-IT
Page 42: Docker and Cloud - Enables for DevOps - by ACA-IT
Page 43: Docker and Cloud - Enables for DevOps - by ACA-IT

Containers are here to stay!

The Open Container Initiative (OCI) is a collaborative project hosted under the Linux Foundation designed to establish common standards for containers.

Page 44: Docker and Cloud - Enables for DevOps - by ACA-IT

Docker

• What is docker ? • What’s more ?

Page 45: Docker and Cloud - Enables for DevOps - by ACA-IT

Docker Hub - Public Library

Page 46: Docker and Cloud - Enables for DevOps - by ACA-IT

Docker Registry - Private Library

Page 47: Docker and Cloud - Enables for DevOps - by ACA-IT

Docker Registry - Private Library

• Tightly control where your images are being stored • Fully own your images distribution pipeline • Integrate image storage and distribution

tightly into your in-house development workflow • Collaborate with your colleagues

Page 48: Docker and Cloud - Enables for DevOps - by ACA-IT

Docker Hub

• Docker HUB = Docker Registry - As A Service • Zero Maintenance • Additional Functionality to increase collaboration • Alternative Providers : Google / AWS / CoreOS

Page 49: Docker and Cloud - Enables for DevOps - by ACA-IT
Page 50: Docker and Cloud - Enables for DevOps - by ACA-IT
Page 51: Docker and Cloud - Enables for DevOps - by ACA-IT

/preference-service

Repository

DockerFile

Continuous Integration Infrastructure

Container Image Repository

Compute, Storage, Network

Host OS

daemon

container1

JVM

MicroService

pull

push

build

provision

container1

JVM

MicroService

Source Control System

Page 52: Docker and Cloud - Enables for DevOps - by ACA-IT

The real value of Docker is not technology

It’s getting people to agree on something

Page 53: Docker and Cloud - Enables for DevOps - by ACA-IT

Shipping Applications Beyond a single container

Page 54: Docker and Cloud - Enables for DevOps - by ACA-IT

Container Image

code-artefact-765

Page 55: Docker and Cloud - Enables for DevOps - by ACA-IT
Page 56: Docker and Cloud - Enables for DevOps - by ACA-IT
Page 57: Docker and Cloud - Enables for DevOps - by ACA-IT
Page 58: Docker and Cloud - Enables for DevOps - by ACA-IT

Minimal OS

Docker

Virtual MachineHardware

kubelet

Pod

Container

proxy

NodeMaster

scheduler

controller manager(replication controller, etc.)

API endpoint

distributed configurationstorage

kubectl(client command line tool)

Page 59: Docker and Cloud - Enables for DevOps - by ACA-IT

K/V

K/V

K/V

K/V

K/V

/etc distributed

raft - leader election

//Adding a value $ curl http://127.0.0.1:2379/v2/keys/message -XPUT -d value="Hello world”

//Quering $ curl http://127.0.0.1:2379/v2/keys/message { "action": "get", "node": { "createdIndex": 2, "key": "/message", "modifiedIndex": 2, "value": "Hello world" } }

//Delete $ curl http://127.0.0.1:2379/v2/keys/message -XDELETE

Operations

Page 60: Docker and Cloud - Enables for DevOps - by ACA-IT

apiVersion: v1kind: ReplicationControllermetadata: name: es-data labels: component: elasticsearch role: data visualize: "true"spec: replicas: 2 selector: component: elasticsearch role: data template: metadata: labels: name: es-data component: elasticsearch role: data visualize: "true" spec: serviceAccount: elasticsearch containers: - name: es-data securityContext: capabilities: add: - IPC_LOCK image: quay.io/pires/docker-elasticsearch-kubernetes:1.7.2 env:

es-data-rc.yaml

Pod

Container

Page 61: Docker and Cloud - Enables for DevOps - by ACA-IT

es-data-rc.yaml

metadata: labels: name: es-data component: elasticsearch role: data visualize: "true" spec: serviceAccount: elasticsearch containers: - name: es-data securityContext: capabilities: add: - IPC_LOCK image: quay.io/pires/docker-elasticsearch-kubernetes:1.7.2 env: - name: NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace

… ports: - containerPort: 9300 name: transport protocol: TCP volumeMounts: - mountPath: /data name: storage

volumes: - name: storage

persistentVolumeClaim: claimName: elasticsearch-storage-claim

kind: PersistentVolumeClaimapiVersion: v1metadata: name: elasticsearch-storage-claimspec: accessModes: - ReadWriteOnce resources: requests: storage: 100Gi

es-claim.yaml

Pod

Container

Page 62: Docker and Cloud - Enables for DevOps - by ACA-IT

Minimal OS

Docker

Virtual MachineHardware

kubelet

proxy

Node

Pod

Container

kind: PersistentVolumeClaimapiVersion: v1metadata: name: elasticsearch-storage-claimspec: accessModes: - ReadWriteOnce resources: requests: storage: 100Gi

es-claim.yaml

apiVersion: "v1"kind: "PersistentVolume"metadata: name: “ebs-volume-1“ spec: capacity: storage: "100Gi" accessModes: - "ReadWriteOnce" awsElasticBlockStore: fsType: "ext4" volumeID: "vol-f331a05cc"

ebs-volume-1.yaml

/data

scheduler

Amazon EBS

Page 63: Docker and Cloud - Enables for DevOps - by ACA-IT

serviceapiVersion: v1kind: Servicemetadata: name: elasticsearch labels: component: elasticsearch role: client visualize: "true"spec: type: LoadBalancer selector: component: elasticsearch role: client ports: - name: rest port: 9200 protocol: TCP - name: transport port: 9300 protocol: TCP

es-svc.yaml

Minimal OS

Docker

Virtual MachineHardware

kubelet

Pod

Container

proxy

Node

(replication controller, etc.)

Page 64: Docker and Cloud - Enables for DevOps - by ACA-IT

Minimal OS

Docker

Virtual MachineHardware

kubelet

proxy

NodeMaster

scheduler

controller manager(replication controller, etc.)

API endpoint

distributed configurationstorage

kubectl(client command line tool)

Pod

Container

• cluster topology design • operational cluster management • cluster upgrade and maintenance

• application • declarative resource specification

DevOps• container image standardisation • deployment processes

Page 65: Docker and Cloud - Enables for DevOps - by ACA-IT

Elastic LoadBalancer

Node

service

Minimal OS

Docker

Virtual MachineHardware

kubelet

proxy

Master

scheduler

controller manager(replication controller, etc.)

API endpoint

distributed configurationstorage

kubectl(client command line tool)

Pod

Container

ServerGroup

Page 66: Docker and Cloud - Enables for DevOps - by ACA-IT

Open Source Commercially supported

Page 67: Docker and Cloud - Enables for DevOps - by ACA-IT

kubernetes, what else?

Page 68: Docker and Cloud - Enables for DevOps - by ACA-IT

Docker Swarm

Page 69: Docker and Cloud - Enables for DevOps - by ACA-IT

Minimal OS

Docker

Virtual MachineHardware

Manager Node

Containerswarm

manager

swarmagent

swarmagent

distributed configurationstorage

docker remote API

overlay network

Page 70: Docker and Cloud - Enables for DevOps - by ACA-IT

Amazon ECS

Page 71: Docker and Cloud - Enables for DevOps - by ACA-IT

Docker Task

Container Instance

Amazon ECS

Container

ECS Agent

ELB

Internet

ELB

User / Scheduler

API

Cluster Management Engine

Task Container

Docker Task

Container Instance

Container

ECS Agent

Task Container

Docker Task

Container Instance

Container

ECS Agent

Task Container

AZ 1 AZ 2

Key/Value Store

Agent Communication Service

* slide from Deepak Singh, General Manager, Amazon EC2 Container Service

Page 72: Docker and Cloud - Enables for DevOps - by ACA-IT
Page 73: Docker and Cloud - Enables for DevOps - by ACA-IT

Slave

Master

framework

Virtual Pool of Resources (CPU, RAM, …)

Page 74: Docker and Cloud - Enables for DevOps - by ACA-IT

• Set up in seconds, integrates in the AWS stack (ELB, CloudWatch, ECR) and yes, specific to Amazon WebServices

• Basic capabilities out of the box (no Discovery, …) but extensible • Ideal for simple containerised workloads

• Opinionated declarative cluster management solution • Runs on a single machine (in Docker) and on a large datacenter setup • Rich API for cluster management • Support for Secrets, Quota, Volumes, … • Provider agnostic (docker, rkt, amazon, gce, …)• Abstracts a cluster behind the Docker Remote API • Networking and scheduling support • Open plugin points for discovery, networking, … • Docker only • Lacks (being out of the box) service load balancing support• Essentially a resource abstraction • Scales to +10K nodes • Job agnostic (more than containers alone) • Support Kubernetes as one of the many frameworks

Page 75: Docker and Cloud - Enables for DevOps - by ACA-IT

+

Container

declarative specification of operational needs

Cluster

continuous deployment pipeline includes quality gates: automated tests ops compliance

security tests manual steps

Page 76: Docker and Cloud - Enables for DevOps - by ACA-IT

Patterns for Continuous Deployment

Page 77: Docker and Cloud - Enables for DevOps - by ACA-IT

Container Image

preference-service-artefact-765

Blue Green

Content Based Router

Blue/Green deployments

Container Image

preference-service-artefact-765

Container Image

preference-service-artefact-123

production traffictest traffic

Page 78: Docker and Cloud - Enables for DevOps - by ACA-IT

Container Image

preference-service-artefact-765

Stage 1 Stage 2 Stage 3

Content Based Router

Canary staged deployment

Page 79: Docker and Cloud - Enables for DevOps - by ACA-IT

2 Container ecosystem is maturing rapidly and cAAS provides the abstraction sweet spot

1 Cloud services are a true enabler for business agility

3 Leverage Continuous Deployment as competitive advantage (as long as it lasts)

Page 80: Docker and Cloud - Enables for DevOps - by ACA-IT

ACA IT-SOLUTIONS | © 2015

Stijn Wijndaele

[email protected] @stijnwijndaele

Questions?

Your Hosts For Today

Business Development Manager Cloud & Mobile Solutions

ACA IT-SOLUTIONS | © 2016

Stijn Van den Enden

[email protected] @stieno

CTO

Page 81: Docker and Cloud - Enables for DevOps - by ACA-IT