Blah, Cloud.

Adventures in architectures

  • Twitter
  • GitHub
  • Home
  • Blog
  • Kubernetes on vSphere
  • Multi-tenant IaaS Networking
  • Me
    • About
    • CV
    • Contact
Home » Blog » Infrastructure » Deploying and Installing your first Juju Charm on Vagrant

Deploying and Installing your first Juju Charm on Vagrant

14/12/2014 by Myles Gray Leave a Comment

I’ve been playing with cloud platforms quite a lot recently, and in particular Juju‘s way of operations caught my particular attention.

Juju Interface

It has a very impressive feature set and makes deploying and linking “canned” apps very simple, whether you are using public, private or hybrid cloud instances.

I wanted to set Juju up with minimal fuss to give it a quick spin, obviously deploying OpenStack etc is a little more involved for a simple POC than I would have liked and using AWS/Azure/HP Cloud/MAAS was just way overkill.

Luckily, there is a very nice dev environment manager for OSX and Windows by the name of Vagrant, it can run on VirtualBox (the “normal” installation method) or VMware Workstation/Fusion if you pay a $79 license, as it’s a POC i’m cool with using VirtualBox.

Vagrant lets you spin up *nix “boxes” with services etc preconfigured with simple commands like:

vagrant up hashicorp/precise32

The above will spin you up a Ubuntu 12.04 LTS “Precise” x86 instance, pretty cool.

So, to get the ball rolling, for this deployment we have 2x pieces of software to install:

  • Vagrant
  • VirtualBox

Run through the installer for each on your respective OS (very straight forward so I won’t document).

I like to create a new directory for Vagrant under my Documents folder:

$ cd Documents/
$ mkdir Vagrant
$ cd Vagrant/ 

To gain access to the machines created by Juju later (in a separate subnet accessible by the Juju VM) we should install sshuttle which is a VPN over SSH program, i’m on OSX so I use the package manager brew.sh to install it:

brew install sshuttle

On Windows you need to install the node.js binary for Windows then run:

npm install sshuttle

Ubuntu has a pre-built dev/test environment for Juju as a cloud image:

vagrant box add JujuBox http://cloud-images.ubuntu.com/vagrant/trusty/trusty-server-cloudimg-amd64-juju-vagrant-disk1.box

This will download and install an Ubuntu cloud image as a vagrant instance with juju pre-installed. Now we need to init this instance:

vagrant init JujuBox
vagrant up

Vagrant Init

Once it is spun up you can access the Juju GUI via: http://127.0.0.1:6080/, deploy charms etc – Just to test I deployed the “WordPress” charm:

Wordpress Juju Charm

The box created will use an address in the 10.0.3.0/24 range as this is the range LXC uses to assign DHCP addresses. So I will use sshuttle to create a VPN over SSH to this network (password for machine is vagrant):

sshuttle -r [email protected]:2222 10.0.3.0/24

Now I can browse to my newly created WordPress instance through its ip specified by Juju:

Juju WordPress Deployed

Done!

Why not follow @mylesagray on Twitter for more like this!

Show some love:

  • Reddit
  • Twitter
  • Pocket
  • LinkedIn
  • Email
  • Telegram

Similar things I've written

Filed Under: Infrastructure, Virtualisation Tagged With: cloud, juju, ubuntu, vagrant

About Myles Gray

Hi! I'm Myles, and I'm a Dev Advocate at VMware. Focused primarily on content generation, product enablement and feedback from customers and field to engineering.

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Myles Gray

Hi! I'm Myles, and I'm a Dev Advocate at VMware. Focused primarily on content generation, product enablement and feedback from customers and field to engineering. Read More…

Categories

Tags

active directory authentication CBT cisco datastore dell design esxi fortigate iscsi jumbo frame kubernetes lab linux load-balancing lun md3000i mtu networking NginX nic nsx openSUSE osx pxe readynas san sdelete serial teaming ubuntu vcenter vcloud director vcsa vexpert video VIRL vmdk vmfs vmware vsan vsphere vsphere 6 vsphere beta windows

Subscribe to Blog via Email

Copyright © 2021 · News Pro Theme on Genesis Framework · WordPress · Log in

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.