Installing Open Source Cloud Foundry on your Laptop or Desktop using BOSH Lite

I tried this method to install Cloud Foundry on my my Desktop which is having 32 GB RAM and a 8 core AMD processor.

I have installed Ubuntu 16 Desktop as the OS

The first step is install BOSH CLI v2

download the BOSH CLI  with the following command i.e using wget.

wget https://s3.amazonaws.com/bosh-cli-artifacts/bosh-cli-2.0.48-linux-amd64

Change the permission

chmod +x bosh-cli-2.0.48-linux-amd64

Move the file to /usr/local/bin

mv bosh-cli-2.0.48-linux-amd64 /usr/local/bin/bosh

Install OS specific dependency
$ sudo apt-get update
$ sudo apt-get install -y build-essential zlibc zlib1g-dev ruby ruby-

Now lets Install Bosh-Lite Director

$git clone https://github.com/cloudfoundry/bosh-deployment dev openssl libxslt-dev libxml2-dev libssl-dev libreadline6 libreadline6-dev libyaml-dev libsqlite3-dev sqlite3 -y

Make sure Ruby is installed

$ruby -v

Make a directory named deployments$mkdir -p ~/deployments/vbox

$cd bosh-deployment

Create a BOSH environment

$bosh create-env ~/bosh-deployment/bosh.yml –state ~/deployments/vbox/state.json
-o ~/bosh-deployment/virtualbox/cpi.yml -o ~/bosh-deployment/virtualbox/outbound-network.yml -o ~/bosh-deployment/bosh-lite.yml \
-o ~/bosh-deployment/bosh-lite-runc.yml -o ~/bosh-deployment/jumpbox-user.yml \
–vars-store ~/deployments/vbox/creds.yml \
-v director_name=”Bosh Lite Director” -v internal_ip=192.168.50.6 -v internal_gw=192.168.50.1 \
-v internal_cidr=192.168.50.0/24 -v outbound_network_name=NatNetwork

$bosh -e 192.168.50.6 –ca-cert <(bosh int ~/deployments/vbox/creds.yml –path /director_ssl/ca) alias-env vbox

$export BOSH_CA_CERT=$(bosh int ~/deployments/vbox/creds.yml –path /director_ssl/ca)
$export BOSH_CLIENT=admin
$export BOSH_CLIENT_SECRET=$(bosh int ~/deployments/vbox/creds.yml –path /admin_password)
$export BOSH_ENVIRONMENT=vbox

Add a route to the virtualbox VM

sudo route add -net 10.244.0.0/16 gw 192.168.50.6

SSH to the Director as jumpbox User

$bosh int ~/deployments/vbox/creds.yml –path /jumpbox_ssh/private_key > ~/.ssh/bosh-virtualbox.key
$chmod 600 ~/.ssh/bosh-virtualbox.key
$ssh -i ~/.ssh/bosh-virtualbox.key jumpbox@192.168.50.6

$git clone https://github.com/cloudfoundry/cf-deployment
$cd cf-deployment

$export STEMCELL_VERSION=$(bosh int ~/workspace/cf-deployment/cf-deployment.yml –path /stemcells/alias=default/version)
$bosh upload-stemcell https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-trusty-go_agent?v=$STEMCELL_VERSION

$bosh update-cloud-config ~/cf-deployment/iaas-support/bosh-lite/cloud-config.yml

$bosh -e vbox -d cf deploy cf-deployment.yml -o operations/bosh-lite.yml –vars-store deployment-vars.yml -v system_domain=bosh-lite.com

or
if you want to use pre-compiled releases.

$bosh -e vbox -d cf deploy cf-deployment.yml -o operations/bosh-lite.yml -o operations/use-compiled-releases.yml –vars-store deployment-vars.yml -v system_domain=bosh-lite.com

Login to Cloud Foundry

download cloud foundry cli

curl -L “https://packages.cloudfoundry.org/stable?release=linux64-binary&source=github&#8221; | tar -zx

sudo mv cf /usr/local/bin

$cf login -a https://api.bosh-lite.com –skip-ssl-validation -u admin -p $(bosh interpolate ~/cf-deployment/deployment-vars.yml –path /cf_admin_password)

cf login -a https://api.bosh-lite.com –skip-ssl-validation -u admin -p admin

Create an Organisation and a space

cf create-org pnayak-org
cf target -o pnayak-org
cf create-space development
cf target -o pnayak-org -s development

Deploy your new first application

git clone https://github.com/vchrisb/cf-helloworld ~/workspace/cf-helloworld
cd ~/workspace/cf-helloworld
cf push

Docker support

cf enable-feature-flag diego_docker
cf push test-app -o cloudfoundry/test-app

Save the environment

vboxmanage controlvm $(bosh int ~/bosh-deployment/state.json –path /current_vm_cid) savestate
vboxmanage startvm $(bosh int ~/bosh-deployment/state.json –path /current_vm_cid) –type headless

Delete the environment

bosh delete-env ~/bosh-deployment/bosh.yml –state ~/bosh-deployment/state.json \
-o ~/bosh-deployment/virtualbox/cpi.yml -o ~/bosh-deployment/virtualbox/outbound-network.yml -o ~/bosh-deployment/bosh-lite.yml \
-o ~/bosh-deployment/bosh-lite-runc.yml -o ~/bosh-deployment/jumpbox-user.yml \
–vars-store ~/deployments/vbox/creds.yml \
-v director_name=”Bosh Lite Director” -v internal_ip=192.168.50.6 -v internal_gw=192.168.50.1 -v internal_cidr=192.168.50.0/24 \
-v outbound_network_name=NatNetwork

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s