powering radical agility with docker

48
Docker - Powering RA at Zalando Docker Meetup - Dortmund 7.6.2016 | [email protected] | @JanMussler

Upload: zalando-technology

Post on 18-Jan-2017

471 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Powering Radical Agility with Docker

Docker - Powering RA at ZalandoDocker Meetup - Dortmund 7.6.2016 | [email protected] | @JanMussler

Page 2: Powering Radical Agility with Docker

15 countries3 fulfillment centers18+ million active customers3.0+ billion € revenue135+ million visits per month1.000+ employees in tech

Europe's Leading Fashion Platform

Visit us: tech.zalando.com

Page 3: Powering Radical Agility with Docker

Zalando’s Technology History

Page 4: Powering Radical Agility with Docker

Platform

80+ Engineering teams

Platform team

deploy

Server needsStorage requests

Page 5: Powering Radical Agility with Docker
Page 6: Powering Radical Agility with Docker

RADICAL AGILITY

AUTONOMY

Page 7: Powering Radical Agility with Docker

Compliance Innovation

Page 8: Powering Radical Agility with Docker

STUPS

Page 9: Powering Radical Agility with Docker

AWS

STUPS

DOCKERDEPLOY

SSH ACCESS

AUDIT REPORTS

FULL AWS ACCESS

STUPS: A PLATFORM ON TOP OF AMAZON WEB SERVICES

Page 10: Powering Radical Agility with Docker

Page 11: Powering Radical Agility with Docker

Internet

*.abc.example.org *.xyz.example.org

Team ABC Team XYZ

ISOLATED AWS ACCOUNTS

EC2EC2

ELBELB

EC2

Page 12: Powering Radical Agility with Docker

DEPLOYMENT

Page 13: Powering Radical Agility with Docker

IMMUTABLE STACKS

ELB myapp-1

myapp.example.org

EC2+ Docker

EC2+ Docker

EC2+ Docker

Page 14: Powering Radical Agility with Docker

IMMUTABLE STACKS

ELB myapp-1

EC2+ Docker

EC2+ Docker

EC2+ Docker

ELB myapp-2

EC2+ Docker

EC2+ Docker

myapp.example.org

Page 15: Powering Radical Agility with Docker

● Immutable AMI● YAML user data● Docker runtime● Application logging:

LogEntries, Scalyr, CloudWatch Logs

● Prometheus Node Agent for metrics● KMS encrypted env vars

TAUPAGE AMI

Page 16: Powering Radical Agility with Docker

TaupageAMI

Page 17: Powering Radical Agility with Docker

SENZA: DEFINITION YAML

SenzaInfo:

StackName: hello-world

Parameters:

- ImageVersion:

Description: "Docker image version of Hello World."

SenzaComponents:

- Configuration:

Type: Senza::StupsAutoConfiguration # auto-detect network setup

- AppServer: # will create a launch configuration and ASG with scaling triggers

Type: Senza::TaupageAutoScalingGroup

InstanceType: t2.micro

SecurityGroups: [app-hello-world]

ElasticLoadBalancer: AppLoadBalancer

TaupageConfig:

runtime: Docker

source: "stups/hello-world:{{Arguments.ImageVersion}}"

ports:

8080: 8080

Page 18: Powering Radical Agility with Docker

SENZA: STACK DEPLOYMENT

$ senza create hello-world.yaml 1 0.2

Generating Cloud Formation template.. OK

Creating Cloud Formation stack hello-world-1.. OK

$ senza events hello-world.yaml 1Stack Name│Ver.│Resource Type │Resource ID │Status │Status Reason │Event Timehello-world 1 CloudFormation::Stack hello-world-1 CREATE_IN_PROGRESS User Initiated 10m ago

...

hello-world 1 CloudFormation::Stack hello-world-1 CREATE_COMPLETE 6m ago

Page 19: Powering Radical Agility with Docker

