Cloud Foundry – Everything You Want To Know !!

So now you want to use the latest cloud deployment application platform to deploy your app in the cloud. Whatever be the reasons, you are in the right place . Here we will explore a detailed guide required to implement the Cloud Foundry solutions for cloud application deployment. 

This post gives you a basic understanding of Cloud Foundry, its architecture, and an overview of the platform’s components . It also covers the basic debugging practices and the instructions on how to deploy and scale the applications . 

Without wasting further time, lets start concentrating on our main topic. Just sit back and relax, carry on with your reading . 

Cloud Foundry - Everything You Want To Know !!

What Is Cloud Foundry ? (Definition Of Cloud Foundry !!)

Cloud Foundry is an open source Platform as a Service (PaaS) on which the developers can build, deploy, run, and scale their applications on both private and public clouds. It provides developer frameworks, application services and a choice of clouds. Primarily Cloud Foundry is written in Java, Ruby, and Go.

Cloud Foundry - Everything You Want To Know !!

Note : The term PaaS in Cloud computing basically enables the user a capability to deploy and host any applications intended for the end-users . It mainly provides the base for the next services provided by cloud i.e. SaaS (Software as a Service) .

So Cloud Foundry mainly helps in reducing the infrastructure management responsibilities. You as an application owner will only be responsible for the application and data management.

Cloud Foundry can use infrastructure provided by various cloud service providers like AWS ,VMWare , Open-stack etc  . It supports multi cloud third party infrastructure services, and further beneficial in furnishing scalability for your application . 

Need and Features Of Cloud Foundry !!

Following are some of the top features of Cloud Foundry for any app deployment in the cloud (you may also term these points are the reason why we really need Cloud Foundry) :  

1. It is completely Language independent and capable of deploying applications on any computing infrastructure

2. It has a wide growing range of services and follows DevOps principles like continuous integration, deployment, and faster availability.

3. Provides REST API to simplify applications operations like deployment, scale up, and scale down. Also provides integration with cloud providers

4. It offers Portability, Auto-scaling, Centralized administration, Dynamic routing, Health monitoring systems

Do You Know ?

Baidu , the largest Chinese internet site, has one billion page views per day and runs on Cloud Foundry.

Different Products In Cloud Foundry !!

Now it time time for us to explore various products in Cloud Foundry : 

Cloud Foundry Pivotal Web Services (PWS) Pivotal Web Services – E Pivotal Cloud Foundry (PCF)
Open source Offered by Pivotal on top of Cloud Foundry Enterprise PWS The commercial product offered by Cloud Foundry
Set up and run on PaaS Public CF PaaS An instance of PCF hosted by Pivotal Run private PaaS in-house or create public PaaS
No paid support Hosted on top of AWS Sophisticated Web console
No tools Support offered Additional tools and offer support

What Is Pivotal Cloud Foundry ?

Pivotal Cloud Foundry is the unified, multi-cloud platform to run enterprise apps. Customer values are delivered quickly and consistently everywhere with this. Provides security to the systems and data by continuously updating the platforms and patch within hours . 

It can reliably run all your apps at cloud scale , it can reduce cost by refreshing your legacy stack .

Cloud Foundry - Everything You Want To Know !!

What Is the Cloud Foundry Architecture ?

Cloud Foundry provides an open architecture with a choice of clouds, application services, and developer frameworks . Let us have a look at the various Cloud Foundry components now :

Cloud Foundry - Everything You Want To Know !!

1. Routing And Authentication 

Router mainly directs the incoming traffic into the Cloud Foundry to the suitable component depending on whether it is a hosted application running on a Diego Cell or a Cloud Controller component . OAuth2 server (UAA) and Login Server work together to provide identity management.

2. App Lifecycle 

The following points explain the process of Cloud Foundry App Lifecycle.

An application deployments are directed by Cloud controller. You target Cloud controller to push an app to Cloud Foundry.

