Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.
/ blite Public archive

A bosh-lite helper script for use with Bosh2 and VirtualBox, includes pause/resume and backup/restore functionality.

License

Notifications You must be signed in to change notification settings

Zipcar/blite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 

Repository files navigation

Blite

Blite is a CLI tool meant to make it easier to use Bosh locally with Bosh2 and VirtualBox, typically called bosh-lite. It's goal is to fill in the gaps left from moving off the bosh-lite Vagrant workflow and make it relatively painless for developers to get a functional Bosh director locally using VirtualBox that works with Bosh2.

It is still a work in progress.

Dependencies

Quick Start

  1. Clone this repo or download the raw blite file.
  2. Add blite to your PATH (optional)
  3. Run blite help or just blite to see available commands and their usage.
  4. Run blite create to get the director started
  5. Run eval (blite env-eval) to configure your shell to talk to the newly created bosh director.
  6. Run blite route-add to make sure you have a route to communicate with the director and the things it deploys.
  7. Optionally, take a base backup blite snapshot base so in future you can avoid the time suck of recreation and instead restore the base snapshot.
  8. Optionally, set a bare bones cloud-config for bosh lite: blite cloud-config

Avoiding Network Issues

The default blite settings will create a director at 192.168.50.6 in the 192.168.50.0/24 subnet with a gateway at 192.168.50.1. This director will deploy containers into the 10.244.0.0/16 subnet using the gateway address 10.244.0.1. This matches the current default values used in the bosh-lite documentation. If you're running blite in a network environment that conflicts with these IP spaces you'll override the environment variables specified in the create method before running create. You may also consider setting these permanently in .bashrc.

It is also possible to manage multiple local Bosh directors with blite by controlling these environment variables.

create

Creates a new local Bosh director. Pass in BLITE_DIRECTOR_CIDR, BLITE_DIRECTOR_IP, BLITE_GATEWAY_IP to set a custom network configuration. Blite creates a unique identifier for your bosh director by hashing together your hostname, and the values of BLITE_DIRECTOR_CIDR, BLITE_DIRECTOR_IP, BLITE_GATEWAY_IP. You can also pass in a BLITE_OPS_FILE_GLOB that will append all the files that it matches as operator files at compilation time. If you need variables passed in, you can specify the BLITE_VARS_FILE_GLOB environment variable that will append all the files that it matches as vars files during compilation.

config

Outputs environment and routing configuration info you might need to set in order to connect to the director and the things it deploys. Note that these are not the same as the environment variables that control the network space used in create.

env-eval

This command is a helper for sourcing the environment variables bosh2 needs to work. It is meant to be run wrapped in an eval like this:

eval $(blite env-eval)

route-add

A helper command that will attempt to detect your OS and update your routing table so it's possible to connect to the things your director deploys. This function working properly for you is heavily dependent on the cloud config you pass to the director. Make sure the BLITE_BOSH_DEPLOYMENTS_CIDR environment variable is set to the actual CIDR of your director's internal network where things are being deployed.

route-rm

A helper command that will attempt to detect your OS and cleanup your routing table removing the route that would allow you to connect to the things your director deploys. This function working properly for you is heavily dependent on the cloud config you pass to the director. Make sure the BLITE_BOSH_DEPLOYMENTS_CIDR environment variable is set to the actual CIDR of your director's internal network where things are being deployed.

networking

An informational method that outputs the current network settings for your bosh director and the containers it's managing.

interpolate

Runs bosh interpolate on the director's compiled manifest. Requires a valid path be passed that will be set to the --path flag of bosh interpolate: blite interpolate /name will return the name of the director.

cloud-config

A helper command that uses the networking information set in the environment (see blite networking) to write a barebones cloud config file that mimics what's available in the bosh-deployment repo. Of course you can just use normal bosh to upload any cloud config you want; this method is just meant to make it a little easier for folks to get up and running with something quickly.

pause

Uses VBoxManage to pause the director.

resume

Uses VBoxManage to resume the director. Resume will detect if the director was paused or fully powered off and respond correctly.

snapshot

Snapshots the state of a running Bosh director. Can be passed a snapshot name, if none is provided a timestamp will be used. For example: blite snapshot base will create a snapshot called "base"

snapshots

Lists the available snapshots for the Bosh director.

restore

Restores the specified snapshot. Must be passed a snapshot name. For example: blite restore base will restore the snapshot called "base"

destroy

Deletes the bosh director and purges any cached state and credential data for that specific director. Note that in the current implementation destroying the director will also destroy all snapshots. It's recommended to take a base snapshot right after initial creation to save time, then instead of destroying, just restore to the clean director state.

update

Fetches the latest version of the base manifest and operations files necessary for bosh-lite from GitHub per the current bosh documentation.

purge

Deletes all cached information about directors, manifests, operations files, state, credentials, configuration, etc. This is a very destructive operation and probably should not be used unless a totally clean and new environment is desired.

About

A bosh-lite helper script for use with Bosh2 and VirtualBox, includes pause/resume and backup/restore functionality.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages