webinar: from development to production with docker and mongodb

29
Docker + MongoDB Alvin Richards, Enterprise Products Lead [email protected] @jonnyeight

Upload: mongodb

Post on 26-Jan-2017

5.223 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Webinar: From Development to Production with Docker and MongoDB

Docker + MongoDB Alvin Richards, Enterprise Products Lead [email protected] @jonnyeight

Page 2: Webinar: From Development to Production with Docker and MongoDB

Part One – What is Docker?

Page 3: Webinar: From Development to Production with Docker and MongoDB

Docker Mission – Make the Internet Programmable

3

Build   Ship   Run  

Open  Standards  

Plumbing  

Pla6orm  

Solu8ons  

Engine Machine Compose Swarm

Distribution

Image spec Container run-time spec

RunC

Notary

Docker Trusted Registry

Project "Orca"

Page 4: Webinar: From Development to Production with Docker and MongoDB

           Open  Container  Ini-a-ve  

           RunC  

           notary  4

Open Standards & Plumbing

Page 5: Webinar: From Development to Production with Docker and MongoDB

Open Container Initiative (OCI)

Coalition of industry leaders join forces to eliminate fragmentation •  Form a vendor-neutral, open source governance model under the Linux

Foundation •  Establish common standards for container format and runtime •  Docker donated its container format, runtime and associated specifications •  Appoint maintainers for the libcontainer project

5

h3p://www.opencontainers.org/  

Page 6: Webinar: From Development to Production with Docker and MongoDB

           Networking    

           Plugins  

           Orchestra-on  6

Docker Platform

Page 7: Webinar: From Development to Production with Docker and MongoDB

Networking

8

Before  

•  Inflexible •  Single host •  Limited to one network

X

•  Container SDN •  Distributed networking •  Portable across networks •  Plug ins to broad ecosystem

ABer  

Page 8: Webinar: From Development to Production with Docker and MongoDB

Plugins Pluggable Architecture to extend Docker functionality •  Introducing Networking and Volume plugins •  For Users: Portability and choice for developers and ops •  For Partners: Easily integrate and access Docker users •  Collaboration with Cluster HQ, Glider Labs, Weave

9

Networking

Volumes

Docker  Engine   Plug  ins  

>  docker  

Docker client

Page 9: Webinar: From Development to Production with Docker and MongoDB

Orchestration Across the App Lifecycle

           Docker  Machine    

           Docker  Swarm  

           Docker  Compose  10

Page 10: Webinar: From Development to Production with Docker and MongoDB

Docker Compose and Swarm •  Consistent developer experience with flexible Swarm backends •  Integrated with Docker Networking •  Mesos backend beta available •  Amazon ECS backend collaboration WIP

11

docker  

Docker client

Coming Soon!

Page 11: Webinar: From Development to Production with Docker and MongoDB

Running Docker in Production

Three  Key  Use  Cases  

Produc-on  Requirements  

Commercial  Availability  12

Page 12: Webinar: From Development to Production with Docker and MongoDB

Continuous Integration and Delivery

13

Developer  

Version  control  

1.  Development   2.  Test   3.  Stage  /  Produc-on  

QA  /  QE  

Sysadmin  

Video from DockerCon

Page 13: Webinar: From Development to Production with Docker and MongoDB

Containers as a Service Developer   Sysadmin  

DevOps  

Tomcat

Jenkins

MongoDB Deployment  

Video from DockerCon

Page 14: Webinar: From Development to Production with Docker and MongoDB

SysAdmins DBAs

Data Processing Pipelines

Data Scientist

$ docker

Data Nodes

Video from DockerCon

Page 15: Webinar: From Development to Production with Docker and MongoDB

Docker Enterprise Solutions

16

Server or Cloud Hosted Registry

Docker Engine

Stable   Secure   Responsive  

Docker Trusted Registry

Docker Hub

or

Commercial Subscruption

Page 16: Webinar: From Development to Production with Docker and MongoDB

Get it here!

Page 17: Webinar: From Development to Production with Docker and MongoDB

Part Two: Development through to Production •  Build & Run an App in Development

–  Python + MongoDB •  Deploy to a Swarm cluster in Production

–  Scale Web services •  Deploy new MongoDB Cluster in Production

Page 18: Webinar: From Development to Production with Docker and MongoDB

Lets build an App!

19

web  

mongodb  

Development

python / flask

Page 19: Webinar: From Development to Production with Docker and MongoDB

Scale in Production

20

web2   web3   web4   webN  

mongos  cfg3  cfg2  cfg1  

web   web1  

mongodb  

Development

Production

HA  Proxy  

rs1a  

rs1b  

rs1c  

rs2a  

rs2b  

rs2c  

Page 20: Webinar: From Development to Production with Docker and MongoDB

Demo 1 : Build an App

21

Page 21: Webinar: From Development to Production with Docker and MongoDB

Roll the App to Production behind HA Proxy

22

web   web1  

Development Production

mongodb  

HA  Proxy  

mongodb  

Page 22: Webinar: From Development to Production with Docker and MongoDB

Scale the web tier

23

web2   web3   web4   webN  web   web1  

mongodb  

Development

Production

mongodb  

HA  Proxy  

Page 23: Webinar: From Development to Production with Docker and MongoDB

Demo 2 : Scale the Web Tier

24

Page 24: Webinar: From Development to Production with Docker and MongoDB

Deploy a sharded cluster

25

web2   web3   web4   webN  

mongos  cfg3  cfg2  cfg1  

web   web1  

mongodb  

Development

Production

mongodb  

HA  Proxy  

rs1a  

rs1b  

rs1c  

rs2a  

rs2b  

rs2c  

Page 25: Webinar: From Development to Production with Docker and MongoDB

Migrate to the new cluster

27

web2   web3   web4   webN  

mongos  cfg3  cfg2  cfg1  

web   web1  

mongodb  

Development

Production

mongodb  

HA  Proxy  

rs1a  

rs1b  

rs1c  

rs2a  

rs2b  

rs2c  

Page 26: Webinar: From Development to Production with Docker and MongoDB

Demo 3 : Scale the Database

28

Page 27: Webinar: From Development to Production with Docker and MongoDB

Storage: Inside or outside the container?

Inside •  Encapsulation of Concerns

29

Host

daemon

container

Host

daemon

container e.g. SSD

e.g. EBS

Outside •  Separation of concerns •  Storage Features (e.g. snapshots)

/data/db /mnt/xx:/data/db

Page 28: Webinar: From Development to Production with Docker and MongoDB

Summary

• Define  Container,  their  contents  and  how  they  work  together  once  • Deploy  the  same  images  in  Dev,  Pre-­‐Prod  and  Produc-on  across  PlaZorms  

One  solu-on  from  Dev  -­‐>  Produc-on  

• Ops  define  the  whitelisted  images,  security  policies  etc.  • Dev  use  approved  images  to  build  upon  • Eliminate  the  complexity  (and  cost)  of  deployment  

Running  Docker  &  MongoDB  in  Produc-on  

30

Page 29: Webinar: From Development to Production with Docker and MongoDB

Thanks and Q&A •  Code

–  https://github.com/alvinr/docker-demo/tree/master/dockercon15demo

•  [email protected] •  @jonnyeight

31