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

Getting Started with Juju

Getting Started with Juju

These are the slides for the intro to using juju talk. This covers basic deployment, inspection, and environment setup - which are considered first steps in the exploration process.

These core concepts are pre-requisites to doing any level of charming with Juju. - which is building the charms themselves to deploy your software into the orchestrated cloud.


Charles Butler

February 02, 2015


  1. Getting Started with Juju

  2. Charles Butler @lazypower

  3. Juju's Goal

  4. Encapsulate ops knowledge in any cloud environment: public or private

  5. To provide a dynamic infrastructure With interchangeable services

  6. So you can focus on being an expert in using

    the service, not on deployment and life cycle management.
  7. Whats the Model?

  8. Juju's Model • Server / Client • Written in GO

    • TLS Encrypted Hypermedia Socketed API • Event Driven
  9. Charms are Building Blocks

  10. Charms • Configuration Management • Service Relationships • Expose proper

    usage patterns through relations • Service Lifecycle Management
  11. Bundles • Contain one or many charms • (Re-)distributable •

    Simple YAML files • Orchestration out of the box
  12. Interactive Tutorial

  13. Installation (Ubuntu) https://jujucharms.com/get-started add-apt-repository ppa:juju/stable apt-get update apt-get install juju

    juju-local juju-quickstart
  14. Installation (OSX) For client only: • brew install juju juju-quickstart

    For development (the next session): adopt the vagrant workflow: • https://juju.ubuntu.com/docs/config-vagrant.html
  15. Installation (Windows) For the core client: • Visit: https://juju.ubuntu.com/install/ •

    Sadly, no juju-quickstart Better Yet – Fetch the Vagrant Image!
  16. Vagrant Box Installation

  17. Quick Steps vagrant box import jujubox.box --name jujubox vagrant init

    jujubox vagrant up
  18. Final Notes on Installation https://jujucharms.com/get-started • All Major Platforms have

    the client for use in production. • Development efforts are in Vagrant / Containers. • More info at http://juju.ubuntu.com/install
  19. Generate Configuration juju generate-config Config lives in: ~/.juju/environments.yaml

  20. Environments.yaml local: type: local admin-secret: foobar default-series: trusty amazon: type:

    ec2 region: eu-central-1 access-key: 'XXX' secret-key: 'XXX' control-bucket: cfgmgmtcamp-juju-## admin-secret: foobar default-series: trusty
  21. Set your environment Juju switch amazon - or - Juju

    switch local $ juju switch local amazon -> local
  22. Bootstrap juju bootstrap

  23. Whats this doing? (Cloud) • Communicates with cloud provider API

    • Provisions a machine, and pre-loads it with JUJU stateserver components • Provides an API endpoint for enlistment • Warehouses SSH keys / Users (coming in 1.22)
  24. Whats this doing? (Local) • Fires up a few components

    on your desktop – MongoDB – StateServer API – Components/logs are found in ~/.juju/local/
  25. Lets deploy something! juju quickstart bundle:mediawiki/7/single juju set mysql dataset-size='20%'

    The mysql config option is a fix for local provider in vagrant. We don't have much ram, and this will cause mysql to fail to come up during deployment. good for prod, not for this use case.
  26. What's this doing? (Cloud) • Communicating with cloud provider API

    • Provision a machine • Enlist in Juju StateServer • Shipping charm code to the unit • Runs hooks according to events
  27. What's this doing? (Local) • Provisioning a new LXC Container

    – If the templates don't exist, it fetches the template(s). – This only happens once, for each series you deploy • Enlist container in Juju StateServer • Shipping charm code to the unit • Runs hooks according to events
  28. See it in the CLI juju status If you need

    up to the minute information: watch juju status
  29. See it visually juju deploy juju-gui juju deploy juju-gui --to

    0 juju expose juju-gui The --to co-locates the gui on the state server to keep machines at a minimum
  30. Configure Services juju set mediawiki name='Configuration Management Camp 2015' You

    can do this in the GUI by clicking:
  31. Reset and Deploy Manually

  32. Destroy Services juju destroy-service mediawiki juju destroy-service mysql juju destroy-machine

    1 juju destroy-machine 2 Why destroy-service AND destroy-machine? Juju leaves machines behind in the event You need to do data recovery!
  33. Deploy Manually juju deploy cs:trusty/mediawiki juju deploy cs:trusty/mysql juju set

    mysql dataset-size='20%'
  34. Extend with a reverse proxy Juju deploy cs:trusty/haproxy Juju add-relation

    haproxy mediawiki
  35. Congratulations! You're now a Juju Padewon!

  36. Charles Butler @lazypower Questions? http://jujucharms.com irc.freenode.net #juju juju@lists.ubuntu.com