SlideShare une entreprise Scribd logo
1  sur  58
Télécharger pour lire hors ligne
Using  Apache  Brooklyn  and  
Docker  to  Simulate  your  
Production  Environments  in  
the  Cloud
Andrew  Kennedy
grkvlt@apache.org
ApacheCon  Austin,  TX;  April  2015
Andrew  Kennedy  @grkvlt
Simulating  Production
Using  Apache  Brooklyn  and  Clocker  to  Simulate  
Production  Environments  in  the  Cloud
@grkvlt
Introduction
• Andrew  Kennedy
– Clocker  Project  Founder  and  Lead  Engineer
– Open  Source  and  Distributed  Systems
– Apache  Committer  for  Brooklyn  and  Qpid
– github.com/grkvlt
• Cloudsoft  Corporation
– Open  Source  Application  Management  Specialists
@grkvlt
Agenda
1. Clocker  Introduction
2. What  is  a  Docker  Cloud?
3. Demonstration
4. Clocker  Applications
5. Simulating  Production?
6. Questions
Clocker  Introduction
@grkvlt
What  does  it  do?
1. Spins  up  and  Manages  Docker  
Clouds
2. Serves  up  Containers  on  Demand
3. Manages  Composite  Application  
Deployments  on  Docker
@grkvlt
What  does  it  provide?
• Multi  Host  and  Multi  Container  Applications
• Seamless  Networking
– Communication  Between  Services
• Orchestration  and  Clustering
– Control  of  Containers
– Container  Management
@grkvlt
Who  is  using  it?
• Testing  and  Proof  of  Concept  Stage
– Financial  Services
– Insurance
• Production
– Multi-­‐tenant  Application  Trial
– Container  per  service
– Ideally  suited  to  the  Clocker  model
@grkvlt
Where  can  I  find  it?
• Open  Source  on  GitHub
• Apache  2.0  Licensed
• http://clocker.io
• Status
• 0.8.0  Developer  Preview  available  now
• 0.8.0  Release  at  Docker  Meetup  this  week!
What  is  a  Docker  Cloud?
@grkvlt
Docker  Cloud
1. On-­‐demand
2. Multi-­‐Tenant
3. Hardware  Independent
4. Application  Driven
@grkvlt
Clocker  and  Brooklyn
• What  is  it?
– Brooklyn  Application  and  Location
– Uses  jclouds  for  Docker  access
• What  does  it  provide?
– First  Class  Docker  Support  in  Brooklyn
– Optimized  Brooklyn  Blueprints  for  Docker
@grkvlt
Apache  Brooklyn
• Application  Management  Platform
• Deploy,  Manage  and  Monitor  Blueprints
• Provisioning,  Installation  and  Customization
• Management
– AutoScaling,  Resilience,  Performance,  Security
@grkvlt
Apache  jclouds
• Java  Cloud  Library
• API  Agnostic
• Create  Virtual  Machines
• Docker  Driver  by  @turlinux
• Virtual  Container
@grkvlt
Docker
• Popular
• Containers
– Isolation
– Performance
– Composable
– Complex
– The  Future...
@grkvlt
Software-­‐defined  Networking
• Pluggable  providers
• Weave
• Project  Calico
• New  in  0.8.0
• DOVE
• Write  your  own!
@grkvlt
Clocker  Orchestration
Docker  
Engine
Virtual  
Machine
ContainerClocker
Network  
Segment
SDN
Cloud
Demonstration
@grkvlt
Features
• Orchestrated  Docker  1.5.0  deployment  with  SDN  
integration
• Automated  attachment  of  containers  to  multiple  
dynamic  networks
• Brooklyn  application  blueprints  with  network  
topology
• Docker  images  as  Brooklyn  entity  source
Clocker  Applications
@grkvlt
Clocker  Features
• Application  Deployment
– Oasis  CAMP  YAML  Blueprint
– TOSCA  in  Development
– Docker  Compose
– Core  Brooklyn
• Mixed  Destinations
– Some  Virtual  Machines
– Some  Bare  Metal
– Some  Containers
@grkvlt
Clocker  Features
• Docker  Extensions  to  Brooklyn
– Dockerfile  or  Image  Specification  for  Installation
– Placement  Strategies  for  Containers
– Create  Docker  Images  and  Networks
• Manages  Docker  Engine
– Deployment  and  Management
– Installation  and  Configuration
– Software-­‐Defined  Networking
@grkvlt
Brooklyn  Blueprints
• Describe  Applications
• OASIS  CAMP  Standard
• List  of  Services
• Tree  Structure
• Sensors,  Effectors  and  Policies
@grkvlt
Blueprint  Example
name:  appserver-­‐w-­‐policy
services:
-­‐ type:  brooklyn.entity.webapp.ControlledDynamicWebAppCluster
initialSize:  1
memberSpec:
$brooklyn:entitySpec:
type:  brooklyn.entity.webapp.jboss.JBoss7Server
brooklyn.config:
wars.root:
http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-­‐example-­‐hello-­‐world-­‐sql-­‐webapp/0.6.0/brooklyn-­‐example-­‐hello-­‐world-­‐sql-­‐webapp-­‐
0.6.0.war
http.port:  8080+
java.sysprops:  
brooklyn.example.db.url:  $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
component("db").attributeWhenReady("datastore.url"),  "visitors",  "brooklyn",  "br00k11n")
brooklyn.policies:
-­‐ policyType:  brooklyn.policy.autoscaling.AutoScalerPolicy
brooklyn.config:
metric:  $brooklyn:sensor("brooklyn.entity.webapp.DynamicWebAppCluster",  "webapp.reqs.perSec.windowed.perNode")
metricLowerBound:  10
metricUpperBound:  100
minPoolSize:  1
maxPoolSize:  5
-­‐ type:  brooklyn.entity.database.mysql.MySqlNode
id:  db
name:  DB  HelloWorld  Visitors
brooklyn.config:
datastore.creation.script.url:
https://github.com/apache/incubator-­‐brooklyn/raw/master/usage/launcher/src/test/resources/visitors-­‐creation-­‐script.sql
@grkvlt
Application  Components
• Services
• Catalog  Entries
• Defined  by  Brooklyn  Code
• Policies
• Sensors
• Enrichers
@grkvlt
Services
• Brooklyn  Entities
• Installed  by  running  SSH  commands
• Add  packages  or  extract  archive  files
• Run  arbitrary  commands
• Clocker  commits  image  after  installation
@grkvlt
Container  Definition
• Sources
– Brooklyn  Entity  Definition
– Chef  Recipe
– Docker  Image  Definition
– Dockerfile
• Create  Image  Automatically
– Commit  or  Push  for  Reuse
@grkvlt
Container  Definition
id:  docker-­‐haproxy
name:  "Docker  Hub  HAProxy  Load  Balancer"
origin:  "https://registry.hub.docker.com/_/haproxy/"
locations:
-­‐ my-­‐docker-­‐cloud
services:
-­‐ type:  brooklyn.entity.proxy.haproxy.HAProxyController
id:  haproxy
brooklyn.config:
docker.image.name:  haproxy
docker.image.tag:  1.5.9
install.dir:  /usr/local/sbin/
run.dir:  /usr/local/etc/haproxy/
network.list:
-­‐ dmz
@grkvlt
Container  Definition
id:  dockerfile-­‐mysql
name:  "Docker  Hub  MySQL  Database"
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:
"https://s3-­‐eu-­‐west-­‐1.amazonaws.com/brooklyn-­‐clocker/mysql-­‐5.6.tgz"
docker.container.environment:
MYSQL_ROOT_PASSWORD:  "s3cr3t"
@grkvlt
Container  Definition
id:  dockerfile-­‐mysql
name:  "Docker  Hub  LAMP  Stack"
locations:
-­‐ my-­‐docker-­‐cloud
services:
-­‐ type:  docker:mysql:5.7.5
id:  mysql
env:
MYSQL_ROOT_PASSWORD:  "s3cr3t"
-­‐ type:  docker:grkvlt/myapp:latest
id:  application
env:
MYSQL_HOST:
$brooklyn:component("mysql").attributeWhenReady("host.hostname")
@grkvlt
Container  Placement
• Where  do  we  want  the  service  to  run?
• Supply  and  Demand
– Here's  the  locations  you  can  use...
– I  want  a  very  specific  location...
• Docker  Swarm
– Possible  future  integration  point...
@grkvlt
Container  Placement
• Demand
– Adding  an  Application
– Scaling  existing  Application
• Requirements
– Host  Location
– Service  Resources
– CPU,  Memory
@grkvlt
Container  Placement
• Supply
– Choose  a  Host  from  available
– Create  new  Host  if  required
• Start  Container  there
– Set  CPU  and  Memory
– Attach  to  Network
@grkvlt
Container  Placement
• Placement  Strategies
– Random,  Depth  or  Breadth  First
– CPU  or  Memory  Usage
– Memory,  CPU  or  Container  Limits
– Geographic  Constraints
• User  Defined
– Java  Predicate
@grkvlt
Placement  Strategy
• Deterministic
• Simple
– Predicate  and  Comparator
docker.container.strategies:
-­‐ $brooklyn:object:
type:  "brooklyn.location.docker.strategy.MaxContainersPlacementStrategy”
brooklyn.config:
maxContainers:  16
-­‐ $brooklyn:object:
type:  "brooklyn.location.docker.strategy.CpuUsagePlacementStrategy”
brooklyn.config:
maxCpu:  0.75
@grkvlt
Autonomics
• Brooklyn  Policies
• Attached  to  Entities  in  Application
– Nothing  Docker  Specific
• Elastic  Scaling
– Cluster  Resizing
– Sensor  Driven
@grkvlt
Application  Resilience
• Service  Resilience  and  Replacement
–Restart  Service  and  Container
–Application  Level,  Not  Infrastructure
–Same  as  Cloud
• Snapshot  Running  Container  for  Restart
@grkvlt
Headroom
• Ensure  resources  available
• Based  on  MaxContainers  strategy  limit
– Or  Percentage  Utilization
– Or  CPU  and  RAM  allocation
• Scale  Docker  Host  Cluster  Automatically  
– Add  new  Docker  hosts
– Remove  empty  Docker  hosts
@grkvlt
Software-­‐Defined  Networking
• Needed  for  Seamless  Provisioning
• Host  to  Host  Communication
– Same  LAN  Segment
– No  Port  Forwarding
– Natural  Application  Configuration
• Initial  Driver  was  EPMD  Applications
@grkvlt
Networking  Providers
• Implementation  Agnostic
– L2  over  L3  etc.
– Similar  to  Hypervisor  in  Clouds
• Generic  Interfaces
– Host  Component
– Service  Component  (or  Endpoint)
@grkvlt
Clocker  Networking
ContainerHost
SDN  
Bridge
Container
Internet
SDN  
Gateway
@grkvlt
Networking  Capabilities
• Provide  Multiple  Networks
– Single  Application  or  Shared
– Private  Addresses
– Segmented  by  CIDR
• Docker  Port  Forwarding  Access
– Debug  Mechanism
Simulating  Production?
@grkvlt
Application  Development  Cycle
1. Development
2. Continuous  Integration
3. UAT  or  Testing
4. Staging
5. Production
@grkvlt
Dev  Cycle  Reality
• My  Laptop
• Jenkins  Server
• Bob's  Laptop
• Some  spare  VMs  we  found...
• The  best  we  can  afford
– until  next  year's  budget...?
@grkvlt
Application  Development
• Same  Application
• Different  Infrastructures
– Very  Different
• So  ends  up...
– Different  Application
@grkvlt
Application  Development
• Which  means
– We  aren't  testing  the  right  things
– Production  is  probably  broken  under  load  or  scale
– Ops  are  unhappy  ;(
@grkvlt
Different  Application
• Very  Different!
– No  resilient  pairs
– No  failover
– No  load  balancer
– No  Clustering
– Single  network,  namespace,  domain,  etc.
@grkvlt
How  can  we  fix  this?
• Perfect  worlds
• All  environments  identical
• Staging  is an  exact copy  of  production
– Ready  for  App  and  Infra  cut-­‐over
• UAT  is Staging,  with  anonymized  data
• And  so  on,  rolling  through  environments
@grkvlt
How  can  we  fix  this?
• CI  becomes  CD
– Dedicated  production-­‐level  environment  for  builds
– Successful  builds  promoted  to  UAT
• Test  and  Dev...?
– You  have  to  make  some  sacrifices  ;)
– But  will  try  and  test  the  HA  mechanism  and  so  on  in  
isolation
– But  alt  least  Ops  are  happy
@grkvlt
How  can  we  fix  this?
• Imperfect  world
• Or,  the  DevOps way
– We  don't  have  enough  money  for  six  copies  of  our  architecture
– Particularly  at  scale  or  with  large  data  sets
– So  we  fake  it!
• The  important thing  is  our  architecture
– It  defines  the  application  completely
– We  describe  this  once in  a  blueprint
– And  then  deploy  to  our  various  environments
@grkvlt
Clocker  and  DevOps
• Application  blueprint
• Describes
– Services
• Configuration
– Policies
– Networks
– Hierarchy
• Connections
• Can  be  deployed  to  any  Brooklyn  Location
@grkvlt
Clocker  and  DevOps
• Locations  include
– Vagrant  or  other  VMs  on  my  laptop
– Apache  jclouds  supported  providers
• On  premise  OpenStack  CI  cloud
• Public  SoftLayer  environment
• ...  choose  your  favourite
– Docker  Clouds  using  Clocker
• Containers  instead  of  VMs
• Automatically
• No  input  from  developer  required
@grkvlt
There's  More  Than  One  Way...
• Could  use  Clocker  and  Docker  everywhere
– Generate  Docker  image  during  build  process
– Size  underlying  VMs  appropriately
– Allocate  different  CPU/memory  to  containers
– Deploy  images  to  Clocker  everywhere
• Many  enterprises  not  yet  ready  for  this...
Thank  You!
Questions?
@grkvlt
Web  Resources
http://clocker.io/
http://brooklyn.io/
http://docker.io/
http://weave.works/
http://projectcalico.org/
http://abstractvisitorpattern.co.uk/

