Professional Documents
Culture Documents
Pivotal
IBM
HP
SAP
VMware
Rackspace
No paid
Hosted on top of AWS Sophisticated Web console
support
support
App Lifecycle
The following points explain the process of Cloud Foundry App Lifecycle.
Metrics
Logs
Messaging
Application
Applications are defined as a unit of deployment in Cloud Foundry.
Manifests
Organizations
Organizations are the first administrative unit in Cloud Foundry.
Spaces
Space is the location where the application is deployed.
Note: You need not be a Cloud Foundry user to access the deployed
applications because each application sets up its user management.
Domain
Routes
Services
Apps Manager
Apps Domain
Common CF URLs
The following are some of the most commonly used URLs while accessing
Cloud Foundry.
For PWS
Access https://run.pivotal.io/.
Sign up by providing the 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.
Under tools option, you will be able to see the cf login procedure along with the
endpoint as shown in the above image.
What is a Service?
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.
Types of Services
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
Uses of Service
Services allow the following 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 files
Save and Retrieve sessions
Access anything that is not coded in an application
Hosted on AWS
Provides extensive marketplace of services via App Direct
Examples
MySQL, MongoDB, Redis, Rabbit MQ, and Blazemeter monitoring.
App-Direct
App-Direct is a commercial provider of services.
The above image shows Marketplace services in PWS offered via App-Direct.
cf marketplace
cf service <sevice_instance_name>
Overview
In this section, you will be learning how to
Note: Before deploying an application, ensure that the Cloud Foundry CLI
version is 6 or more. Remove if any earlier Ruby version is present.*
cf --version
cf push command
cf push command is used to deploy an application to Cloud Foundry.
The founder of Cloud foundry gave the definition for cf push command as
Options
i - Number of instances
m - Memory limit
n - Host name
p - Local path to app directory
Logging Terminology
CF 1.3 or earlier
CF 1.4 or later
Logging Sources
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.
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.
Commands
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.
CF_TRACE
CF_TRACE is an environment variable that you need to set your machine.
Usage
export CF_TRACE=true
Controlling Timeouts
When a new application is pushed into the Cloud Foundry, timeouts like cf push
after 60 secs or application stagging after 15 mins or application may start-up
after 15 minutes.
To avoid the above timeout issues:
Manifest vs CLI
A manifest reduces the amount of typing when deploying via CLI. The purpose
of this is to make the deployment easily repeatable.
Options specified via CLI override the options specified via manifest.
Example
Environment Variables
Environment variables are the key/value pairs that can be set apart from the
manifest entries. They can be set via
Manifest file or
Command line interface using the command
You can view the user-defined and system-defined variables by using the
following command.
cf env [app-name]
Overview
This section deals with certain things that need to be considered while building
Cloud Foundry deployable applications.
You will be learning 12-factor application rules that outline the architectural
principles for modern apps.
12-Factor Application
Codebase
Dependencies
Configuration
Backing services
Processes
Port binding
Export services via port binding.
Concurrency
Disposablity
Dev/prod parity
Logs
Admin processes
Application Architecture
Application architecture concerns
Logging
Loggregator will automatically handle all output logged to sysout or syserr.
Don't use log files because local file system is generally not available and
loggregator will not handle log files made to the file system or the other
resources.
Instead write to sysout or consider writing log records to fast NoSQL
database.
https://docs.cloudfoundry.org/cf-cli/cf-help.html
_________ allows cloud controller to locate instances on separate zones to boost redundancy.
What is the command to see the logs of the application deployed to cloud foundry?
PWS has the below default app domain as_______.
Select all the languages for which Build Packs are available.
What is the command to check the version?
CCDB is____.