Skip to content

Cloud Foundry

Prequisites

To start with Cloudboostr Cloud Foundry the main requirement is the cf-cli (and your favourite text editor of course). CLI is preinstalled on jumpbox, but can be installed on virtually any machine:

https://github.com/cloudfoundry/cli#downloads

Configuration

The kubernetes cluster is configured using ~/cf/config.json file. As described in previous paragraph, the configuration is already in place on jumpbox, but the platform can be also manually configured.

Automatic configuration

  1. Go to the Concourse and log in to the environment space.
  2. Open deploy_cf pipeline and then configure_jumpbox_cf job.
  3. Expand step configure_jumpbox.
  4. There are a few steps in the log:

Example:

cf api https://api.cf.env1.aws1.test.cloudboostr.com --skip-ssl-validation
(...)
cf auth admin [<REDACTED>]

Example:

> cf api https://api.cf.env1.aws1.test.cloudboostr.com --skip-ssl-validation
Setting api endpoint to https://api.cf.env1.aws1.adko.dev.cloudboostr.com...
OK

api endpoint:   https://api.cf.env1.test.dev.cloudboostr.com
api version:    2.134.0
Not logged in. Use 'cf login' to log in.

> cf auth admin [<REDACTED>]
API endpoint: https://api.cf.env1.aws1.test.cloudboostr.com
Authenticating...
OK
Use 'cf target' to view or set your target org and space.

Copy and paste this lines into the terminal, it will automatically connect to the platform and authorize the admin user.

Create space and org

For the start it is required to create an Organisation (org) and a Space for your apps.

cf create-org default-org
cf create-space default-space -o default-org

Example:

Creating org default-org as admin...
OK

Assigning role OrgManager to user admin in org default-org...
OK

TIP: Use 'cf target -o "default-org"' to target new org
Creating space default-space in org default-org as admin...
OK
Assigning role SpaceManager to user admin in org default-org / space default-space as admin...
OK
Assigning role SpaceDeveloper to user admin in org default-org / space default-space as admin...
OK

Then target that space:

cf target -o default-org -s default-space

Example:

cf target -o default-org -s default-space
api endpoint:   https://api.cf.env1.aws1.adko.dev.cloudboostr.com
api version:    2.134.0
user:           admin
org:            default-org
space:          default-space

You can pick any name you want.

Download code sample

Download example application:

https://github.com/cloudfoundry-samples/spring-music

Push

Go to the application directory and push to CF:

cf push

Verify the application is running:

cf apps

Application will be available at the address visible using command cf routes

External documentation

More information about the developement process on Cloud Foundry is available in the official documentation.

https://docs.cloudfoundry.org/devguide/index.html