Upgrade to Pro — share decks privately, control downloads, hide ads and more …

BOSH: What, How, When

BOSH: What, How, When

BOSH attempts to do something that I haven’t seen in OSS yet. It wants to allow a devops team to describe the entire software stack – from the base operating system image used to boot new instances (stemcell), to the software packages installed on instances (packages), to the processes that are run on each instance (jobs). It wants to allow a devops team to describe the runtime deployment of your stack – which instance types are used, how many of them, how much disk is attached, and how networking properties such as IPs are configured.

In slides, I introduce what BOSH is, the core concepts, how to use it and when to use it.

The video of the talk is at http://drnicwilliams.com/2012/05/15/bosh-what-how-when/

Dr Nic Williams

May 16, 2012
Tweet

More Decks by Dr Nic Williams

Other Decks in Technology

Transcript

  1. ENGINE YARD | DR NIC WILLIAMS | BOSH • An

    app that runs apps • github: cloudfoundry/vcap • 40 different jobs • DIY installation (chef) open source
  2. ENGINE YARD | DR NIC WILLIAMS | BOSH • cloudfoundry.com

    • 40 different jobs • Lots of code, lots of deployments • 1000 CF.com deploys in 1.5 years hosted
  3. ENGINE YARD | DR NIC WILLIAMS | BOSH SOLUTION Cloud

    Foundry is not self-hosting BOSH hosts Cloud Foundry Cloud Foundry hosts your apps
  4. ENGINE YARD | DR NIC WILLIAMS | BOSH Your app

    managed by cloudfoundry App App App CF (40 jobs)
  5. ENGINE YARD | DR NIC WILLIAMS | BOSH BOSH deploys

    cloudfoundry App App App CF (40 jobs) BOSH
  6. ENGINE YARD | DR NIC WILLIAMS | BOSH BOSH provisions

    iaas App App App CF (40 jobs) BOSH vSphere, AWS
  7. ENGINE YARD | DR NIC WILLIAMS | BOSH BOSH deploys

    cloudfoundry App App App CF (40 jobs) BOSH vSphere, AWS https://github.com/cloudfoundry/cf-release
  8. ENGINE YARD | DR NIC WILLIAMS | BOSH BOSH deploys

    openshift App App App OpenShift BOSH vSphere, AWS
  9. ENGINE YARD | DR NIC WILLIAMS | BOSH MySQL BOSH

    deploys wordpress BOSH vSphere, AWS wp wp wp nginx https://github.com/cloudfoundry/bosh-sample-release
  10. ENGINE YARD | DR NIC WILLIAMS | BOSH BOSH deploys

    jenkins Slv Slv Slv Gerrit Jenkins BOSH vSphere, AWS https://github.com/cloudfoundry/oss-release
  11. ENGINE YARD | DR NIC WILLIAMS | BOSH BOSH (9

    jobs) BOSH deploys BOSH BOSH vSphere, AWS https://github.com/cloudfoundry/bosh-release
  12. ENGINE YARD | DR NIC WILLIAMS | BOSH Your jobs

    and data BOSH deploys your system BOSH vSphere, AWS
  13. ENGINE YARD | DR NIC WILLIAMS | BOSH “deploy” •

    Boot VMs • Boot & attach disks • Attach networking • Install packages • Run jobs
  14. ENGINE YARD | DR NIC WILLIAMS | BOSH Packages •

    Your code and package code equal citizens • Deployed together
  15. ENGINE YARD | DR NIC WILLIAMS | BOSH compiled packages

    • Source code pre-compiled • Instant installation on new instances
  16. ENGINE YARD | DR NIC WILLIAMS | BOSH orchestration •

    Add/remove instances • Change instance sizes/types • Upgrade packages • New instances; not dirty instances
  17. ENGINE YARD | DR NIC WILLIAMS | BOSH this box

    1.0 stemcell 1 vm 0 or 1 attached disk Assigned IP packages installed jobs running
  18. ENGINE YARD | DR NIC WILLIAMS | BOSH 2.0 2.0

    2.0 2.0 2.0 2.0 add more 2.0 2.0 2.0
  19. ENGINE YARD | DR NIC WILLIAMS | BOSH 2.0 2.0

    2.0 2.0 2.0 2.0 deploy again 2.0 2.0 2.0
  20. ENGINE YARD | DR NIC WILLIAMS | BOSH 3.0 deploy

    again 3.0 3.0 3.0 3.0 3.0 3.0 3.0 3.0
  21. ENGINE YARD | DR NIC WILLIAMS | BOSH 3.0 3.0

    3.0 3.0 3.0 3.0 3.0 3.0 3.0 canary
  22. ENGINE YARD | DR NIC WILLIAMS | BOSH 4.0 3.0

    3.0 3.0 3.0 3.0 3.0 3.0 3.0 canary
  23. ENGINE YARD | DR NIC WILLIAMS | BOSH 3.0 3.0

    3.0 3.0 3.0 3.0 3.0 3.0 3.0 canary
  24. ENGINE YARD | DR NIC WILLIAMS | BOSH GET A

    BOSH Tutorial for getting started https://github.com/drnic/bosh-getting-started/
  25. ENGINE YARD | DR NIC WILLIAMS | BOSH follow this...

    https://github.com/drnic/bosh-getting-started/
  26. ENGINE YARD | DR NIC WILLIAMS | BOSH 3 tiers

    • Stemcell • Release • Deployment manifest 1.0 1.0
  27. ENGINE YARD | DR NIC WILLIAMS | BOSH stemcells •

    The image for booting instances • AWS has AMIs • Each instance runs one job
  28. ENGINE YARD | DR NIC WILLIAMS | BOSH 1.0 releases

    • Packages to install from source • Jobs to run using monit • Job Templates rendered by deployment manifests
  29. ENGINE YARD | DR NIC WILLIAMS | BOSH package •

    External source, e.g. mysql • Internal code, e.g. your app • They are equal citizens of BOSH 1.0
  30. ENGINE YARD | DR NIC WILLIAMS | BOSH deployment manifest

    • Release version • Properties for job templates • Instance types/sizes, disk, regions (cloud properties) • Pools of instances • Network/IPs allocated
  31. ENGINE YARD | DR NIC WILLIAMS | BOSH redis •

    Stemcell • Package: redis • Job: redis ‣ uses redis package ‣ runs redis-server via monit • Deployment manifest
  32. ENGINE YARD | DR NIC WILLIAMS | BOSH release •

    Packages - source code • Jobs - processes to run
  33. ENGINE YARD | DR NIC WILLIAMS | BOSH deploy •

    Deployment manifest (yaml) • Specific release & stemcells • Brings to life: instances, disks, and processes!
  34. ENGINE YARD | DR NIC WILLIAMS | BOSH deploy it!

    • “bosh deploy” • ... well, there’s more commands than that... • Let’s go deeper!
  35. ENGINE YARD | DR NIC WILLIAMS | BOSH get a

    stemcell bosh  public  stemcells bosh  download  public  stemcell  <name> bosh  upload  stemcell  <name>
  36. ENGINE YARD | DR NIC WILLIAMS | BOSH the right

    stemcell $  bosh  public  stemcells +-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐+ |  Name                                                    |  Url  | +-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐+ |  micro-­‐bosh-­‐stemcell-­‐0.1.0.tgz  |  ...  | |  bosh-­‐stemcell-­‐aws-­‐0.5.1.tgz      |  ...  | |  bosh-­‐stemcell-­‐0.5.2.tgz              |  ...  | +-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐+ ami format
  37. ENGINE YARD | DR NIC WILLIAMS | BOSH sample wordpress

    system MySQL BOSH AWS wp wp wp nginx
  38. ENGINE YARD | DR NIC WILLIAMS | BOSH sample wordpress

    release MySQL wp wp wp nginx jobs
  39. ENGINE YARD | DR NIC WILLIAMS | BOSH sample wordpress

    deployment MySQL wp wp wp nginx jobs deployed instances
  40. ENGINE YARD | DR NIC WILLIAMS | BOSH create bosh

    release git  clone  https://github.com/cloudfoundry/ bosh-­‐sample-­‐release.git cd  bosh-­‐sample-­‐release bosh  create  release bosh  upload  release bosh  status Jobs +-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+ |  Name            |  Dev            |  Final        | +-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+ |  mysql          |            0.1  |            n/a  | |  nginx          |            0.1  |            n/a  | |  wordpress  |            0.1  |            n/a  | +-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐+
  41. ENGINE YARD | DR NIC WILLIAMS | BOSH versioned releases

    $  cat  dev_releases/wordpress-­‐1.yml -­‐-­‐-­‐   packages:   -­‐  name:  apache2    version:  0.1-­‐dev    sha1:  0659d0ca2d038feae43119ea46b704...    dependencies:  [] -­‐  name:  mysql    version:  0.1-­‐dev ...
  42. ENGINE YARD | DR NIC WILLIAMS | BOSH specific packages

    $  cat  dev_releases/wordpress-­‐1.yml -­‐-­‐-­‐   packages:   -­‐  name:  apache2    version:  0.1-­‐dev    sha1:  0659d0ca2d038feae43119ea46b704...    dependencies:  [] -­‐  name:  mysql    version:  0.1-­‐dev ...
  43. ENGINE YARD | DR NIC WILLIAMS | BOSH specific jobs

    $  cat  dev_releases/wordpress-­‐1.yml ... jobs:   -­‐  name:  mysql    version:  0.1-­‐dev    sha1:  08faee9e9ba544e7d664846b0eb4c758d -­‐  name:  nginx    version:  0.1-­‐dev    sha1:  3ccc2f956a4253721b0707ed357f3f2a8 -­‐  name:  wordpress    version:  0.1-­‐dev    sha1:  e5a671095ad6ed539700591b3bdd3e098 ...
  44. ENGINE YARD | DR NIC WILLIAMS | BOSH deploy manifest

    -­‐-­‐-­‐ name:  wordpress director_uuid:  576cd86b-­‐cdda-­‐4b93-­‐8f72-­‐a43 release:    name:  wordpress    version:  1 ... specific release
  45. ENGINE YARD | DR NIC WILLIAMS | BOSH job properties

    properties:    nginx:        workers:  1    wordpress:        admin:  [email protected]        port:  8008        servers:            -­‐  23.21.64.192        servername:  myblog.com        db:            name:  wp            user:  wordpress            pass:  w0rdpr3ss    mysql:        address:  23.21.64.193        port:  3306        password:  rootpass template data
  46. ENGINE YARD | DR NIC WILLIAMS | BOSH package changed

    $  cat  dev_releases/wordpress-­‐2.yml -­‐-­‐-­‐   packages:   -­‐  name:  nginx    version:  0.2-­‐dev    sha1:  32452345ca2d038feae43119ea46b704...    dependencies:  [] -­‐  name:  mysql    version:  0.1-­‐dev ...
  47. ENGINE YARD | DR NIC WILLIAMS | BOSH change manifest

    -­‐-­‐-­‐ name:  wordpress director_uuid:  576cd86b-­‐cdda-­‐4b93-­‐8f72-­‐a43 release:    name:  wordpress    version:  2 ... specific release
  48. ENGINE YARD | DR NIC WILLIAMS | BOSH handcrafted releases

    • Find source tgz • Write installers • Write monit scripts • Write config files
  49. ENGINE YARD | DR NIC WILLIAMS | BOSH basics gem

     install  bosh-­‐gen bosh-­‐gen  new  simple-­‐redis cd  simple-­‐redis bosh-­‐gen  package  redis bosh-­‐gen  job  redis  -­‐d  redis
  50. ENGINE YARD | DR NIC WILLIAMS | BOSH alternately •

    Opscode-like collection of packages and jobs
  51. ENGINE YARD | DR NIC WILLIAMS | BOSH complete control

    • Describe everything explicitly • Orchestration between deployments
  52. ENGINE YARD | DR NIC WILLIAMS | BOSH multicloud •

    Cloud Provider Interface (CPI) • vSphere • AWS • OpenStack (via PistonCloud) • 12 methods to implement
  53. ENGINE YARD | DR NIC WILLIAMS | BOSH downsides •

    Prepared to throw VMs at it • Cannot use OS packaging • Currently for Ubuntu • No RAID (0 or 1 disk)