Wednesday, December 30, 2015

Setting up a local Cloud Foundry instance

My platform for all of this is Linux Mint 17.2 (rafaela).

It has been 2 or 3 years since I played around with Cloud Foundry.

The first thing I noticed is they have really raised the bar in terms of the effort required to bring up a local instance.  There used to be a thing called Micro Cloud Foundry where you just downloaded a VMware VM and you were good to go.

Today, that is gone... instead there is a whole build process to go through.  On the one hand, it is good that these tools and sources are available, but I can't help feeling like this is a fairly big hurdle for the casual developer who is trying to evaluate CF.

I mostly followed the BOSH-lite README starting here.

When you get to Deploy Cloud Foundry, there are two choices.  The first choice leads to Deploying Cloud Foundry using BOSH which I found to be a trail of tears with lots of manual steps and big, slow downloads.  In the end I was not able to get this to work.

The second choice, checking out cf-release from github and running bin/provision_cf from your checked out bosh-lite directory, did work for me and seemed to go a lot faster (relatively speaking... still have a fast network and hours to spare).  Inside of this shell script you will find some of the same steps the first method does manually, but all neatly packaged and tested.

This got me to the point where I had CF running in my Vagrant VirtualBox and I could run 'bosh vms' and see all the VMs up and running.

My next challenge was to get access to my shiny new CF instance.  Deploying Cloud Foundry using Bosh said to try
curl api.subdomain.domain/info
but of course api.subdomain.domain is not the literal value, just an example.

I found several places indicating that the correct value here should be api.10.244.0.34.xip.io.  I read up on xip.io a little, verified that my computer was resolving this name, but still couldn't get this to work.


Googling on, I found a guy who was having this exact problem and the solution that worked for him.  So, using api.bosh-lite.com I was able to access my local CF instance:


Having done all of this I was able to complete the remainder of the setup just following the documented steps with cf api, cf login, cf create-org, cf create-space, cf target... See Running Cloud Foundry Locally with BOSH Lite for example.

So, cool, sort of... I spent about a day on this and feel like I have just reached the starting line...

I configured the Eclipse integration and worked through Deploying to Cloud Foundry from STS.  Everything works.  I saw the 'Hello world'.  Ready to try this with a real app.

Here's a nice short presentation I found afterwards that sheds a little more light on Bosh: Why Must I Use Cloud Foundry's Bosh? I just Learned Chef/Puppet!  For when you want to customize your CF instance, and apparently it can do more than just manage CF.

Update 2017: Since I wrote this, Pivotal has released PCF Dev, a downloadable CF VM not unlike the old Micro Cloud Foundry VM for the person just wanting to experiment and get up to speed with a local instance of Cloud Foundry.

Lattice is a tool to bring up a local CF instance.  Here's a pretty good presentation about Lattice and CF.  But note that Lattice is no longer actively maintained and appears to be deprecated now.  I gave this a quick try but didn't get it to work.

No comments:

Post a Comment