nsync is responsible for writing the number of instances into a DesiredLRP structure in the Diego BBS database.

BBS monitors the DesiredLRP and ActualLRP values and ensures that their count match.

The containers are monitored by Cell Reps and provides the ActualLRP value.

3. App Storage and Execution

Blobstore – Repository for the large binary files that contain application code packages, Buildpacks, and Droplets. It can be configured either as an internal server or an external server.

Diego Cell – Performs start and stop actions of an application locally in application virtual machine (VM), reports the app status and manages the VM’s containers.

Garden – Makes the container technology available for the Diego project.

4. Services, Metrics, and Logging

Services

Service Broker – Provides the service instance to an application that is provisioned and attached with a service by a developer.

Metrics

Metrics Collector – Gathers statistics and metrics from the components that are used to monitor a Cloud Foundry deployment by the Operators.

Logs

App Log Aggregator – Streams application logs to developers.

5. Messaging 

Bulletin Board System (BBS) – Stores more frequently updated and disposable data like the status of an application, heartbeat messages, and unallocated work.

Consul – Stores longer lived control data like component IP addresses and distributed locks.

NATS – Broadcast the latest routing tables to the routers.

Now its time to understand some of the basic terms that we normally use in Cloud Foundry architecture most often . 

1. Application 

Applications are defined as a unit of deployment in Cloud Foundry.

Cloud Foundry allows developers to focus only on an application (not on services or run time) by providing PaaS to deploy an application. Applications are not limited to a specific language or a run time environment.

2. Buildpacks : Permits Cloud Foundry to support various languages and deployment environments

3. Manifests 

Manifests are the deployment blueprint for an application. Includes the application details like application name, memory usage, instances, host, and domain . 

4. Organizations

Organizations are the first administrative unit in Cloud Foundry. It contains Spaces and Users. The default domain (PCF: cfapps.io) is provided for all organizations. Defines quotas and security.

5. Spaces

Space is the location where the application is deployed .

An organization can have multiple spaces. Default space for PWS is development . Applications and services are scoped to space. Provides a set of users access to a shared location.

6. Users and Roles

Users are the members of an organization. You can invite users to share your cloud.

Roles control access to the spaces and domains, and also control those who have permission to manage routes, deploy applications and add/bind/remove services.

Note: You need not be a Cloud Foundry user to access the deployed applications because each application sets up its user management.

7. Quotas : Restrict the usage and the availability of resources to the organization, space, and web application. 

8. Domains : A URL to which the deployed applications are associated . 

9. Router : Links domain to the actual application. 

10. Services : Addons that can be provided alongside your applications . 

Cloud Foundry Environment Set Up !!

You need to know three URLs to access Cloud Foundry.

API Endpoint : 

  • Identify Cloud Foundry instance
  • Used to deploy applications, manage spaces, routes, etc.
  • The cf utility makes RESTful requests to this URL.

Apps Manager : 

  • An application management dashboard
  • Product of Pivotal Cloud Foundry

Apps Domain : 

  • Used to access the deployed applications.
  • It can be same as the system domain.

Pivotal Web Services In Cloud Foundry !!

Pivotal Web Services is the largest Pivotal Cloud Foundry foundation in Operations.

  • PWS is a fully managed version of Cloud Foundry that runs on a Public Cloud.
  • Hosted on AWS.
  • Makes it simple for the developers who want to know the working of Cloud Foundry.
  • Provides a free trial subscription with 2GB of memory quota and $87 of Trial credit

How To Get Start With Cloud Foundry As A Beginner !!

As a novice beginner , just follow the steps as given below to set up your Cloud Foundry Account :

You need to create (Pivotal Web Service) PWS account to get started working on it.

  • Access https://run.pivotal.io/.
  • Sign up by providing details like First name, Last name, email address, and password.
  • Once you sign up, you receive a verification link to the email.
  • Click on Verify your email address link.
  • Finally, log on to the account with the right credentials.

Cloud Foundry - Everything You Want To Know !!