SENZA: MANAGE STACKS

Page 20: Powering Radical Agility with Docker

SSH ACCESS

Page 21: Powering Radical Agility with Docker

SSH ACCESS: TIME-LIMITED ACCESS TO ANY TEAM SERVER

Page 22: Powering Radical Agility with Docker

LOGGING

Page 23: Powering Radical Agility with Docker
Page 24: Powering Radical Agility with Docker

AutomationGOCD

Page 25: Powering Radical Agility with Docker

Thoughtwork’s GOCD in action

Page 26: Powering Radical Agility with Docker

GOCD - Pipeline example - configuration overlay

Page 27: Powering Radical Agility with Docker

Plan - B

Page 28: Powering Radical Agility with Docker

TheOAuth 2.0 authorization framework enables a third-party applicationto obtain limited access toan HTTP service.

- oauth.net

OAUTH 2.0?

Page 29: Powering Radical Agility with Docker

● Robustness & resilience⇒ Cassandra, no SPOF

● Low latency for token validation⇒ Token Info next to application

● Horizontal scalability⇒ Cassandra, “stateless” Token Info

PLAN B: GOALS - Build open source Oauth2 Provider

Page 30: Powering Radical Agility with Docker

PLAN B: COMPLETE PICTURE

bobalice

createtoken

Token Infovalidate

Provider

credential storageRevocation

pollpublic keys

pollrevocation listsS3

call with Bearer token

Page 31: Powering Radical Agility with Docker

Written in Go

~16 MB Docker image

Stateless application

CPU bound, Go 1.6 ~40x speedup for EC verify

EC2 instance start to healthy: 45sec

Scaling Token Info example

Page 32: Powering Radical Agility with Docker

ZMON

Page 33: Powering Radical Agility with Docker

Flexible and extendable: Checks & Alerts in Python

Integrate: REST APIs, OAUTH2, AWS Auto Discovery

Fully configurable via UI / API: no restarts required!

Great for teams: team dashboards, alerts inheritance

Fast/scaling metrics: Redis, KairosDB + Grafana3

Hackweek 2015 - iOS app and Android app ;-)

ZMON - High Lights ;-)

Page 34: Powering Radical Agility with Docker
Page 35: Powering Radical Agility with Docker
Page 36: Powering Radical Agility with Docker
Page 37: Powering Radical Agility with Docker

Continued ...

Page 38: Powering Radical Agility with Docker

Instance Metrics● Memory usage● Disk space usage● CPU usage● Application logs● Application metrics

Monitoring instances on AWS

Scalyr AgentLog shipping

PrometheusNode Agent:9100/metrics

Taupage AMI (Ubuntu base)

Application ContainerGo / Spring Boot / CassandraDocker run time:8080 -> app:7979 -> metrics

Page 39: Powering Radical Agility with Docker

Annotated Metric Data in Grafana

Page 40: Powering Radical Agility with Docker

Annotated Metric Data in Grafana

Page 41: Powering Radical Agility with Docker

Running same Docker Image everywhere

Page 42: Powering Radical Agility with Docker

CLAIR - SQS

Page 43: Powering Radical Agility with Docker

CoreOS’ Clair with PierOne - Static vulnerability analysis of images

Page 44: Powering Radical Agility with Docker
Page 45: Powering Radical Agility with Docker
Page 46: Powering Radical Agility with Docker

Learnings?

Page 47: Powering Radical Agility with Docker

● AWS terminology and behavior● OAuth2 + Security + Security Groups● Ops can be hard -> SaaS?● CF deployment takes time● DNS load balancing and switching :-(

○ Remember timeout config …!!○ ELB soso ...

● Great flexibility and power though

A lot of input to cover ...

Page 48: Powering Radical Agility with Docker

Zalando on Github:https://github.com/zalando

STUPS online:https://stups.io

ZMON Demo:https://demo.zmon.io

Zalando Tech:https://tech.zalando.com