Pivotal Cloud Foundry

So I wanted to learn about Pivotal Cloud Foundry (PCF) and it turns out there is a free intro available:

https://pivotal.io/platform/pcf-tutorials/getting-started-with-pivotal-cloud-foundry/introduction

What is PCF? I don’t really know. But I think PCF is what folks call a “Platform-as-a-Service” cloud offering. You can Google all the different cloud options (SaaS, PaaS, IaaS, etc) but essentially PCF provides a platform to deploy Applications you write in a lot of different languages (Java, .NET, Node.js, etc). And you get to focus on writing the application and PCF owns how your application runs. PCF can also connect your app to services like databases and monitoring tools automatically. And that entire stack of your app and everything that supports it can be managed using PCF tools like an admin console through your web browser or a command-line interface (CLI) on your local machine. You can start and stop apps, scale them, add and remove services, etc. And PCF isn’t really a specific cloud provider…its a framework you can take and put almost wherever you want, like Amazon Cloud, somewhere in your enterprise or even your local PC.

So I ran through the intro linked above and have a few small notes:

  1. You have to setup a Pivotal Web Services (PWS) account first – but you need to do more than get a login name. You’ll have to validate your email and then you need to actually log into PWS and setup a default Org (like a way to group your apps). Once you do that, download CLI and do the git stuff and then “cf push” will work. “cf push” didn’t work for me until I setup that PWS Org.
  2. I had to download git for Windows and I used the Git GUI to clone the repository on the “Deploy the Sample App” page. I just created a local folder (C:\pivotal) and told Git GUI to clone the PWS Intro app into that folder.
  3. FYI – the app doesn’t really do that much…it essentially throws up some config type stuff using templates/index.html. You’re really just getting an overview of how to use PCF without any focus on the app in the demo/intro.
  4. I also had to run “cf push” a few times…apparently it tries to pick a random endpoint/URL (a “route”) for your application and I guess it kept picking random words that were already used by other users or apps. So I just kept hitting “cf push” and eventually it worked.
  5. Pretty much everything you’re doing in the CLI can be done in your PWS Admin Console. It was neat to type into the CLI and then switch over to the console and see all the changes taking place, like the new DB and the scaling changes.

So what’s next? I think I’ll work on a custom Java or Node.js app and get that deployed and see what happens. I’ll check on Eclipse and PCF/git connections as well.

(Update 1/17/19) I was able to also get PCFDev working. I had to update my VirtualBox client and run the install a couple of times but eventually I had PCF running in a virtual machine on my PC and was able to deploy the spring-music demo app, which was pretty cool.

Then I pushed spring-music to my free PCF cloud instance and I connected it to a ClearDB service (essentially MySQL). I was then able to download MySQL Workbench on my local machine and connect to my ClearDB instance – neat. I tried to connect spring-music to a Redis service in PCF but couldn’t get that working…will try that again later.