Deploy App in PCF(Pivotal Cloud Foundry)

  • Download and Install  CF CLI ( Command Line Interface) from https://pivotal.io
  • Download Sample ( Spring Boot) app from GIT using GIT BASH

git clone https://github.com/cloudfoundry-samples/cf-sample-app-spring.git

  • Navigate to App Directory

$ cd cf-sample-app-spring/

1

2

  • Sometime creation of org does not happen through command line, you might get the below error:

3

  • So you may use the Pivotal Site to create one as below. Signup for Free Trial and then go to Pivotal  Web Services

4

  • Claim your Free Trial and then Create a ORG

5

ORG Created

6

  • Check for ORGS created under your ID

7

  • Click on + Add  a Space and Space is created

8

  • Create a Target using above ORG and SPACE

9

  • Push Code to Cloud using command :  cf push

10

11

  • Once deployed , you can open the url

12

  • You can see the site is successfully deployed and it is up and running

13

 

Miscellaneous Command :

  • Views logs in Console

Recent logs :  cf logs cf-spring –recent

Live stream :  cf logs cf-spring

  • Horizontal Scaling

    cf scale cf-spring -i 2

  • Check the status of app

cf app cf-spring

14

  • Increase the memory limit for each app instance:

            cf scale cf-spring -m 1G

  • Increase the disk limit for each app instance:

           cf scale cf-spring -k 512M

Advertisements