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.
- Clone this repo or download the raw blite file.
- Add blite to your PATH (optional)
- Run
blite help
or justblite
to see available commands and their usage. - Run
blite create
to get the director started - Run
eval (blite env-eval)
to configure your shell to talk to the newly created bosh director. - Run
blite route-add
to make sure you have a route to communicate with the director and the things it deploys. - 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. - Optionally, set a bare bones cloud-config for bosh lite:
blite cloud-config
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.
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.
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
.
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)
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.
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.
An informational method that outputs the current network settings for your bosh director and the containers it's managing.
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.
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.
Uses VBoxManage to pause the director.
Uses VBoxManage to resume the director. Resume will detect if the director was paused or fully powered off and respond correctly.
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"
Lists the available snapshots for the Bosh director.
Restores the specified snapshot. Must be passed a snapshot name.
For example: blite restore base
will restore the snapshot called "base"
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.
Fetches the latest version of the base manifest and operations files necessary for bosh-lite from GitHub per the current bosh documentation.
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.