December 20, 2018

Learning BOSH: Getting Started

I have been interested in CloudFoundry (and later in BOSH) since VMware’s very first announcement back in 2011 and during the years have been following a lot of related resources, like for example Stark and Wayne’s blog.

Finally found some time and decided to switch away from this read only mode and actually get my hands dirty and try to do some stuff with BOSH. I will try to keep track of my learning and findings in series of posts.

What is BOSH?

Here is the definition from the source:

BOSH is a project that unifies release engineering, deployment, and lifecycle management of small and large-scale cloud software. BOSH can provision and deploy software over hundreds of VMs. It also performs monitoring, failure recovery, and software updates with zero-to-minimal downtime.

Another very useful resource is Dr. Nic’s Ultimate Guide to BOSH where BOSH is described as

… an open source tool for release engineering, deployment, lifecycle management, and monitoring of distributed systems.

Pivotal have posted a good (and maybe a bit biased) comparison between BOSH, Ansible, and Chef. Fun fact - same as Kubernetes, BOSH was inspired by Google’s Borg.

Up and Running

First things first - we need to setup BOSH. There are two components you will need - the bosh CLI installed locally and the BOSH director installed and ready to accept API calls. There are many ways to do this, for playing with BOSH on my laptop I use BUCC (created by the superheroes from Stark & Wayne to quickly bring up BOSH Lite VM.

Clone the repo, cd into the directory and run

$ bin/bucc up

This may take a while, especially on the first run (full output of the command you can see here). Once it is done you will need bunch of environment variables set. BUCC recommends either using direnv, but for some reason I does not work for me (issue is described here) so I use the following workaround:

$ bin/bucc env > bucc.env
$ source bucc.env

Once it is all done you should be able to interact with the Director.

$ bosh environment
Using environment '192.168.50.6' as user 'admin' (openid, bosh.admin)

Name      bucc  
UUID      7da62e5a-ca5e-4530-8042-69883b28a822  
Version   268.2.0 (00000000)  
CPI       warden_cpi  
Features  compiled_package_cache: disabled  
          config_server: enabled  
          local_dns: enabled  
          power_dns: disabled  
          snapshots: disabled  
User      admin  

Succeeded

One thing I have found is that if you just leave BOSH Lite running and your machine goes to sleep it may get in a weird stuck state. This is why when I am done I clean up everything with:

$ bucc down

This means that everything you have done will be gone and next time you have to start from the beginning.

Next - describing our deployment in a manifest file in order to deploy Nginx. Find more about it here.

Powered by Hugo & Kiss.