Skip to main content

Pivotal Cloud Foundry Developer Certification - Cloud Foundry Overview - Deployment

How do you deploy an application? 

Applications can be deployed using '$ cf push' command. With this command CF performs the following tasks:
  1. Uploads and store the app files
  2. Examines and stores app metadata
  3. Creates a 'droplet' i.e. CF unit of execution, for the app
  4. Selects an appropriate Diego cell to run the droplet
  5. Starts the app
If app is using the services i.e. db, messaging or email server, then app will not be fully functional until services are provisioned and binded to the app.

What are the activities involved?

Step 1: Deployment preparation
1. Ensure application is cloud-ready. CF behaviors related to file storage, http sessions and port usage may require modifications.
2. Ensure all app resources are uploaded
3. Extraneous files and artifacts are excluded from the app.
4. An instance of every service that app needs has been created
5. Ensure that CF supports the type of app you are deploying.

Step 2: Credentials and Target
1. API endpoint of of instance
2. Org and Space where app have to be deployed
2. Username and password

Step 3: Configure domains
1. CF directs the requests to an app using a route, which is a url made up of a host and a domain
2. Name of an app is the default host for that app.
3. Every app is deployed to an app space that belongs to a domain. 4. Every cf space has a default domain defined.
5. Custom domain can be defined while deploying, provided that the domain is registered and mapped to the organization which contains the target app space.
6. URL for the app should be unique in CF
7. use -n to assign a different host name for the app
8. Use --random-route to create a URL that includes the app name and random keywords

Step 4: Determine deployment options
1. Name of the app
2. Instances of app
3. Memory limit - maximum amount of memory required to run the app.
4. Start command
5. Subdomain (host) and Domain
6. Services
7. Define deployment options on command line or in a manifest file or both.
8. Configure pre-runtime hooks (except Java buildpack) - Pre-runtime looks are app specific initialization tasks, such as setting env variables. hooks are defined in .profile files in apps root directory. CF executes them after buildpack and immediately before each instance of app start.

Step 5: Push the app
1. run the command 'cf push APP-NAME'

Step 6: Configure Service Connections (optional)
1. Configure you app with Service url's and credentials

Step 5: Troubleshoot deployment problems

Comments

Popular posts from this blog

Pivotal Cloud Foundry Developer Certification - Managed and User-Provided Services

1. What is a service? Can you name some examples? Services are cloud native apps dependencies. Consider S ervice as a factory that delivers service instances. Two types: 1. Managed services Cloud Foundry offers a marketplace of services, from which users can provision reserved resources on-demand. Examples of resources services provide include databases on a shared or dedicated server, or accounts on a SaaS application.  Example: my-sql, rabbitmq, redis etc... 2. User provided services User provided services provides the metadata to connect to the system outside the cloud. These services are not available in market place. This are custom services i.e. connecting to your own external DB or any other service outside the cloud i.e. erp etc.. Command to list the service instances in your space: cf services To see details of particular service cf service SERVICE_INSTANCE_NAME What is the “marketplace”? Does it show all services?  The Pivotal Cloud F...

Pivotal Cloud Foundry Developer Certification - Cloud Foundry Architecture

Can you name the main components running inside Cloud Foundry? Do you know what  each of them does? Main components are: Router :  routes incoming traffic to cloud controller or the hosted application in diego cell. It periodically queries the Diego bulletin board system to determine which cells and containers each application currently runs on. Using this router recomputes new routing table based on IP addresses of each cell VM and the host side port number for the cell's container. Oauth2 Server(UAA) and Login server work together to provide the identity management. Cloud controller and Diego brain: CC is responsible for application life-cycle and deployment. It directs the diego brain through CC Bridge component to coordinate individual Diego cells to stage and run applications. CC also maintains record of orgs, spaces, user roles and services. nsync : recieves the message from CC when user scales an app. It writes number of instances into a desiredLRP s...

Pivotal Cloud Foundry Developer Certification - Cloud Foundry Overview - Concepts

Cloud Foundry Concepts Cloud Foundry is the cloud native platform or PaaS i.e. Platform-as-a-service infrastructure which is basically PCF(Runtime & Middleware) + IaaS, where you just manage your application and data. Below diagram will help understanding it more. Deploying an application in IaaS vs PaaS IaaS deployment: 1. Provision a VM 2. Install application runtime 3. Deploy application 4. Configure load balancer 5. Configure SSL termination 6. Configure Service connectivity 7. Configure Firewall PaaS deployment: 1. cf push (CLI command), which will push your application and you do not need to take care of IaaS deployment steps. Scaling an application in IaaS vs PaaS IaaS: Same steps as deployment PaaS: cf scale Cloud Foundry is the open source platform that you can deploy to run your apps on your own computing infrastructure, or deploy on IaaS like AWS, vSphere, or OpenStack. How cloud foundry works CF has subsystems that perform speciali...