Contenu connexe

Tendances

2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
Mirantis
 
Building a PaaS Platform like Bluemix on OpenStack
Building a PaaS Platform like Bluemix on OpenStackBuilding a PaaS Platform like Bluemix on OpenStack
Building a PaaS Platform like Bluemix on OpenStack
Animesh Singh
 
Docker Based Hadoop Provisioning
Docker Based Hadoop ProvisioningDocker Based Hadoop Provisioning
Docker Based Hadoop Provisioning
DataWorks Summit
 

Tendances (20)

Triple-E’class Continuous Delivery with Hudson, Maven, Kokki and PyDev
Triple-E’class Continuous Delivery with Hudson, Maven, Kokki and PyDevTriple-E’class Continuous Delivery with Hudson, Maven, Kokki and PyDev
Triple-E’class Continuous Delivery with Hudson, Maven, Kokki and PyDev
 
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
 
Building a PaaS Platform like Bluemix on OpenStack
Building a PaaS Platform like Bluemix on OpenStackBuilding a PaaS Platform like Bluemix on OpenStack
Building a PaaS Platform like Bluemix on OpenStack
 
Cloud orchestration major tools comparision
Cloud orchestration major tools comparisionCloud orchestration major tools comparision
Cloud orchestration major tools comparision
 
Cloud Foundry Technical Overview at IBM Interconnect 2016
Cloud Foundry Technical Overview at IBM Interconnect 2016Cloud Foundry Technical Overview at IBM Interconnect 2016
Cloud Foundry Technical Overview at IBM Interconnect 2016
 
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-2
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-22012 CloudStack Design Camp in Taiwan--- CloudStack Overview-2
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-2
 
IBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptx
IBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptxIBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptx
IBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptx
 
Cloud computing and OpenStack
Cloud computing and OpenStackCloud computing and OpenStack
Cloud computing and OpenStack
 
Get you Java application ready for Kubernetes !
Get you Java application ready for Kubernetes !Get you Java application ready for Kubernetes !
Get you Java application ready for Kubernetes !
 
Cloud Foundry for Spring Developers
Cloud Foundry for Spring DevelopersCloud Foundry for Spring Developers
Cloud Foundry for Spring Developers
 
Simplify Cloud Applications using Spring Cloud
Simplify Cloud Applications using Spring CloudSimplify Cloud Applications using Spring Cloud
Simplify Cloud Applications using Spring Cloud
 
How easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performanceHow easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performance
 
Docker Based Hadoop Provisioning
Docker Based Hadoop ProvisioningDocker Based Hadoop Provisioning
Docker Based Hadoop Provisioning
 
Building Multi-Site and Multi-OpenStack Cloud with OpenStack Cascading
Building Multi-Site and Multi-OpenStack Cloud with OpenStack CascadingBuilding Multi-Site and Multi-OpenStack Cloud with OpenStack Cascading
Building Multi-Site and Multi-OpenStack Cloud with OpenStack Cascading
 
CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...
CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...
CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...
 
Shared networks to support VNF high availability across OpenStack multi-regio...
Shared networks to support VNF high availability across OpenStack multi-regio...Shared networks to support VNF high availability across OpenStack multi-regio...
Shared networks to support VNF high availability across OpenStack multi-regio...
 
Cloudfoundry Introduction
Cloudfoundry IntroductionCloudfoundry Introduction
Cloudfoundry Introduction
 
Extending Alfresco Digital Workspace with Docusign
Extending Alfresco Digital Workspace with DocusignExtending Alfresco Digital Workspace with Docusign
Extending Alfresco Digital Workspace with Docusign
 
Container Orchestration with Docker Swarm and Kubernetes
Container Orchestration with Docker Swarm and KubernetesContainer Orchestration with Docker Swarm and Kubernetes
Container Orchestration with Docker Swarm and Kubernetes
 
Kubernetes and Cloud Native Update Q4 2018
Kubernetes and Cloud Native Update Q4 2018Kubernetes and Cloud Native Update Q4 2018
Kubernetes and Cloud Native Update Q4 2018
 

En vedette

Asta Simt Eu Pt 1 1
Asta Simt Eu Pt 1  1  Asta Simt Eu Pt 1  1
Asta Simt Eu Pt 1 1
blarisa
 
How2 Start Ocw
How2 Start OcwHow2 Start Ocw
How2 Start Ocw
Terri Bays
 
Lectii Corporative
Lectii CorporativeLectii Corporative
Lectii Corporative
Alexandru S
 
Jim Webber A Couple Of Ways To Skin An Internet Scale Catx
Jim Webber A Couple Of Ways To Skin An Internet Scale CatxJim Webber A Couple Of Ways To Skin An Internet Scale Catx
Jim Webber A Couple Of Ways To Skin An Internet Scale Catx
deimos
 
Day 3 2nd_weekcris
Day 3 2nd_weekcrisDay 3 2nd_weekcris
Day 3 2nd_weekcris
cristiarnau
 
Comune Di Casier Per Pubblicazione Con Dati Di Confronto Superiori A 10000 Ab
Comune Di Casier Per Pubblicazione Con Dati Di Confronto Superiori A 10000 AbComune Di Casier Per Pubblicazione Con Dati Di Confronto Superiori A 10000 Ab
Comune Di Casier Per Pubblicazione Con Dati Di Confronto Superiori A 10000 Ab
maurinbu
 
Flipflops
FlipflopsFlipflops
Flipflops
becz_y
 

En vedette (20)

Connecting Commnities - online tools for networking for community groups
Connecting Commnities - online tools for networking for community groupsConnecting Commnities - online tools for networking for community groups
Connecting Commnities - online tools for networking for community groups
 
Business Model Canvas
Business Model CanvasBusiness Model Canvas
Business Model Canvas
 
Utah 08 Welcome 091808 Ocwc
Utah 08 Welcome 091808 OcwcUtah 08 Welcome 091808 Ocwc
Utah 08 Welcome 091808 Ocwc
 
You have it? Tips for successful business handoffs
You have it? Tips for successful business handoffsYou have it? Tips for successful business handoffs
You have it? Tips for successful business handoffs
 
Asta Simt Eu Pt 1 1
Asta Simt Eu Pt 1  1  Asta Simt Eu Pt 1  1
Asta Simt Eu Pt 1 1
 
How2 Start Ocw
How2 Start OcwHow2 Start Ocw
How2 Start Ocw
 
資訊作業
資訊作業資訊作業
資訊作業
 
Myths and Realities of Cloud Data Security
Myths and Realities of Cloud Data SecurityMyths and Realities of Cloud Data Security
Myths and Realities of Cloud Data Security
 
Lectii Corporative
Lectii CorporativeLectii Corporative
Lectii Corporative
 
