momius - Fotolia


BOSH tutorial: Understand the basics of open source BOSH

Unfamiliar with BOSH? You're not alone. Take a look at this basic BOSH tutorial to learn more about the open source tool that plays an important role in Pivotal Container Service.

Developed by Cloud Foundry, BOSH is an open source tool for release engineering, deployment, lifecycle management...

and distributed system monitoring. Built with web scale in mind -- in which reproducibility and predictability are essential -- BOSH provides a way to consistently deploy complex web applications in a controlled manner. BOSH accomplishes this by wrapping up the various files and configuration details that make up a specific release and builds them together with the base image to make a release.

Let's take a look at this introductory BOSH tutorial to understand the basics of what BOSH entails and how it works.

BOSH fundamentals

BOSH refers to base images as stem cells. Stem cells are premade, bare-bones base images of popular Linux distributions, such as CentOS, Ubuntu and so on, that are ready for the developer or administrator to configure however he desires. These images are called stem cells in the BOSH nomenclature because, when they're created, it's unclear what they'll become; a stem cell could easily become a web server, a SQL server or an application server.

A blob store -- a container for binary packages -- and a repository sit next to the stem cells. These items, when pulled together at build time, consistently provide the same results, which makes it easy to manage the release version and migrate as needed. The administrator can define which version he wants to deploy and be confident that everything is exactly as it should be.

BOSH depends on a number of items to work, including a director VM, agents that accept updates and changes from the director VM, health monitoring infrastructure and version-control infrastructure. Another key component in the BOSH setup is the Cloud Provider Interface (CPI). As its name implies, CPI interfaces between BOSH tools and the remote cloud provider API, so you can spin up an estate in the cloud with next to nothing locally. Cloud Foundry stores these configurations separately in a Git repository with versioning.

These items, which make up the full application stack, are added on top of the stem cell and fused into an offering that you can deploy at will, irrespective of the underlying platform and its dependencies. This provides a consistent, reproducible build with strong, built-in version control. This dependability is one of the primary reasons why VMware, in collaboration with Pivotal and Google, chose to use BOSH for multi-cloud infrastructure automation in Pivotal Container Service.

A basic BOSH tutorial

There are several components you need to create in BOSH before you can create any VMs. But before you begin, a small warning: If you install BOSH from a vendor repository, you might be working with an outdated version. I recommend sticking to the manual setup described below. This is a very simplistic BOSH tutorial, but it demonstrates how these components fit together.

First, on the client side, you need to install BOSH tools to deploy a BOSH configuration. Depending on your platform, you can download them from the official BOSH site. Make sure the downloads are in your path for an easier management experience. Enter the following command to test the system, bearing in mind that you might need to rename the file you download:

bosh-cli –v

Next, you need to set up the director VM to manage the environment. Each BOSH director server manages a defined workspace that was set up alongside it. Think of these workspaces as different environments, with specific tasks and requirements. It's typical to have several workspaces in a single BOSH deployment. Take care not to confuse these workspaces for Docker images -- they aren't the same thing, though they can coexist.

You create these workspaces with a YAML base file. YAML files are declarative files that describe the network, storage, VM size and other infrastructure configuration items, and pass this information along to BOSH to implement. There are several items within a YAML file to configure, including networks, password, data stores and other critical information. Be cautious when modifying YAML files, as they're very sensitive to errant spaces.

Finally, you must create an environment for the director VM to manage. Assuming all goes according to plan, you should have a usable environment configured and can now start standing up infrastructure with YAML files as defined by the administrator.

Dig Deeper on VMware basics