a million containers isnt cool - usenix...a million containers isn’t cool you know what’s cool?...

190
A million containers isn’t cool

Upload: others

Post on 26-Jun-2020

16 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

A million containers isn’t cool

Page 2: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

You know what’s cool?

Page 3: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

A hundred containers

Page 4: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

A million containers isn’t cool

You know what’s cool? A hundred containers.

@ChrisSinjo

Page 5: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

GOCARDLESS

Page 6: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)
Page 7: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)
Page 8: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)
Page 9: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

We aren’t #webscale

(#sorrynotsorry)

Page 10: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

So why do we care about containers?

Page 11: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

POST /cash/monies HTTP/1.1

{ amount: 100 }

💰💰💰

Page 12: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

High 💵 per-request

Page 13: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Reliability is 🔑

Page 14: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Deploying software reliably

Page 15: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Deploying software reliably

How containers can help

Page 16: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Deploying software reliably

How containers can help

Other options

Page 17: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

First things first: deployment artifacts

Page 18: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Source code ↓

Something you can put on a server

Page 19: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

A .jar file

A statically linked binary

An OS package (.deb, .rpm)

Page 20: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Some languages start on the back foot

Page 21: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)
Page 22: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Capistrano: a typical Ruby flow

Page 23: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

On each server:

Page 24: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

On each server: - Clone source

Page 25: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

On each server: - Clone source - Build dependencies

Page 26: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

On each server: - Clone source - Build dependencies - Run schema migrations

Page 27: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

On each server: - Clone source - Build dependencies - Run schema migrations - Build static assets

Page 28: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

On each server: - Clone source - Build dependencies - Run schema migrations - Build static assets - SIGHUP

Page 29: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

What’s wrong here?

Page 30: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Hope

Page 31: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

On each server: - Clone source - Build dependencies - Run schema migrations - Build static assets - SIGHUP

Page 32: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

On each server: - Clone source - Build dependencies - Run schema migrations - Build static assets - SIGHUP

Hope

Page 33: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

$ bundle install … Building nokogiri using system libraries.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

Page 34: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

On each server: - Clone source - Build dependencies - Run schema migrations - Build static assets - SIGHUP

Hope

Page 35: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

On each server: - Clone source - Build dependencies - Run schema migrations - Build static assets - SIGHUP

Hope

Hope

Page 36: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

On each server: - Clone source - Build dependencies - Run schema migrations - Build static assets - SIGHUP

Hope

HopeHope

Page 37: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

– Traditional SRE saying

“Hope is not a strategy.”

https://landing.google.com/sre/book.html

Page 38: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

There’s something else

Page 39: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Applications

don’t run in a

vacuum

Page 40: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Ruby app

Page 41: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Ruby app

Ruby dependencies

Page 42: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Ruby app

Ruby dependencies

Native libraries

Page 43: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Ruby app

Ruby dependencies

Native libraries

Page 44: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Ruby app

Ruby dependencies

Native libraries

Nokogiri

libxml2

Page 45: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Ruby app

Ruby dependencies

Native libraries

Nokogiri

libxml2

Page 46: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Ruby app

Ruby dependencies

Native libraries

Nokogiri

libxml2

Page 47: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

How do we install software?

Page 48: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Nokogiri

libxml2

Page 49: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Nokogiri

libxml2

$ bundle install

Page 50: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Nokogiri

libxml2 $ apt-get install libxml2

$ bundle install

Page 51: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Nokogiri

libxml2 Chef or whatever

App’s source repository

Page 52: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

That seems inconvenient…

Page 53: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Container images: totally a thing

Page 54: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Nokogiri

libxml2 Chef or whatever

App’s source repository

Page 55: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Nokogiri

libxml2 App’s source repository

App’s source repository

Page 56: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

This is why most people care about

Docker

Page 57: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

namespaces cgroups images

Page 58: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

namespaces cgroups images

Page 59: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

https://twitter.com/benjiweber/status/770306615555854336

Page 60: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Deploying software reliably

How containers can help

Other options

Page 61: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Deploying software reliably

How containers can help

Other options

Page 62: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

So what did we care about?

Page 63: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Uniform deployment