Parco avventure madonie_2011-12
Parco avventure madonie_2011-12Parco avventure madonie_2011-12
Parco avventure madonie_2011-12
 
Jim Webber A Couple Of Ways To Skin An Internet Scale Catx
Jim Webber A Couple Of Ways To Skin An Internet Scale CatxJim Webber A Couple Of Ways To Skin An Internet Scale Catx
Jim Webber A Couple Of Ways To Skin An Internet Scale Catx
 
Skype project
Skype projectSkype project
Skype project
 
Escape The Silo: Why and How to Escape Your Professional Silo - ILA/ACRL ke...
Escape The Silo:  Why and How to Escape  Your Professional Silo - ILA/ACRL ke...Escape The Silo:  Why and How to Escape  Your Professional Silo - ILA/ACRL ke...
Escape The Silo: Why and How to Escape Your Professional Silo - ILA/ACRL ke...
 
Day 3 2nd_weekcris
Day 3 2nd_weekcrisDay 3 2nd_weekcris
Day 3 2nd_weekcris
 
How Nonprofit Communicators Combine Goals for 2013
How Nonprofit Communicators Combine Goals for 2013How Nonprofit Communicators Combine Goals for 2013
How Nonprofit Communicators Combine Goals for 2013
 
Comune Di Casier Per Pubblicazione Con Dati Di Confronto Superiori A 10000 Ab
Comune Di Casier Per Pubblicazione Con Dati Di Confronto Superiori A 10000 AbComune Di Casier Per Pubblicazione Con Dati Di Confronto Superiori A 10000 Ab
Comune Di Casier Per Pubblicazione Con Dati Di Confronto Superiori A 10000 Ab
 
Difficulties identified in a design e-learning program.
Difficulties identified in a design e-learning program.Difficulties identified in a design e-learning program.
Difficulties identified in a design e-learning program.
 
Flipflops
FlipflopsFlipflops
Flipflops
 
Socioeconomic Impact Assessment
Socioeconomic Impact AssessmentSocioeconomic Impact Assessment
Socioeconomic Impact Assessment
 
Introduction And Graphs
Introduction And GraphsIntroduction And Graphs
Introduction And Graphs
 

Similaire à Simulating Production with Clocker

Similaire à Simulating Production with Clocker (20)

Clocker - How to Train your Docker Cloud
Clocker - How to Train your Docker CloudClocker - How to Train your Docker Cloud
Clocker - How to Train your Docker Cloud
 
Using Clocker with Project Calico - Running Production Workloads in the Cloud
Using Clocker with Project Calico - Running Production Workloads in the CloudUsing Clocker with Project Calico - Running Production Workloads in the Cloud
Using Clocker with Project Calico - Running Production Workloads in the Cloud
 
Clocker - The Docker Cloud Maker
Clocker - The Docker Cloud MakerClocker - The Docker Cloud Maker
Clocker - The Docker Cloud Maker
 
Clocker: Managing Container Networking and Placement
Clocker: Managing Container Networking and PlacementClocker: Managing Container Networking and Placement
Clocker: Managing Container Networking and Placement
 
How to Train Your Docker Cloud
How to Train Your Docker CloudHow to Train Your Docker Cloud
How to Train Your Docker Cloud
 
Bringing Docker to the Cloud
Bringing Docker to the CloudBringing Docker to the Cloud
Bringing Docker to the Cloud
 
Docker Networking with Project Calico
Docker Networking with Project CalicoDocker Networking with Project Calico
Docker Networking with Project Calico
 
Clocker, Calico and Docker
Clocker, Calico and DockerClocker, Calico and Docker
Clocker, Calico and Docker
 
Running Docker in Production
Running Docker in ProductionRunning Docker in Production
Running Docker in Production
 
Clocker Now and Next
Clocker Now and NextClocker Now and Next
Clocker Now and Next
 
Clocker: Docker in the Cloud
Clocker: Docker in the CloudClocker: Docker in the Cloud
Clocker: Docker in the Cloud
 
Sebastien goasguen cloud stack and docker
Sebastien goasguen   cloud stack and dockerSebastien goasguen   cloud stack and docker
Sebastien goasguen cloud stack and docker
 
Deploying Complex Applications on Docker using Apache Brooklyn
Deploying Complex Applications on Docker using Apache BrooklynDeploying Complex Applications on Docker using Apache Brooklyn
Deploying Complex Applications on Docker using Apache Brooklyn
 
RICON 2014 Running Riak in a Docker Cloud using Apache Brooklyn
RICON 2014 Running Riak in a Docker Cloud using Apache BrooklynRICON 2014 Running Riak in a Docker Cloud using Apache Brooklyn
RICON 2014 Running Riak in a Docker Cloud using Apache Brooklyn
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Clocker 1.0.0 Preview
Clocker 1.0.0 PreviewClocker 1.0.0 Preview
Clocker 1.0.0 Preview
 
DockerCon EU 2015 Barcelona
DockerCon EU 2015 BarcelonaDockerCon EU 2015 Barcelona
DockerCon EU 2015 Barcelona
 
Containers docker-docker hub-azureacr-azure aci
Containers docker-docker hub-azureacr-azure aciContainers docker-docker hub-azureacr-azure aci
Containers docker-docker hub-azureacr-azure aci
 
