Something until the talk starts, eg. Flickr slideshow
Docker from Dev to Prodfor JavaSkop 2015
Chris@cimnine
Disclaimer: The opinions expressed are those of the speaker and do not reflect opinions of any other person, company or agency.
Chris@cimnine
Disclaimer: The opinions expressed are those of the speaker and do not reflect opinions of any other person, company or agency.
Chris@cimnine
Disclaimer: The opinions expressed are those of the speaker and do not reflect opinions of any other person, company or agency.
Dev CI Integration Pre-Prod Prod
orange lines are data flow and blue lines are control flow
VCS
DEVDEV CICI Integr.Integr.Pre
ProdPre
ProdProdProd
Dev
VCS
DEVDEV CICI Integr.Integr.Pre
ProdPre
ProdProdProd
Dev
orange lines are data flow and blue lines are control flow
VCS
DEVDEV CICI Integr.Integr.Pre
ProdPre
ProdProdProd
Dev
orange lines are data flow and blue lines are control flow
VCS
DEVDEV CICI Integr.Integr.Pre
ProdPre
ProdProdProd
Dev Ops
orange lines are data flow and blue lines are control flow
VCS
DEVDEV CICI Integr.Integr.
Dev Ops
Pre-Prod
Prod
orange lines are data flow and blue lines are control flow
Dev CI Integration Pre-Prod Prod
DevDev CI Integration Pre-Prod Prod
DevDev CI Integration Pre-Prod Prod
jar
Java
jar
Java
jar
Java
DevDev CI Integration Pre-Prod Prod
Dev CI Integration Pre-Prod Prod
VCS
DEVDEV CICI
Dev
orange lines are data flow and blue lines are control flow
VCS
DEVDEV CICI
Devgit push
orange lines are data flow and blue lines are control flow
VCS
DEVDEV CICI
Devpost-commit
hook
orange lines are data flow and blue lines are control flow
Dev CICI Integration Pre-Prod Prod
Dev CICI Integration Pre-Prod Prod
Dev CI Integration Pre-Prod Prod
VCS
DEVDEV CICI Integr.Integr.
Dev
?
orange lines are data flow and blue lines are control flow
VCS
DEVDEV CICI
Repository
Integr.Integr.
Dev
orange lines are data flow and blue lines are control flow
VCS
DEVDEV CICI
DockerRegistry
Integr.Integr.
Dev
orange lines are data flow and blue lines are control flow
VCS
DEVDEV CICI Integr.Integr.
Dev
DockerRegistry
dockerpush
orange lines are data flow and blue lines are control flow
VCS
DEVDEV CICI Integr.Integr.
Dev
DockerRegistry
ssh + docker run
orange lines are data flow and blue lines are control flow
VCS
DEVDEV CICI Integr.Integr.
HelperDev
DockerRegistry
orange lines are data flow and blue lines are control flow
VCS
DEVDEV CICI Integr.Integr.
HelperDev
DockerRegistry
install that thing
orange lines are data flow and blue lines are control flow
VCS
DEVDEV CICI Integr.Integr.
HelperDev
DockerRegistry
ssh + docker run
orange lines are data flow and blue lines are control flow
Dev CI Integration Pre-Prod Prod
Dev CI Integration Pre-Prod Prod
VCS
DEVDEV CICI Integr.Integr.
HelperDev
DockerRegistry
Pre ProdPre
ProdProdProd
orange lines are data flow and blue lines are control flow
VCS
DEVDEV CICI Integr.Integr.
HelperDev
DockerRegistry
Pre ProdPre
ProdProdProd
Ops
orange lines are data flow and blue lines are control flow
VCS
DEVDEV CICI Integr.Integr.
HelperDev
DockerRegistry
Pre ProdPre
ProdProdProd
Ops
orange lines are data flow and blue lines are control flow
VCS
DEVDEV CICI Integr.Integr.
HelperDev
DockerRegistry
Pre ProdPre
ProdProdProd
Ops
orange lines are data flow and blue lines are control flow
Easy Packaging
Consistent Dependencies
Repeatable Deployments
Easy Automation
Logging
Monitoring
Scaling
Continuous Delivery
Automatic Recovery
VCS
DEVDEV CICI Integr.Integr.
HelperDev
DockerRegistry
Pre ProdPre
ProdProdProd
Ops
orange lines are data flow and blue lines are control flow
VCS
DEVDEV CICI Integr.Integr.
HelperDev
DockerRegistry
Pre ProdPre
ProdProdProd
orange lines are data flow and blue lines are control flow
VCS
DEVDEV CICI Integr.Integr.
HelperDev
DockerRegistry
Pre ProdPre
ProdProdProd
orange lines are data flow and blue lines are control flow
VCS
DEVDEV CICI Integr.Integr.
Scheduler (Master)
Dev
DockerRegistry
Pre ProdPre
ProdProdProd
A A A
orange lines are data flow and blue lines are control flow
agent
VCS
DEVDEV CICI Integr.Integr.
Scheduler (Master)
Dev
DockerRegistry
Pre ProdPre
ProdProdProd
A A A
orange lines are data flow and blue lines are control flow
Cluster State
Master
Worker Host w/ Agent
Worker Host w/ Agent
Worker Host w/ Agent
Worker Host w/ Agent
Worker Host w/ Agent
Worker Host w/ Agent
Worker Host w/ Agent
Worker Host w/ Agent
Worker Host w/ Agent
Worker Host w/ Agent
Cluster State
Master
Worker Host w/ Agent
Worker Host w/ Agent
Worker Host w/ Agent
Worker Host w/ Agent
Worker Host w/ Agent
commands desired state vs. reports actual state
Cluster State
Master
Worker Host w/ Agent
Worker Host w/ Agent
Worker Host w/ Agent
Worker Host w/ Agent
Worker Host w/ Agent
commands desired state vs. reports actual state
Cluster State
Master
Worker Host w/ Agent
Worker Host w/ Agent
Worker Host w/ Agent
Worker Host w/ Agent
Worker Host w/ Agent
commands desired state vs. reports actual state
Cluster State
Master
Worker Host w/ Agent
Worker Host w/ Agent
Worker Host w/ Agent
Worker Host w/ Agent
Worker Host w/ Agent
commands desired state vs. reports actual state
Cluster State
Master
Worker Worker Worker Worker Worker
commands desired state vs. reports actual state
Cluster State
Master
Orchestration
Which container runs on which host?
Orchestration
Which container runs on which host?
How does the traffic come there?
Orchestration
Which container runs on which host?
How does the traffic come there?
How do the services talk with each other?
Orchestration
Which container runs on which host?
How does the traffic come there?
How do the services talk with each other?
How to do updates w/o service interruption?
Orchestration
Which container runs on which host?
How does the traffic come there?
How do the services talk with each other?
How to scale out?How to do updates w/o service interruption?
Orchestration
Which container runs on which host?
How does the traffic come there?
How do the services talk with each other?
Where do the logs go?
How to scale out?How to do updates w/o service interruption?
Orchestration
Which container runs on which host?
How does the traffic come there?
How do the services talk with each other?
Where do the logs go?
How to scale out?How to do updates w/o service interruption?
Orchestration
Orchestration
Kubernetes
Rancher
Docker Swarm
Apache Mesos with Marathon
Spotify Helios
Newrelic Centurion
Orchestration
Kubernetes
Rancher
Docker Swarm
Apache Mesos with Marathon
Spotify Helios
Newrelic Centurion
Cloud Provider
Google Container Engine
Amazon EC2 Container ServiceMicrosoft Azure
Redhat OpenstackCloudfoundry
heroku
Dev CI Integration Pre-Prod Prod
http://12factor.net
I. CodebaseOne codebase tracked in revision control, many deploys
II. DependenciesExplicitly declare and isolate dependencies
III. ConfigStore config in the environment
IV. Backing ServicesTreat backing services as attached resources
V. Build, release, runStrictly separate build and run stages
VI. ProcessesExecute the app as one or more stateless processes
VII. Port bindingExport services via port binding
VIII. ConcurrencyScale out via the process model
IX. DisposabilityMaximize robustness with fast startup and graceful shutdown
X. Dev/prod parityKeep development, staging, and production as similar as possible
XI. LogsTreat logs as event streams
XII. Admin processesRun admin/management tasks as one-off processes
Dev CI Integration Pre-Prod Prod
Databases•Very own requirements:
• State-full• Low CPU but high I/O• Distributed data• (usually) complex to scale• (usually) not built for “hot swap”
• not 12 Factor applications
Databases•Don’t dockerize databases
•Keep them external to the system• DBA will love you not hate you• Easier to maintain• Very own cluster mechanisms• Easier routing in Datacenters