Page 64: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Uniform deployment

Based around an artifact

Page 65: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Uniform deployment

Based around an artifact

Fail early

Page 66: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

And what didn’t we care about?

Page 67: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Know what your aims aren’t

Page 68: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Distributed schedulers

Page 69: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

compute compute compute !!!computecompute

Page 70: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Scheduler

compute compute compute !!!computecompute

Page 71: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

compute compute compute !!!computecompute

SchedulerApp

App

App

Page 72: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

compute compute compute !!!computecompute

Scheduler

AppAppApp

Page 73: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

compute compute compute !!!computecompute

Scheduler

AppApp App

Page 74: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Nothing comes for free

Page 75: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Kubernetes means:

Page 76: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Kubernetes means: — a distributed scheduler

Page 77: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Kubernetes means: — a distributed scheduler — cluster DNS

Page 78: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Kubernetes means: — a distributed scheduler — cluster DNS — etcd

Page 79: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Kubernetes means: — a distributed scheduler — cluster DNS — etcd — …

Page 80: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Nothing comes for free

Page 81: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

We aren’t #webscale

(#sorrynotsorry)

Page 82: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Distributed schedulers

Page 83: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Distributed schedulers

Page 84: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

So what did we build?

Page 85: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

3 parts…

Page 86: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Service definitions

Page 87: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

A service:

Page 88: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

A service: — an image

Page 89: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

A service: — an image — environment config

Page 90: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

A service: — an image — environment config — command to run

Page 91: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

A service: — an image — environment config — command to run — limits (memory, CPU)

Page 92: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

A service: — an image — environment config — command to run — limits (memory, CPU) — …

Page 93: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

This is config management

Page 94: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

So we used Chef

Page 95: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Chef

Service A

Service C

Service B

Page 96: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Chef

Service A

Service C

Service B

Compute 1

Compute 2

Compute 3

Page 97: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Chef

Service A

Service C

Service B

Compute 1Service A Service B

Compute 2

Compute 3

config

Page 98: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Chef

Service A

Service C

Service B

Compute 1Service A Service B

Compute 2Service B Service C

Compute 3

config

Page 99: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Chef

Service A

Service C

Service B

Compute 1Service A Service B

Compute 2Service B Service C

Compute 3Service A Service C

config

Page 100: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Chef

Service A

Service C

Service B

Compute 1Service A Service B

Compute 2Service B Service C

Compute 3Service A Service C

Page 101: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Service definitions

Page 102: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Service definitions

Single-node orchestration

Page 103: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Enter Conductor

Page 104: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

conductor service upgrade --id gocardless_app_production --revision 279d903588

Page 105: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

conductor service upgrade --id gocardless_app_production --revision 279d903588

Page 106: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

conductor service upgrade --id gocardless_app_production --revision 279d903588

Page 107: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

The flow:

Page 108: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

The flow: — start containers for new version

Page 109: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

The flow: — start containers for new version — wait for health check

Page 110: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

The flow: — start containers for new version — wait for health check — rewrite local nginx config

Page 111: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

The flow: — start containers for new version — wait for health check — rewrite local nginx config — reload nginx

Page 112: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

The flow: — start containers for new version — wait for health check — rewrite local nginx config — reload nginx — stop old containers

Page 113: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Conductor

nginx Docker

Page 114: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Conductor

nginx Docker

Old

Page 115: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Conductor

nginx

traffic

Oldtraffic

Docker

Page 116: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Conductor

nginx

traffic

Old

New

traffic

API

Docker

Page 117: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Conductor

nginx

traffic

Old

New

traffic

health check

Docker

Page 118: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Conductor

nginx

traffic

Old

New

traffic

config

Docker

Page 119: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Conductor

nginx

traffic

Old

Newtraffic

reload

Docker

Page 120: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Conductor

nginx

traffic

Old

Newtraffic

Docker

Page 121: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Conductor

nginx

traffic

Old

Newtraffic

Docker

API

Page 122: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Conductor

nginx

traffic Newtraffic

Docker

API

Page 123: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Conductor

nginx

traffic Newtraffic

Docker

Page 124: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

What about cron jobs?

Page 125: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

conductor cron generate --id gocardless_cron_production --revision 279d903588

Page 126: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

conductor cron generate --id gocardless_cron_production --revision 279d903588

Page 127: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

gocardless/ ▼ app/ payment_stuff.rb ▶ lib/ generate-cron

Page 128: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

# Clean up expired API tokens

*/30 * * * * scripts/cleanup-api-tokens

Page 129: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

# Clean up expired API tokens

*/30 * * * * /usr/local/bin/conductor run --id gocardless_cron_production --revision 279d903588 scripts/cleanup-api-tokens

Page 130: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Service definitions

Single-node orchestration

Page 131: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Service definitions

Single-node orchestration

A way to trigger deploys

Page 132: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Keep it boring

Page 133: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Keep it in Capistrano

Page 134: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Capistrano

Legacy infra

deploy

Page 135: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Capistrano

Legacy infra

deploy

New infra

deploy

Page 136: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Help developers do their job

Page 137: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

$💯

Page 138: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

1thing missing

Page 139: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

– a computer

“Hey, this process died.”

Page 140: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Process Process Process

Supervisor

Page 141: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Process Process Process

Supervisor

Page 142: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Process Process Process

Supervisor

👀

Page 143: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Process Process Process

Supervisor

start

Page 144: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Some supervisors:

Page 145: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Some supervisors: — Upstart

Page 146: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Some supervisors: — Upstart — systemd

Page 147: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Some supervisors: — Upstart — systemd — runit

Page 148: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Those didn’t play well with

Docker

Page 149: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Docker restart policies

Page 150: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

We didn’t get along well

Page 151: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Hard to stop or

Gave up entirely

Page 152: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Hard to stop or

Gave up entirely

Page 153: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

We built a process supervisor 😬

Page 154: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

conductor supervise

Page 155: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Specifically:

Page 156: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Specifically: — check number of containers

Page 157: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Specifically: — check number of containers — health check each container

Page 158: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Specifically: — check number of containers — health check each container

Page 159: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Specifically: — check number of containers — health check each container — restart if either fails

Page 160: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Specifically: — check number of containers — health check each container — restart if either fails — at most every 5 seconds

Page 161: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

# service conductor-supervise stop

Page 162: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

We don’t want this piece of software

Page 163: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

$💯

Page 164: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Deploying software reliably

How containers can help

Other options

Page 165: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Deploying software reliably

How containers can help

Other options

Page 166: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

systemd + rkt or

VMs + autoscaling

Page 167: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Supervisor: systemd

Containers: rkt

Page 168: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Supervisor: systemd

Containers: rkt

Page 169: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

To fit our usage:

Page 170: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

To fit our usage: — Conductor generates systemd config

Page 171: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

To fit our usage: — Conductor generates systemd config — systemd manages processes

Page 172: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

To fit our usage: — Conductor generates systemd config — systemd manages processes — Delete conductor supervise

Page 173: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

To fit our usage: — Conductor generates systemd config — systemd manages processes — Delete conductor supervise — HTTP health checks???

Page 174: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

systemd + rkt or

VMs + autoscaling

Page 175: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Supervisor: autoscaling

Containers → VMs

Page 176: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Supervisor: autoscaling

Containers → VMs

Page 177: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)
Page 178: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)
Page 179: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Meta-thoughts

Page 180: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Meta-thoughts

Page 181: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Some reckons 🤔

Page 182: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Introduce new infrastructure

where failure is survivable

Page 183: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Non-critical batch jobs ↓

Background workers ↓

API servers

Page 184: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Goal state is what matters

Page 185: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Everything might change before your

next method call

Page 186: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

The system isn’t interesting

without context

Page 187: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Start with why

Page 188: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Thank you✌❤

@ChrisSinjo @GoCardlessEng

Page 189: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

We’re hiring✌❤

@ChrisSinjo @GoCardlessEng

Page 190: a million containers isnt cool - USENIX...A million containers isn’t cool You know what’s cool? A hundred containers. @ChrisSinjo GOCARDLESS We aren’t #webscale (#sorrynotsorry)

Questions?✌❤

@ChrisSinjo @GoCardlessEng