The Cloud Controller is written in Ruby and provides REST API endpoints for clients to access the system. The Cloud Controller maintains a database with tables for orgs, spaces, apps, services, service instances, user roles, and more.
The Cloud Controller database has been tested with Postgres.
The Cloud Controller manages a blob store for:
resources - files that are uploaded to the Cloud Controller with a unique SHA such that they can be reused without re-uploading the file
app packages - unstaged files that represent an application
droplets - the result of taking an app package and staging it (processesing a buildpack) and getting it ready to run
The blob store uses the Fog Ruby gem such that it can use abstractions like Amazon S3 or an NFS-mounted file system for storage.
The Cloud Controller interacts with other core components of the Cloud Foundry platform using the NATS message bus. For example, it performs the following using NATS:
- Instructs a DEA to stage an application (processes a buildpack for the app) to prepare it to run
- Instructs a DEA to start or stop an application
- Receives information from the Health Manager about applications
- Subscribes to Service Gateways that advertise available services
- Instructs Service Gateways to handle provisioning, unprovision, bind and unbind operations for services
rspec will run test suite with sqlite3 in-memory database; however, you can specify connection string via
DB_CONNECTION environment variable to test against postgres and mysql. Examples:
DB_CONNECTION="postgres://postgres@localhost:5432/ccng" rspec DB_CONNECTION="mysql2://root:password@localhost:3306/ccng" rspec
Travis currently runs 3 build jobs against SQLite, Postgres, and MySQL.
Cloud Controller uses Steno to manage its logs. Each log entry includes a “source” field to designate which module in the code the entry originates from. Some of the possible sources are
The Cloud Controller uses a YAML configuration file. For an example, see
config/cloud_controller.yml. Some of the keys that are read from this configuration file are:
logging- a steno configuration hash
bulk_api- basic auth credentials for the application state bulk API. In Cloud Foundry, this endpoint is used by the health manager to retrieve the expected state of every user application.
uaa- URL and credentials for connecting to the UAA, Cloud Foundry's OAuth 2.0 server.