Docker and CloudStack
Docker and CloudStackDocker and CloudStack
Docker and CloudStack
 
Docker Platform and Ecosystem Nov 2015
Docker Platform and Ecosystem Nov 2015Docker Platform and Ecosystem Nov 2015
Docker Platform and Ecosystem Nov 2015
 

Plus de Andrew Kennedy

Plus de Andrew Kennedy (12)

Hyperledger Lightning Talk
Hyperledger Lightning TalkHyperledger Lightning Talk
Hyperledger Lightning Talk
 
Orchestraing the Blockchain Using Containers
Orchestraing the Blockchain Using ContainersOrchestraing the Blockchain Using Containers
Orchestraing the Blockchain Using Containers
 
Multi-Container Applications Spanning Docker, Mesos and OpenStack
Multi-Container Applications Spanning Docker, Mesos and OpenStackMulti-Container Applications Spanning Docker, Mesos and OpenStack
Multi-Container Applications Spanning Docker, Mesos and OpenStack
 
Containers: Beyond the Basics
Containers: Beyond the BasicsContainers: Beyond the Basics
Containers: Beyond the Basics
 
Introducing the Open Container Project
Introducing the Open Container ProjectIntroducing the Open Container Project
Introducing the Open Container Project
 
Metaswitch Project Calico
Metaswitch Project CalicoMetaswitch Project Calico
Metaswitch Project Calico
 
Docker Networking with Clocker and Weave
Docker Networking with Clocker and WeaveDocker Networking with Clocker and Weave
Docker Networking with Clocker and Weave
 
Deploying Complex Applications on Docker using Apache Brooklyn
Deploying Complex Applications on Docker using Apache BrooklynDeploying Complex Applications on Docker using Apache Brooklyn
Deploying Complex Applications on Docker using Apache Brooklyn
 
Clocker Evolution
Clocker EvolutionClocker Evolution
Clocker Evolution
 
Clocker and OpenStack
Clocker and OpenStackClocker and OpenStack
Clocker and OpenStack
 
Introducing Clocker
Introducing ClockerIntroducing Clocker
Introducing Clocker
 
Global Scale ESB with Mule
Global Scale ESB with MuleGlobal Scale ESB with Mule
Global Scale ESB with Mule
 

Simulating Production with Clocker

  • 1. Using  Apache  Brooklyn  and   Docker  to  Simulate  your   Production  Environments  in   the  Cloud Andrew  Kennedy grkvlt@apache.org
  • 2. ApacheCon  Austin,  TX;  April  2015 Andrew  Kennedy  @grkvlt Simulating  Production Using  Apache  Brooklyn  and  Clocker  to  Simulate   Production  Environments  in  the  Cloud
  • 3. @grkvlt Introduction • Andrew  Kennedy – Clocker  Project  Founder  and  Lead  Engineer – Open  Source  and  Distributed  Systems – Apache  Committer  for  Brooklyn  and  Qpid – github.com/grkvlt • Cloudsoft  Corporation – Open  Source  Application  Management  Specialists
  • 4. @grkvlt Agenda 1. Clocker  Introduction 2. What  is  a  Docker  Cloud? 3. Demonstration 4. Clocker  Applications 5. Simulating  Production? 6. Questions
  • 6.
  • 7. @grkvlt What  does  it  do? 1. Spins  up  and  Manages  Docker   Clouds 2. Serves  up  Containers  on  Demand 3. Manages  Composite  Application   Deployments  on  Docker
  • 8. @grkvlt What  does  it  provide? • Multi  Host  and  Multi  Container  Applications • Seamless  Networking – Communication  Between  Services • Orchestration  and  Clustering – Control  of  Containers – Container  Management
  • 9. @grkvlt Who  is  using  it? • Testing  and  Proof  of  Concept  Stage – Financial  Services – Insurance • Production – Multi-­‐tenant  Application  Trial – Container  per  service – Ideally  suited  to  the  Clocker  model
  • 10. @grkvlt Where  can  I  find  it? • Open  Source  on  GitHub • Apache  2.0  Licensed • http://clocker.io • Status • 0.8.0  Developer  Preview  available  now • 0.8.0  Release  at  Docker  Meetup  this  week!
  • 11. What  is  a  Docker  Cloud?
  • 12. @grkvlt Docker  Cloud 1. On-­‐demand 2. Multi-­‐Tenant 3. Hardware  Independent 4. Application  Driven
  • 13. @grkvlt Clocker  and  Brooklyn • What  is  it? – Brooklyn  Application  and  Location – Uses  jclouds  for  Docker  access • What  does  it  provide? – First  Class  Docker  Support  in  Brooklyn – Optimized  Brooklyn  Blueprints  for  Docker
  • 14. @grkvlt Apache  Brooklyn • Application  Management  Platform • Deploy,  Manage  and  Monitor  Blueprints • Provisioning,  Installation  and  Customization • Management – AutoScaling,  Resilience,  Performance,  Security
  • 15. @grkvlt Apache  jclouds • Java  Cloud  Library • API  Agnostic • Create  Virtual  Machines • Docker  Driver  by  @turlinux • Virtual  Container
  • 16. @grkvlt Docker • Popular • Containers – Isolation – Performance – Composable – Complex – The  Future...
  • 17. @grkvlt Software-­‐defined  Networking • Pluggable  providers • Weave • Project  Calico • New  in  0.8.0 • DOVE • Write  your  own!
  • 18. @grkvlt Clocker  Orchestration Docker   Engine Virtual   Machine ContainerClocker Network   Segment SDN Cloud
  • 20.
  • 21. @grkvlt Features • Orchestrated  Docker  1.5.0  deployment  with  SDN   integration • Automated  attachment  of  containers  to  multiple   dynamic  networks • Brooklyn  application  blueprints  with  network   topology • Docker  images  as  Brooklyn  entity  source
  • 23. @grkvlt Clocker  Features • Application  Deployment – Oasis  CAMP  YAML  Blueprint – TOSCA  in  Development – Docker  Compose – Core  Brooklyn • Mixed  Destinations – Some  Virtual  Machines – Some  Bare  Metal – Some  Containers
  • 24. @grkvlt Clocker  Features • Docker  Extensions  to  Brooklyn – Dockerfile  or  Image  Specification  for  Installation – Placement  Strategies  for  Containers – Create  Docker  Images  and  Networks • Manages  Docker  Engine – Deployment  and  Management – Installation  and  Configuration – Software-­‐Defined  Networking
  • 25. @grkvlt Brooklyn  Blueprints • Describe  Applications • OASIS  CAMP  Standard • List  of  Services • Tree  Structure • Sensors,  Effectors  and  Policies
  • 26. @grkvlt Blueprint  Example name:  appserver-­‐w-­‐policy services: -­‐ type:  brooklyn.entity.webapp.ControlledDynamicWebAppCluster initialSize:  1 memberSpec: $brooklyn:entitySpec: type:  brooklyn.entity.webapp.jboss.JBoss7Server brooklyn.config: wars.root: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-­‐example-­‐hello-­‐world-­‐sql-­‐webapp/0.6.0/brooklyn-­‐example-­‐hello-­‐world-­‐sql-­‐webapp-­‐ 0.6.0.war http.port:  8080+ java.sysprops:   brooklyn.example.db.url:  $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s", component("db").attributeWhenReady("datastore.url"),  "visitors",  "brooklyn",  "br00k11n") brooklyn.policies: -­‐ policyType:  brooklyn.policy.autoscaling.AutoScalerPolicy brooklyn.config: metric:  $brooklyn:sensor("brooklyn.entity.webapp.DynamicWebAppCluster",  "webapp.reqs.perSec.windowed.perNode") metricLowerBound:  10 metricUpperBound:  100 minPoolSize:  1 maxPoolSize:  5 -­‐ type:  brooklyn.entity.database.mysql.MySqlNode id:  db name:  DB  HelloWorld  Visitors brooklyn.config: datastore.creation.script.url: https://github.com/apache/incubator-­‐brooklyn/raw/master/usage/launcher/src/test/resources/visitors-­‐creation-­‐script.sql
  • 27. @grkvlt Application  Components • Services • Catalog  Entries • Defined  by  Brooklyn  Code • Policies • Sensors • Enrichers
  • 28. @grkvlt Services • Brooklyn  Entities • Installed  by  running  SSH  commands • Add  packages  or  extract  archive  files • Run  arbitrary  commands • Clocker  commits  image  after  installation
  • 29. @grkvlt Container  Definition • Sources – Brooklyn  Entity  Definition – Chef  Recipe – Docker  Image  Definition – Dockerfile • Create  Image  Automatically – Commit  or  Push  for  Reuse
  • 30. @grkvlt Container  Definition id:  docker-­‐haproxy name:  "Docker  Hub  HAProxy  Load  Balancer" origin:  "https://registry.hub.docker.com/_/haproxy/" locations: -­‐ my-­‐docker-­‐cloud services: -­‐ type:  brooklyn.entity.proxy.haproxy.HAProxyController id:  haproxy brooklyn.config: docker.image.name:  haproxy docker.image.tag:  1.5.9 install.dir:  /usr/local/sbin/ run.dir:  /usr/local/etc/haproxy/ network.list: -­‐ dmz
  • 31. @grkvlt Container  Definition id:  dockerfile-­‐mysql name:  "Docker  Hub  MySQL  Database" 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: "https://s3-­‐eu-­‐west-­‐1.amazonaws.com/brooklyn-­‐clocker/mysql-­‐5.6.tgz" docker.container.environment: MYSQL_ROOT_PASSWORD:  "s3cr3t"
  • 32. @grkvlt Container  Definition id:  dockerfile-­‐mysql name:  "Docker  Hub  LAMP  Stack" locations: -­‐ my-­‐docker-­‐cloud services: -­‐ type:  docker:mysql:5.7.5 id:  mysql env: MYSQL_ROOT_PASSWORD:  "s3cr3t" -­‐ type:  docker:grkvlt/myapp:latest id:  application env: MYSQL_HOST: $brooklyn:component("mysql").attributeWhenReady("host.hostname")
  • 33. @grkvlt Container  Placement • Where  do  we  want  the  service  to  run? • Supply  and  Demand – Here's  the  locations  you  can  use... – I  want  a  very  specific  location... • Docker  Swarm – Possible  future  integration  point...
  • 34. @grkvlt Container  Placement • Demand – Adding  an  Application – Scaling  existing  Application • Requirements – Host  Location – Service  Resources – CPU,  Memory
  • 35. @grkvlt Container  Placement • Supply – Choose  a  Host  from  available – Create  new  Host  if  required • Start  Container  there – Set  CPU  and  Memory – Attach  to  Network
  • 36. @grkvlt Container  Placement • Placement  Strategies – Random,  Depth  or  Breadth  First – CPU  or  Memory  Usage – Memory,  CPU  or  Container  Limits – Geographic  Constraints • User  Defined – Java  Predicate
  • 37. @grkvlt Placement  Strategy • Deterministic • Simple – Predicate  and  Comparator docker.container.strategies: -­‐ $brooklyn:object: type:  "brooklyn.location.docker.strategy.MaxContainersPlacementStrategy” brooklyn.config: maxContainers:  16 -­‐ $brooklyn:object: type:  "brooklyn.location.docker.strategy.CpuUsagePlacementStrategy” brooklyn.config: maxCpu:  0.75
  • 38. @grkvlt Autonomics • Brooklyn  Policies • Attached  to  Entities  in  Application – Nothing  Docker  Specific • Elastic  Scaling – Cluster  Resizing – Sensor  Driven
  • 39. @grkvlt Application  Resilience • Service  Resilience  and  Replacement –Restart  Service  and  Container –Application  Level,  Not  Infrastructure –Same  as  Cloud • Snapshot  Running  Container  for  Restart
  • 40. @grkvlt Headroom • Ensure  resources  available • Based  on  MaxContainers  strategy  limit – Or  Percentage  Utilization – Or  CPU  and  RAM  allocation • Scale  Docker  Host  Cluster  Automatically   – Add  new  Docker  hosts – Remove  empty  Docker  hosts
  • 41. @grkvlt Software-­‐Defined  Networking • Needed  for  Seamless  Provisioning • Host  to  Host  Communication – Same  LAN  Segment – No  Port  Forwarding – Natural  Application  Configuration • Initial  Driver  was  EPMD  Applications
  • 42. @grkvlt Networking  Providers • Implementation  Agnostic – L2  over  L3  etc. – Similar  to  Hypervisor  in  Clouds • Generic  Interfaces – Host  Component – Service  Component  (or  Endpoint)
  • 44. @grkvlt Networking  Capabilities • Provide  Multiple  Networks – Single  Application  or  Shared – Private  Addresses – Segmented  by  CIDR • Docker  Port  Forwarding  Access – Debug  Mechanism
  • 46. @grkvlt Application  Development  Cycle 1. Development 2. Continuous  Integration 3. UAT  or  Testing 4. Staging 5. Production
  • 47. @grkvlt Dev  Cycle  Reality • My  Laptop • Jenkins  Server • Bob's  Laptop • Some  spare  VMs  we  found... • The  best  we  can  afford – until  next  year's  budget...?
  • 48. @grkvlt Application  Development • Same  Application • Different  Infrastructures – Very  Different • So  ends  up... – Different  Application
  • 49. @grkvlt Application  Development • Which  means – We  aren't  testing  the  right  things – Production  is  probably  broken  under  load  or  scale – Ops  are  unhappy  ;(
  • 50. @grkvlt Different  Application • Very  Different! – No  resilient  pairs – No  failover – No  load  balancer – No  Clustering – Single  network,  namespace,  domain,  etc.
  • 51. @grkvlt How  can  we  fix  this? • Perfect  worlds • All  environments  identical • Staging  is an  exact copy  of  production – Ready  for  App  and  Infra  cut-­‐over • UAT  is Staging,  with  anonymized  data • And  so  on,  rolling  through  environments
  • 52. @grkvlt How  can  we  fix  this? • CI  becomes  CD – Dedicated  production-­‐level  environment  for  builds – Successful  builds  promoted  to  UAT • Test  and  Dev...? – You  have  to  make  some  sacrifices  ;) – But  will  try  and  test  the  HA  mechanism  and  so  on  in   isolation – But  alt  least  Ops  are  happy
  • 53. @grkvlt How  can  we  fix  this? • Imperfect  world • Or,  the  DevOps way – We  don't  have  enough  money  for  six  copies  of  our  architecture – Particularly  at  scale  or  with  large  data  sets – So  we  fake  it! • The  important thing  is  our  architecture – It  defines  the  application  completely – We  describe  this  once in  a  blueprint – And  then  deploy  to  our  various  environments
  • 54. @grkvlt Clocker  and  DevOps • Application  blueprint • Describes – Services • Configuration – Policies – Networks – Hierarchy • Connections • Can  be  deployed  to  any  Brooklyn  Location
  • 55. @grkvlt Clocker  and  DevOps • Locations  include – Vagrant  or  other  VMs  on  my  laptop – Apache  jclouds  supported  providers • On  premise  OpenStack  CI  cloud • Public  SoftLayer  environment • ...  choose  your  favourite – Docker  Clouds  using  Clocker • Containers  instead  of  VMs • Automatically • No  input  from  developer  required
  • 56. @grkvlt There's  More  Than  One  Way... • Could  use  Clocker  and  Docker  everywhere – Generate  Docker  image  during  build  process – Size  underlying  VMs  appropriately – Allocate  different  CPU/memory  to  containers – Deploy  images  to  Clocker  everywhere • Many  enterprises  not  yet  ready  for  this...