Cloud foundry is an open source, platform as a service governed by the Cloud Foundry Foundation.It allows anyone to deploy application and make it available to the world in few minutes. Let’s focus on the architecture of PCF to understand how it works and as usual, in the simplest possible way.
PCF elastic run time has four major components i.e. Diego, Loggregator, Cloud Controller Api and Routing. It follows single responsibility principle and each component performs a particular task.
Let’s focus on each components.
The basic component of Diego is “Cell”. Within each cell there will be multiple “container” . Application instances are run within the container.
The containers are managed by a component called “Garden”, it’s an interface and PCF uses “Garden Linux” i.e. Linux specific implementation of the interface.
Two more important components of Diego are Bulletin Board System (BBS) and “etcd” database. BBS provides api to access the Diego database.
Within the “cell” there is another component called “Rep” , it represents the cell in BBS/Auctions.
The “Executor” component of “Rep” manages the container allocations on the cell and also streams stdout and stderr to “metron”.
The “Metron” forwards the log to the “Loggregator”.
Brain is another component in Diego. It has two components Auctioneer and Converger. Brain is responsible to select appropriate cell for the staging of an application.
Loggregator receives the log from “metron” using the “Doppler” component and passes it to App syslog drains like Splunk, Papertail etc. It also also has a component “Traffic Controller” which exposes a web socket endpoint called “firehose”. Traffic Controller is responsible to display the log in console for “cf logs <app name>” command.
Apart from that “Loggregator” has another component called “Nozzle” which transfer log data in whatever format it needed to be.
- Cloud Controller API
The “cloud controller” is exposes api to manage the Elastic run time. Whenever application is pushed into the PCF, the cloud controller stores the “application packages” into a component called “Blob Store” and is also persists the “Application Data” , “Space” and “Organization” etc at a DB component called “CC_DB”.
Cloud Controller also use “CC_Bridge” to translate application specific messages to generic language tasks and LRPs.
Route is responsible to transfer traffic to the appropriate components. e.g. “cf push” it will direct to the cloud controller and for an URL it will direct to the appropriate cell which holds the specific application instance.
All these components participated to stage and run of an application in PCF. A simplified stage and run flow :
And a simplified view of Elastic run time is :
These are the basic components of PCF , for staging an application and their responsibilities. A simplified “push” sequence is:
How PCF ensures high availability, we shall discuss the PCF architecture for high availability in the next post.