using docker, coreos, and git hooks to deploy applications

105
Introducing Huxley Using Docker, CoreOS, and Git Hooks to Deploy Applications

Upload: votu

Post on 13-Feb-2017

254 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Introducing Huxley

Using Docker, CoreOS, and Git Hooks to Deploy Applications

Page 2: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Dan

Page 3: Using Docker, CoreOS, and Git Hooks to Deploy Applications

LanceOut

sick :(

Page 4: Using Docker, CoreOS, and Git Hooks to Deploy Applications
Page 5: Using Docker, CoreOS, and Git Hooks to Deploy Applications

DockerLinu

x Container

s

Page 6: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Skeptical?

Page 7: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Cloud Computing

Page 8: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Skeptical?

Page 9: Using Docker, CoreOS, and Git Hooks to Deploy Applications

99 Problems

Page 10: Using Docker, CoreOS, and Git Hooks to Deploy Applications
Page 11: Using Docker, CoreOS, and Git Hooks to Deploy Applications

But we adapt…

Page 12: Using Docker, CoreOS, and Git Hooks to Deploy Applications
Page 13: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Fucking Shell Scripts Puppet/Chef

Ansible? Docker!

Page 14: Using Docker, CoreOS, and Git Hooks to Deploy Applications

No one wants that late night phone call.

Page 15: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Four Nines Five Nines Fast! Auto-scale

Page 16: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Web App

Page 17: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Web App DB

Page 18: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Web App DB

Web App

Web App

LB

Page 19: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Web App Slave

Web App

Web App

LB

Slave

DB

Page 20: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Web App Slave

Web App

Web App

LB

Slave

DB

Workers Workers Workers

Page 21: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Web App Slave

Web App

Web App

LB

Slave

DB

Workers Workers Workers

Web App Slave

Web App

Web App

LB

Slave

DB

Workers Workers Workers

DC-East DC-West

Page 22: Using Docker, CoreOS, and Git Hooks to Deploy Applications

“We’re big in Japan…”

Page 23: Using Docker, CoreOS, and Git Hooks to Deploy Applications
Page 24: Using Docker, CoreOS, and Git Hooks to Deploy Applications

:o

Page 25: Using Docker, CoreOS, and Git Hooks to Deploy Applications

What if…

Page 26: Using Docker, CoreOS, and Git Hooks to Deploy Applications

We had a cluster of Docker hosts…

Page 27: Using Docker, CoreOS, and Git Hooks to Deploy Applications
Page 28: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Web App

SlaveWeb App

Web App Slave

DB

Workers

Workers

Workers

Web App Slave

Web App

Web App

LB

Slave

DB

Workers Workers Workers

Page 29: Using Docker, CoreOS, and Git Hooks to Deploy Applications

“We’ve already got one…”

Page 30: Using Docker, CoreOS, and Git Hooks to Deploy Applications
Page 31: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Okay, now we need a resource broker…

Page 32: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Apache Mesos

Page 33: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Maybe we can just write one…

Page 34: Using Docker, CoreOS, and Git Hooks to Deploy Applications

“We’ve already got one…”

Page 35: Using Docker, CoreOS, and Git Hooks to Deploy Applications

fleetctl

Page 36: Using Docker, CoreOS, and Git Hooks to Deploy Applications

What about private DNS for Service Discovery…?

Page 37: Using Docker, CoreOS, and Git Hooks to Deploy Applications

“We’ve already got one…”

Page 38: Using Docker, CoreOS, and Git Hooks to Deploy Applications

SkyDNS

Page 39: Using Docker, CoreOS, and Git Hooks to Deploy Applications

SkyDNS

AWS Route53

Private DN

S

Page 40: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Putting it all together…

Page 41: Using Docker, CoreOS, and Git Hooks to Deploy Applications

1. Define a service

Page 42: Using Docker, CoreOS, and Git Hooks to Deploy Applications

2. Request deployment

Page 43: Using Docker, CoreOS, and Git Hooks to Deploy Applications

3. Deploy service

Page 44: Using Docker, CoreOS, and Git Hooks to Deploy Applications

4. Register DNS Endpoints

Page 45: Using Docker, CoreOS, and Git Hooks to Deploy Applications
Page 46: Using Docker, CoreOS, and Git Hooks to Deploy Applications

1. Set up a cluster 2. Set up fleet endpoint 3. Set up a git hook server 4. Write and test Dockerfiles (and .service files). 5. Clone the bare repo to the hook server 6. Write a script—

Our New Deployment Process!

Page 47: Using Docker, CoreOS, and Git Hooks to Deploy Applications

“How is this easier, again?”

Page 48: Using Docker, CoreOS, and Git Hooks to Deploy Applications

–Larry Wall, Programming Perl

“…the three great virtues of a programmer: laziness, impatience, and hubris…”

Page 49: Using Docker, CoreOS, and Git Hooks to Deploy Applications

panda-cluster panda-hook panda-kick

Page 50: Using Docker, CoreOS, and Git Hooks to Deploy Applications

These are MIT-licensed open source projects.

!

You can totally use them.

Page 51: Using Docker, CoreOS, and Git Hooks to Deploy Applications

panda-cluster

• Automate the management of clusters

• Resource allocation via fleet

• Deployment via git hook server

Page 52: Using Docker, CoreOS, and Git Hooks to Deploy Applications

panda-hook

• Clone a local repo to the cluster

• Subsequent pushes trigger deploys

• Deploys everything in launch directory

Page 53: Using Docker, CoreOS, and Git Hooks to Deploy Applications

panda-kick

• Internal HTTP service providing authenticated access to external services

• Ex: service announcements via private DNS

• Only services on the cluster can do this

Page 54: Using Docker, CoreOS, and Git Hooks to Deploy Applications

1. Set up a cluster 2. Set up fleet endpoint 3. Set up a git hook server 4. Write and test Dockerfiles (and .service files) 5. Clone the bare repo to the hook server 6. Write a script—

Our New Deployment Process!

Page 55: Using Docker, CoreOS, and Git Hooks to Deploy Applications
Page 56: Using Docker, CoreOS, and Git Hooks to Deploy Applications

git hook server

Page 57: Using Docker, CoreOS, and Git Hooks to Deploy Applications

git hook serverfleet endpoint

Page 58: Using Docker, CoreOS, and Git Hooks to Deploy Applications

git hook serverfleet endpoint

kick server

Page 59: Using Docker, CoreOS, and Git Hooks to Deploy Applications

git push stagingfleetctl start …

curl kick:2000 -XPOST …

Page 60: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Voila! Push-based deployments!

Page 61: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Self-Describing Deployments

Page 62: Using Docker, CoreOS, and Git Hooks to Deploy Applications

my-project/ bin/ launch/ src/ test/

Page 63: Using Docker, CoreOS, and Git Hooks to Deploy Applications

my-project/ bin/ launch/ src/ test/

Page 64: Using Docker, CoreOS, and Git Hooks to Deploy Applications

my-project/ bin/ launch/ src/ test/

Contains configuration and initialization files

Page 65: Using Docker, CoreOS, and Git Hooks to Deploy Applications

my-project/ bin/ launch/ web/ Dockerfile web.service db/ Dockerfile db.service worker/ Dockerfile worker.service src/ test/

Page 66: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Dockerfile

Page 67: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Service File

Page 68: Using Docker, CoreOS, and Git Hooks to Deploy Applications

README.txt!INSTALL.txt

Dockerfile my.service

Page 69: Using Docker, CoreOS, and Git Hooks to Deploy Applications

git push staging master

Page 70: Using Docker, CoreOS, and Git Hooks to Deploy Applications

So far, so good…

Page 71: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Auto-scaling

Page 72: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Better documentation

Page 73: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Testing

Page 74: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Lots of moving parts…

Page 75: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Lots of moving parts…

Page 76: Using Docker, CoreOS, and Git Hooks to Deploy Applications

MOAR PANDA!

Page 77: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Huxley

Page 78: Using Docker, CoreOS, and Git Hooks to Deploy Applications

panda-cluster panda-hook panda-kick

Page 79: Using Docker, CoreOS, and Git Hooks to Deploy Applications

panda-cluster panda-hook panda-kick

HTTP API

Page 80: Using Docker, CoreOS, and Git Hooks to Deploy Applications

panda-cluster panda-hook panda-kick

HTTP API

CLI

Page 81: Using Docker, CoreOS, and Git Hooks to Deploy Applications

panda-cluster panda-hook panda-kick

HTTP API

CLI

huxley create cluster staging

Page 82: Using Docker, CoreOS, and Git Hooks to Deploy Applications

huxley init

huxley remote add staging

huxley mixins add node ha-redis

Page 83: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Mixins?!

Page 84: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Mixins are predefined launch configurations

Page 85: Using Docker, CoreOS, and Git Hooks to Deploy Applications

my-project/ bin/ launch/ web/ Dockerfile web.service src/ test/

Page 86: Using Docker, CoreOS, and Git Hooks to Deploy Applications

huxley mixin add ha-redis

Page 87: Using Docker, CoreOS, and Git Hooks to Deploy Applications

my-project/ bin/ launch/ web/ Dockerfile web.service ha-redis/ Dockerfile redis.@service config.yaml src/ test/

Page 88: Using Docker, CoreOS, and Git Hooks to Deploy Applications

url: http://my-app.acme.com web: - web-0.local - web-1.local redis: - redis-0.local - redis-1.local

Page 89: Using Docker, CoreOS, and Git Hooks to Deploy Applications

url: http://my-app.acme.com web: - web-0.local - web-1.local redis: - redis-0.local - redis-1.local

public endpoint

private endpoints

private endpoints

Page 90: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Putting it all together…

Page 91: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Linux containers: disruptive

Page 92: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Automate container deployment onto clusters.

Page 93: Using Docker, CoreOS, and Git Hooks to Deploy Applications

panda-cluster panda-hook panda-kick

HTTP API

CLI

Huxley

Page 94: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Self-Describing Deployments

Page 95: Using Docker, CoreOS, and Git Hooks to Deploy Applications

my-project/ bin/ launch/ web/ Dockerfile web.service ha-redis/ Dockerfile redis.@service config.yaml src/ test/

Mixins

Page 96: Using Docker, CoreOS, and Git Hooks to Deploy Applications

managing clusters container deployment

writing mixins

DevOps

Page 97: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Status

panda-cluster!panda-hook!panda-kick!huxley!huxley-as-a-service

Page 98: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Status

panda-cluster!panda-hook!panda-kick!huxley!huxley-as-a-service

Page 99: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Status

panda-cluster!panda-hook!panda-kick!huxley!huxley-as-a-service

alpha

alpha

alpha

Page 100: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Status

panda-cluster!panda-hook!panda-kick!huxley!huxley-as-a-service

development

alpha

alpha

alpha

Page 101: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Status

panda-cluster!panda-hook!panda-kick!huxley!huxley-as-a-service

development

alpha

alpha

alpha

beta in March

Page 102: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Open Source/MIT License

panda-cluster!panda-hook!panda-kick!huxley

https://github.com/pandastrike/

Page 103: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Huxley-as-a-servicehttps://www.pandastrike.com/huxley

Page 104: Using Docker, CoreOS, and Git Hooks to Deploy Applications

Huxley-as-a-servicehttps://www.pandastrike.com/huxley

Join the beta!