What is a Service In Cloud Foundry ?

Service is a dependency of an external application or a component like Database , Security , Monitoring App, Message Queue , Generic Service , Hadoop instance, Other dependent applications etc .

A service basically provides connection information to an application via environment variables. These are bound to an application using a service broker

Types of Services in Cloud Foundry  !!

Managed Services or Market Services

  • Available out-of-the-box
  • Selected from marketplace catalog
  • Instances provisioned by PaaS for use by an application

User-Defined Services

  • Services running external to Cloud Foundry
  • PaaS does not provide resources instead supply connection information

Custom built services

  • Created and installed into Cloud foundry
  • An alternative to user-defined services

Services allow different activities within a Cloud Foundry App: Connect to a relational database, Connect to a Messaging system, Connect to an email system, Utilize NoSQL databases , read and write of files etc

Cloud Foundry - Everything You Want To Know !!

Pivotal Web service is a Public Cloud Foundry Instance , hosted on AWS, Provides extensive marketplace of services via App Direct

Examples

MySQL, MongoDB, Redis, Rabbit MQ, and Blazemeter monitoring.

The Backend Process that is going on at the time of deployment of your App in Cloud Foundry !!

cf connects to Cloud Foundry using your credentials. Pushes an application to Cloud Foundry and tells it to deploy it. Takes some time to deploy an application. Cloud Foundry stages your application.Droplet is deployed to a container and starts running. All requests to the deployed route URL route to your application. 

The logging in Pivotal Cloud foundry is termed as Log Aggregation architecture.

What Is Log Aggregation Architecture In Cloud Foundry ? 

Log Aggregation architecture collects output from application instances and CF components.Aggregates into consolidated logs .

Execution agent VM forces DEA (droplet execution agent) to send an information to logging server(Formally called Loggregator is now called Doppler is the current version) which in turn sends an information to Loggregator traffic controller.

Cells send an information to Metron agent. Metron agent then consolidates the information through Syslog drain to a Logging server . Doppler pass it on to the third party Loggregator . The final output is seen through cf CLI or Apps manager.

Logging Sources In Cloud Foundry !! 

Logs collected from all the application instances (from both sysout and sysserr) are passed on to the Cloud Foundry components that contain the logging information like Router, Cloud Controller, and Execution agents.

This logging information is used to understand and update the issues that are happening and will be happening in future.

Troubleshooting an application in Cloud Foundry can be hard because you cannot troubleshoot issues on the Cloud. The issues in this can be of three main types :

  • Deployment issue
  • Push issues
  • Runtime issues

The only option that you have to come up with these issues is to look at the log files and be familiar with the tools at your disposal.

Cloud Foundry - Everything You Want To Know !!

Commands that can be handy while you do troubleshooting in Cloud Foundry :

  • cf apps – Lists all application within a space
  • cf app <app_name> – Lists all instances of an application within a space
  • cf events <app-name> – Lists event log related to your application
  • cf logs <app-name> –recent – Obtain the most recent subset of logs
  • cf log <app name> – Check how the log works
  • cf files <app_name> <path_to_directory_to_view> – View the log files.

Use Of Cloud Foundry – Final Thoughts !!

Just go ahead and at least give this PaaS service a try to deploy your app in the cloud . Trust us, it immensely enhances the overall efficiency and productivity of your team . As the infrastructure overhead will get lessen up due to this and your team can utilize the resources elsewhere .

This is a standalone software package and a platform where you get centralized management , easy integrations & maintenance, apt environment platform to run any app seamlessly etc 

Hope you really liked this post . Stay tuned for more interesting stuff in this series .  

Spread the Wisdom !!

Techie Aric

Aric is a tech enthusiast , who love to write about the tech related products and 'How To' blogs . IT Engineer by profession , right now working in the Automation field in a Software product company . The other hobbies includes singing , trekking and writing blogs .

Leave a Reply

Your email address will not be published. Required fields are marked *