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 - Logging, Scaling and High Availability

 How do you access application logs? cf logs APP_NAME cf start APP_NAME To see the logs of particular pcf sub system. cf logs APP_NAME | grep "API\|CELL" To exclude particular logs cf logs APP_NAME | grep -v "API\|CELL" To see application events i.e. start, stop, crash etc... cf events APP_NAME To display all the lines in the Loggregator buffer cf logs APP_NAME --recent  What are the components of the Loggregator system? Loggregator is the next generation system for aggregating and streaming logs and metrics from all of the user apps and system components in a Cloud Foundry deployment. Primary use: 1. Tail/dump logs using CLI.  2. Stream to 3rd party log archive and analysis service 3. Operators and admins can access Loggregator Firehouse, the combined stream from all the apps and metrics data. 4. Operators can deploy nozzle to the firehouse.  A nozzle is a component that monitors the Firehose for specified events and metrics,

Kumaoni Song/Poem - Uttarakhand meri matrebhoomi

O Bhumi Teri Jai Jaikaara Myar Himaala O Bhumi Teri Jai Jaikaara Myar Himaala Khwar main koot tyaro hyu jhalako-2 Chhalaki kaali Gangai ki dhaara myara Himaala Himaala kaali Gangai ki dhaara myar Himaala Uttarakhand meri matrebhoomi Matrabhoomi ya meri pitrabhoomi O Bhoomi teri jai jai kaara myar Himaala Himaala teri jai jai kaara myar Himaala Tali tali taraai kuni-2 O kuni mali mali bhabara myar Himaala Himaala Mali mali bhabara myar Himaala Badari Kedara ka dwar chhana-2 Myara kankhal Hariwara myar Himaala Himaala kankhal Haridwara myar Himaala Kaali Dhauli ka bali chhali jaani-2 Bata naan thula kailasha myar himaala  Ho Bata naan thula kailasha myar Himaala Parvati ko myaro mait yen chha-2 Ho yen chha Shivjyu ko saurasa myar Himaala Himaala Shiv jyu ko saurasa myar Himaala Dhan mayedi mero yo janama-2 Himaala teri kokhi mahana myar Himaala Himaala teri kokhi mahana myar Himaala Mari jula to tari julo-2 O eju ail tyara baana myar Himaala-2 Himaala ail tyara

OpenStack - Conceptual architecture showing the relationship b/w services

AWS vs Openstack comparison https://redhatstackblog.redhat.com/2015/05/13/public-vs-private-amazon-compared-to-openstack/