BUCC: I’ll be there for you, BBL

image: NBC, Warner Bros

We wanted to let you know that two of your friends bbl and bucc are now best friends with each other! You can now use bbl to spin up a bucc fully automated on your target cloud environment.

Setup

The first thing we need is the latest bbl cli.

For this example, we are going to use gcp. Open your favorite terminal and create a workspace folder: ~/workspace/besties

You’ll need to set up a service account in gcp. This uses the gcloud sdk to provision and configure the service account.

gcloud iam service-accounts create <service-account-name>
gcloud iam service-accounts keys create --iam-account='<service account name>@<project-id>.iam.gserviceaccount.com' <service account name>.key.json
gcloud projects add-iam-policy-binding <project id> --member='serviceAccount:<service-account-name>@<project-id>.iam.gserviceaccount.com' --role='roles/editor'

Make sure you replace <service-account-name> and <project-id> with your values.

Configure BBL

Then you need to export the following bbl environment variables to in order to start the process.

export BBL_IAAS=gcp
export BBL_ENV_NAME=banana-env
mkdir $BBL_ENV_NAME && cd $BBL_ENV_NAME && git init

Run bbl plan to see where we are at. This will let us know if we need anything else before we can run bbl up to bootstrap the environment.

bbl plan -lb-type concourse`

You will notice that this command is pretty intuitive, as it will ask you what you need to supply next.

In our case with gcp you need:

  • --gcp-service-account-key
  • --gcp-region europe-west4

The service account key is a *.key.json file you created before using the gcloud commands. Putting all the parameters together you come up with this:

bbl plan --lb-type concourse  --gcp-service-account-key ~/<service-account-name>.key.json --gcp-region europe-west4

The region europe-west4 is an example, your region may vary.

A Dash of BUCC

Now, it’s time for some bucc magic:

git submodule add https://github.com/starkandwayne/bucc.git bucc
ln -s bucc/bbl/*-director-override.sh .
ln -sr bucc/bbl/terraform/$BBL_IAAS/* terraform/

And the next simple step, just like bucc up, is to run:

bbl up

Once it’s done, it will have created the following:

  • jumpbox
  • bosh-director (with all the bucc goodies)
  • load-balancer (so we can use concourse/uaa publicly)

What was all that bucc magic?

We copied down the bucc software, and then overlaid a bbl template that is compatible with bucc. Find out more about how bbl works with advanced configuration in their docs.

Friends with Benefits

Now, run the following commands so that all the goodies you get with bbl and bucc are loaded into your command shell.

eval "$(bbl print-env)"
eval "$(bucc/bin/bucc env)"

Run bucc info, you will see the URL of the loadbalancer here that directs to Concourse.

Run bucc fly so your target is set and able to login in with the fly CLI to Concourse.

Run bosh cloud-config, you will notice that cloud-config is already pre-populated with the environment we just set up.

Spread the word

twitter icon facebook icon linkedin icon