ricon 2014 running riak in a docker cloud using apache brooklyn
DESCRIPTION
RICON 2014 presentation introducing Clocker - The Docker Cloud Maker featuring demonstration of Riak being deployed.TRANSCRIPT
Running Riak in a Docker cloud using Apache Brooklyn
Alex Heneveld @ahtwee<n Duncan Johnston-‐Wa@ @duncanjw
RICON 2014
Agenda • Clocker – Docker – Apache Brooklyn – Apache jclouds – Weave
• Deep Dive • Demonstra<on
Meet Clocker The Docker Cloud Maker
Clocker • What does it do? – Spin up and manage Docker clouds – Serve up containers on-‐demand
• What is it? – Apache Brooklyn Applica<on – Apache Brooklyn Loca<on
• Who started it? – Andrew Kennedy @grkvlt
Docker
Orchestra<on – The New Fron<er “The way in which Docker has enabled workloads to migrate across any opera<ng system and any environment has really kind of freed up development and opera<ons. We want to keep them going at the next layer of the stack, which is orchestra2on. Docker containers have been around for 15 months, so the developers' tools around them have an even shorter lifecycle. We're in the very early days of the category.”
Sco$ Johnston, SVP Product, Docker
Clocker Project • Open Source • Apache Licensed • S<ll in Beta – 0.7.0-‐SNAPSHOT
– h@p://brooklyncentral.github.io/clocker
Apache Brooklyn • Open Source • Donated to the Apache So^ware Founda<on • h@p://brooklyn.incubator.apache.org • Started by @ahtwee<n
Apache Brooklyn • Applica<on Management Pla`orm • Model, Deploy and Manage Blueprints – Services (En<<es) – Metrics (Sensors) – Ac<ons (Effectors)
Brooklyn Blueprint name: Riak Cluster with Webapp services: -‐ type: brooklyn.en<ty.nosql.riak.RiakCluster ini<alSize: 2 id: cluster brooklyn.config: install.version: 2.0.0 -‐ type: brooklyn.en<ty.webapp.jboss.JBoss7Server name: Hello Riak Web App brooklyn.config: wars.root: "h@ps://s3-‐eu-‐west-‐1.amazonaws.com/brooklyn-‐clocker/brooklyn-‐example-‐hello-‐world-‐sql-‐webapp.war" java.sysprops: brooklyn.example.riak.nodes: $brooklyn:component("cluster").a@ributeWhenReady("riak.cluster.nodeList") loca<on: jclouds:so^layer:sjc01
Apache Brooklyn • Deployment – Provisioning – Loca<ons – Installa<on and Customiza<on
• Packages, Scripts, Chef, SaltStack • Management – Policies
• AutoScaling, Resilience, Performance, Access
Apache jclouds • Java Cloud Library – h@p://jclouds.apache.org
• API Agnos<c – CloudStack, OpenStack, AWS EC2, GCE, So^Layer…
• Create Virtual Machines – Return SSH Endpoint – Manage Proper<es
Apache jclouds • Drivers for REST APIs • Docker Driver – Created by Andrea Turli @turlinux
• Virtual Container – Using SSH Daemon – Same Endpoint Type as VM – Composi<on on any Image or Dockerfile
Weave • So^ware Defined Networking – Ethernet Switch – User Space – Docker Container
• Sniffs Traffic on Host • Forwards over TCP • h@p://github.com/zepo/weave/
Weave
Clocker Deep Dive
The Docker Cloud Maker • Apache Brooklyn Applica<on – Docker Infrastructure
• Docker Engine • Docker Containers
– Weave Infrastructure • Weave Container
The Docker Cloud Maker • Apache Brooklyn Loca<on – Des<na<on for Blueprints
• Added Features – Create Containers – Provision Docker Hosts – A@ach to Weave Network – Manage Applica<on
Clocker Architecture
Clocker Architecture
Clocker Features • Applica<on Deployment – Oasis CAMP Blueprint – Same as Core Brooklyn
• Mixed Des<na<ons – Some Virtual Machines – Some Bare Metal – Some Containers
Clocker Features • Applica<on Deployment – Oasis CAMP Blueprint – Same as Core Brooklyn
• Docker Extensions – Container or Image – Placement Strategy – Dockerfile URL
Clocker Placement • Demand Side – New Container
• Supply Side – Where? – Placement Strategy – Provisioning Strategy
Clocker Placement • Placement Strategies – Depth First – Breadth First – CPU Usage – Affinity or An< Affinity – Memory or CPU Core Availability
Clocker Placement • Provisioning Strategy – New Docker Host Loca<on
• Constraints – Docker Infrastructure Constraints – En<ty or Applica<on Constraints
• User Defined Strategies • Intelligent Container Orchestra<on
Container Management • Sources – Docker Image Defini<on – Docker Hub – Dockerfile – Brooklyn En<ty Defini<on
• Create Image Automa<cally
Container Management id: dockerfile-‐mysql name: Docker Hub MySQL Application origin: "https://registry.hub.docker.com/_/mysql/" locations: -‐ my-‐docker-‐cloud services: -‐ type: brooklyn.entity.container.docker.application.DockerfileApplication id: mysql name: MySQL brooklyn.config: docker.dockerfile.url: file://Users/grkvlt/Git/docker-‐library/mysql/5.6/ env: MYSQL_ROOT_PASSWORD: "s3cr3t"
Container Management • Installa<on of Services – Defined by Brooklyn or Dockerfile – Common to all En<ty Instances
• Commit Image – Available for next En<ty
• Push Image – Available for all Hosts
Networking • Shared Weave LAN – Common to All Containers – Private (Link Local) Addresses
• Clocker Controls IP Alloca<on – Applica<ons Segmented by CIDR
• Docker Port Forwarding Access
Networking • S<ll First Steps… • Name Resolu<on – BIND and DNSmasq – Needed for JMX et al
• Enables Many More En<<es • But Needs Tested!
Demonstra2on
Riak Blueprint name: Hello Riak Web App services: -‐ type: brooklyn.en<ty.nosql.riak.RiakCluster ini<alSize: 2 id: cluster brooklyn.config: install.version: 2.0.0 -‐ type: brooklyn.en<ty.webapp.jboss.JBoss7Server name: Web App brooklyn.config: wars.root: "h@ps://s3-‐eu-‐west-‐1.amazonaws.com/brooklyn-‐clocker/brooklyn-‐example-‐hello-‐world-‐sql-‐webapp.war" java.sysprops: brooklyn.example.riak.nodes: $brooklyn:component("cluster").a@ributeWhenReady("riak.cluster.nodeList") loca<on: my-‐docker-‐cloud
Summary • Clocker – Brooklyn + Docker + Jclouds + Weave
• Solves – Docker Networking – Container Placement – Applica<on Defini<on
Web Resources
http://clocker.io/
http://brooklyn.io/
http://docker.io/
http://github.com/zettio/weave/
http://abstractvisitorpattern.co.uk/
Thanks! Ques<ons?
Roadmap Now • Improvements To Networking – DNS and DNSmasq Integra<on – Work in Progress
• Be@er Gepng Started – Self Hos<ng on Localhost – Brooklyn Dockerfile
Roadmap Soon • Be@er Integra<on with Repositories – Docker Hub, Ar<factory, Quay.io – Private Repositories
• Easier Applica<on Defini<on – Open Standard? – Kubernetes Pods?
Roadmap Next • Integra<on – Google Kubernetes – ClusterHQ Flocker – Ar<factory
• Improvements – Bootstrapping