/ Containers

Deploying Production Grade Pivotal Cloud Foundry's Pivotal Application Service(PAS)

Overview

Pivotal Cloud Foundry (PCF) is a platform agnostic cloud computing platform that provides an on-demand and scalable solution to continuously deliver any app to every major private and public cloud with a single platform.Pivotal Cloud Foundry is a single platform to deploy Pivotal Application Service(formerly Elastic Runtime), Pivotal Container Service and Pivotal Function Service(Not yet GA).

PCF2

Ref: pivotal.io

This blog focuses on Pivotal Application Service which is a PaaS platform .This article will provide steps for deploying production grade PCF Pivotal Application Service on a VMware vSphere 6.5 environment.This article focuses on deployment and configuration, if you are new to Pivotal Cloud Foundry I highly recommend you go through the PCF documentation to understand how it works and its architecture. I will not be covering any concepts or architecture in this blog. Refer below for PCF overview and architecture

PCF Overview and Concepts
Refrence Architecture

Pivotal Recommedended Architecture

pcfwitoutNSX

ref: pivotal.io

Prerequisites

To complete this article, you will need below Infrastructure:

* Atleast 10 routable IPs
     3 x Gorouters
     3 x Diego Brain
     2 x MySQL Proxy
     1 x HA Proxy
     1 x Ops Manager
* VMware vSphere 6.5 Cluster with Datastore on shared storage
* NTP Server
* 2 x Wildcard DNS record 
    *.system.itp-inc.com
    *.app.itp-inc.com
* DNS A record for PCF Ops Manager
* PCF Ops Manager OVA for vSphere - pcf-vsphere-2.1-build.335.ova
  [Download Ops Manager](https://network.pivotal.io/products/ops-manager)
* PAS - cf-2.1.7-build.4.pivotal
  [Download PAS](https://network.pivotal.io/products/elastic-runtime)
* 2 x /24 Network subnets for PCF-INFRA and PCF-PAS

VMware vSphere Requirements

The following are the minimum resource requirements for maintaining a Pivotal Cloud Foundry (PCF) deployment with Ops Manager and Pivotal Application Service (PAS) on vSphere:

* vSphere 6.5, 6.0, or 5.5
* Disk space: 2TB recommended
* Memory: 120GB
* Two public IP addresses: One for PAS and one for Ops Manager
* vCPU cores: 80
* Overall CPU: 28 GHz
* vSphere editions: standard and above
* Ops Manager must have HTTPS access to vCenter and ESX hosts on TCP port 443.
* A configured vSphere cluster

Ref: docs.pivotal.io

Cluster Components

* VMware vSphere 6.5 environment with vSAN for shared storage
* vsanDatastore to store Ephemeral and Persistent disks
* VMware Distributed vSwitch
* PCF Ops Manager 2.1.7 - 2.1-build.335
* PCF PAS 2.1.7 - cf-2.1.7-build.4

PCF Virtual Machines

To achieve HA PCF will deploy total 42 VMs mentioned below

3 x Consul
2 x NATS
1 x File storage
2 x MySQL Proxy
3 x My SQL Server
1 x Backup Prepare Node
3 x Diego BBS
2 x UAA
2 x Cloud Controller
1 x HA Proxy
3 x Gorouters
1 x Clock Global
2 x Cloud Controller Worker
3 x Diego Cell
3 x Diego Brain
3 x Loggregator Trafficcontroller
3 x Syslog Adapter
2 x Syslog Scheduler
2 x Doppler Server

Deploy PCF Operations Manager on vSphere vCenter

  1. Login to vCenter Web client and create below folders

    VM and Template Folder - pcf_vms
    VM and Template Folder - pcf_templates
    Storage Folder - pcf_disk
    
  2. Select the pcf_vms folder to highlight it, and then click Actions > Deploy OVF Template.
    pcf1-2

  3. In the Select Screen, choose Local file and browse to Pivotal Cloud Foundry Ops Manager for vSphere.ova file that you downloaded and click Next.

pcf2

pcf3

4.In the Review Details page, review the details page and click Next.
pcf5

5.On the Select Storage screen, select the vsanDatastore and click Next.

pcf6

  1. In the Networks page, select PCF_INFRA network which created on VDS and click Next.

pcf7

  1. In the Cutomize Template page, provide the following details:

pcf8

- IP Address: 10.9.85.10
- Netmask: 255.255.255.0
- Gateway: 10.9.85.254
- DNS: 10.9.60.20
- NTP: 10.9.60.100
- Admin Password: <password>
- Confirm Password: <password>
- Custom Hostname: Leave to default or provide a custom name
  1. In the Ready to complete screen, review information and click Finish.
    pcf9-1
    pcf4
    pcf10

Login to Ops Manager and configure BOSH Director for vSphere

  1. Browse FQDN of Ops Manager - https://opsmanager.system.itp-inc.com

  2. First time when you start Ops Manager, select Internal Authentication, PCF will maintain user database locally.
    ops1

  3. Fill the username and password.Enter a Decryption passphrase and the Decryption passphrase confirmation.If you are using an Http or Https proxy please fill in the details.
    ops2

  4. Login to Ops Manager with credentials created in previous step
    ops4

  5. In the Installation Dashboard screen, click VMware vSphere tile
    ops5

  6. On the Settings tab,click vCenter Config and configure as per below

    a. vCenter Host: Hostname or IP of the vCenter.
    b. vCenter Username: vCenter username with create and delete
    privileges for virtual machines (VMs) and folders.
    c. vCenter Password: Password for the vCenter username.
    d. Datacenter Name: Datacenter name from vCenter.
    e. Virtual Disk Type: Virtual Disk Type (Thin/Thick).
    f. Ephemeral Datastore Names (comma delimited): Datastores to store
    ephemeral VM disks
    g. Persistent Datastore Names (comma delimited): Datastores to store
    persistent VM disks
    h. Select Standard vCenter Networking
    i. VM Folder Name: defaults to pcf_vms. Bosh director will place VMs in this folder
    j. Template Folder: Defaults to pcf_templates. Bosh director will
    place VM Templates in this folder
    k. Disk path Folder: defaults to pcf_disk. Bosh director will place
    VM disks in this folder

ops6
ops7
ops8

  1. In Director Config configure below:

    a. In the NTP Servers (comma delimited): NTP server addresses.
    b. Select VM Ressurector Plugin.
    c. Credhub Encryption, Blobstore Location, Database Location
    set to Internal.
    d. Leave all other options to default.

cf1
cf2
cf3
cf4
cf5
cf6

  1. In Create Availability Zones configure below.

    a. Click Add and configure below
    b. Name for the Availability Zone.
    b. Type the Name of vCenter Cluster to use as an Availability Zone.
    You can add more Availability cluster by repeating above steps,
    Pivotal recommends 3.

    cf7

  2. In Create Networks configure below

a. Select Enable ICMP checks to enable ICMP on network
b. Click Add Network
c. Type a Name for the network
d. Type vSphere Network Name, it should match the portgroup name in
vCenter
e. Type the CIDR of portgroup
f. Type IP addresses that you want BOSH director to exclude while
assigning to VMs
g. Type DNS and Gateway IP
h. Select the Availability Zones we added above

cf8-1
cf9-1

  1. In Assign AZs and Networks select a Singleton Availability Zone and Network.
    cf10
  2. In Security leave all to default settings.
    cf12
  3. In Syslog we selected No. if you are using external syslog, Please enter details.
    cf13
  4. In Resource Config leave all to default settings.
    cf14
  5. Click Installation Dashboard to go back to the Dashboard and click Apply Changes to start the BOSH Director installation.
    It will take some time to install BOSH director and you can check logs if installation fails

bosh
Installing and configuring Pivotal Application Service for vSphere

  1. Adding Pivotal Application Service tile to Ops Manager

    a. In Ops Manager, click Import a Product and select the Pivotal
    Application Service .pivotal file (cf-2.1.7-build.4.pivotal). Once
    the file is uploaded click on "+" to add as a tile.

    pas1

  2. Click on PAS and then select Settings and select Assign AZs and Networks.

    a. Select AZ for Singleton and Balance jobs
    b. Select the Network for PAS VMs(PCF-PAS).

    pas2

  3. Select Domains and enter domain names for system and app
    System : system.itp-inc.com , Apps : app.itp-inc.com. You also need to
    create wilcard DNS entries for these domains
    pas4

  4. Select Networking

    a. Add the three IPs that we reserved for the GoRouters in the Router
    IPs
    input box. The three IPs we reserved for Diego Brains in the SSH Proxy IPs input box, 1 IP for HAProxy and TCP Router
    leave blank as we are not enabling TCP routing.
    b. Click Generate RSA Certificate, type system and app domain names and generate self signed cert
    c. We selected Disable SSL certificate verification since we are
    using self signed certs
    d. Leave the rest of the fields blank or defaults

pas5
5. Select Application Containers and Leave all the fields to defaults

  1. Select Application Developer Controls and leave all the fields to
    defaults

  2. Select Application Security Groups and acknowledge

  3. Select Authentication and Enterprise SSO and set the password
    policies as per your need. We left them to defaults

  4. Select UAA and select Internal MySQL for high availability(you
    can also use external MYSQL) and then generate cert under SAML Service
    Provider Credentials for domain .login.your-system-domain
    (
    .login.system.itp-inc.com). Rest leave all the fields to
    defaults

  5. Select Credhub. Add a key and secret under Encryption Keys and rest leave all the fields to defaults

  6. Select Databases and select Internal Databases – MySQL

  7. Select File Storage and select Internal WebDAV, you can use
    other options if you plan to use external storage

  8. Select System Logging and leave all the fields to defaults

  9. Select Customer Branding and leave all the fields to defaults

  10. Select Apps Manager and leave all the fields to defaults

  11. Select Email Notifications and leave all the fields to defaults

  12. Select App Autoscaler and leave all the fields to defaults

  13. Select Cloud Controller and leave all the fields to defaults

  14. Select Smoke Tests and leave all the fields to defaults

  15. Select Advanced Features and leave all the fields to defaults

  16. Select Errands turn off Notifications and Notifications UI since we are not using Emails and leave all the fields to defaults

  17. Select Resource Configs and leave all the fields to defaults

Note: Click save on all the above settings on every page

  1. click on Installation Dashboard to go back and Apply changes

It will take some time(approx. 60 to 120 mins) to install PAS and you can check logs if installation fails.

pas14

You can check the status of all the VMs by clicking on Pivotal Application Service tile and then click on the Status tab.
pas7

pas8

pas10

You can check the credentials of all the VMs by clicking on Pivotal Application Service tile and then click on Credentials tab. To login to Apps Manager and CF API please note Admin credentials under UAA

pas11

pas12

Verification

Login to PAS using CLI

  1. Install CF CLI

Install CF CLI

  1. Login to PAS
λ  ~/Downloads  cf api https://api.system.itp-inc.com --skip-ssl-validation
Setting api endpoint to https://api.system.itp-inc.com...
OK

api endpoint:   https://api.system.itp-inc.com
api version:    2.103.0
Not logged in. Use 'cf login' to log in.
λ  ~/Downloads 
λ  ~/Downloads  cf login
API endpoint: https://api.system.itp-inc.com

Email> admin
Password> 
Authenticating...
OK
Select an org (or press enter to skip):
1. itp-cloud-engineering
2. system

Org> 1
Targeted org itp-cloud-engineering
Targeted space paas        
API endpoint:   https://api.system.itp-inc.com (API version: 2.103.0)
User:           admin
Org:            itp-cloud-engineering
Space:          paas

Note: Get Admin credentials under UAA from Credentials tab by clicking on PAS tile from installation dashboard

I have already created Org(itp-cloud-engineering) and space(paas), you can create them using below commands

λ  ~/Downloads  cf create-org itp-innovation-labs
Creating org itp-innovation-labs as admin...
OK

Assigning role OrgManager to user admin in org itp-innovation-labs ...
OK

TIP: Use 'cf target -o "itp-innovation-labs"' to target new org
λ  ~/Downloads
λ  ~/Downloads  cf create-space cloud-engineering -o itp-innovation-labs
Creating space cloud-engineering in org itp-innovation-labs as admin...
OK
Assigning role RoleSpaceManager to user admin in org itp-innovation-labs / space cloud-engineering as admin...
OK
Assigning role RoleSpaceDeveloper to user admin in org itp-innovation-labs / space cloud-engineering as admin...
OK

TIP: Use 'cf target -o "itp-innovation-labs" -s "cloud-engineering"' to target new space

Deploy Sample Application

Sample Cloud foundry applications can be found on below link

Sample Cloud Foundry Apps

We will use cf-sample-app-nodejs
https://github.com/cloudfoundry-samples/cf-sample-app-nodejs

λ  ~/Downloads  git clone https://github.com/cloudfoundry-samples/cf-sample-app-nodejs.git
Cloning into 'cf-sample-app-nodejs'...
remote: Counting objects: 88, done.
remote: Total 88 (delta 0), reused 0 (delta 0), pack-reused 88
Unpacking objects: 100% (88/88), done.
λ  ~/Downloads 
λ  ~/Downloads  cd cf-sample-app-nodejs 
λ  cf-sample-app-nodejs master ✓ cf push                                                                
Pushing from manifest to org itp-cloud-engineering / space paas as admin...
Using manifest file /Users/bikramsingh/Downloads/cf-sample-app-nodejs/manifest.yml
Getting app info...
Creating app with these attributes...
+ name:        cf-nodejs
  path:        /Users/bikramsingh/Downloads/cf-sample-app-nodejs
+ instances:   1
+ memory:      512M
  routes:
+   cf-nodejs-active-civet.app.itp-inc.com

Creating app cf-nodejs...
Mapping routes...
Comparing local files to remote cache...
Packaging files to upload...
Uploading files...
 714.28 KiB / 714.28 KiB [=====================================================================================] 100.00% 5s

Waiting for API to complete processing files...

Staging app and tracing logs...
   Downloading binary_buildpack...
   Downloading nodejs_buildpack...
   Downloading go_buildpack...
   Downloading staticfile_buildpack...
   Downloading python_buildpack...
   Downloaded python_buildpack
   Downloading php_buildpack...
   Downloaded staticfile_buildpack
   Downloading dotnet_core_buildpack...
   Downloaded binary_buildpack
   Downloading java_buildpack_offline...
   Downloaded nodejs_buildpack
   Downloading ruby_buildpack...
   Downloaded go_buildpack
   Downloaded php_buildpack
   Downloaded dotnet_core_buildpack
   Downloaded ruby_buildpack
   Downloaded java_buildpack_offline
   Cell 92b34cdb-0d8d-4d00-82f9-b31d4586006f creating container for instance 4d38d14e-d187-4efc-8836-ded8ffb93eb8
   Cell 92b34cdb-0d8d-4d00-82f9-b31d4586006f successfully created container for instance 4d38d14e-d187-4efc-8836-ded8ffb93eb8
   Downloading app package...
   Downloaded app package (1.2M)
   -----> Nodejs Buildpack version 1.6.25
   -----> Installing binaries
          engines.node (package.json): unspecified
          engines.npm (package.json): unspecified (use default)
          **WARNING** Node version not specified in package.json. See: http://docs.cloudfoundry.org/buildpacks/node/node-tips.html
   -----> Installing node 6.14.2
          Copy [/tmp/buildpacks/180bd3e1f798f3affb7e6b743259c2b3/dependencies/fc7631adea611ac5bbf65365c90bb2d2/node-6.14.2-linux-x64-345ad39f.tgz]
          Using default npm version: 3.10.10
   -----> Installing yarn 1.7.0
          Copy [/tmp/buildpacks/180bd3e1f798f3affb7e6b743259c2b3/dependencies/6efcd2cc3b2e0d59dd3062e6d5088845/yarn-v1.7.0-e7720ee3.tar.gz]
          Installed yarn 1.7.0
   -----> Creating runtime environment
          PRO TIP: It is recommended to vendor the application's Node.js dependencies
          Visit http://docs.cloudfoundry.org/buildpacks/node/index.html#vendoring
          NODE_ENV=production
          NODE_HOME=/tmp/contents998984204/deps/0/node
          NODE_MODULES_CACHE=true
          NODE_VERBOSE=false
          NPM_CONFIG_LOGLEVEL=error
          NPM_CONFIG_PRODUCTION=true
   -----> Building dependencies
          Installing node modules (package.json)
   cf-nodejs@1.0.0 /tmp/app
   ├─┬ express@4.16.3 
   │ ├─┬ accepts@1.3.5 
   │ │ ├─┬ mime-types@2.1.18 
   │ │ │ └── mime-db@1.33.0 
   │ │ └── negotiator@0.6.1 
   │ ├── array-flatten@1.1.1 
   │ ├─┬ body-parser@1.18.2 
   │ │ ├── bytes@3.0.0 
   │ │ ├─┬ http-errors@1.6.3 
   │ │ │ └── inherits@2.0.3 
   │ │ ├── iconv-lite@0.4.19 
   │ │ └─┬ raw-body@2.3.2 
   │ │   └─┬ http-errors@1.6.2 
   │ │     ├── depd@1.1.1 
   │ │     └── setprototypeof@1.0.3 
   │ ├── content-disposition@0.5.2 
   │ ├── content-type@1.0.4 
   │ ├── cookie@0.3.1 
   │ ├── cookie-signature@1.0.6 
   │ ├─┬ debug@2.6.9 
   │ │ └── ms@2.0.0 
   │ ├── depd@1.1.2 
   │ ├── encodeurl@1.0.2 
   │ ├── escape-html@1.0.3 
   │ ├── etag@1.8.1 
   │ ├─┬ finalhandler@1.1.1 
   │ │ └── unpipe@1.0.0 
   │ ├── fresh@0.5.2 
   │ ├── merge-descriptors@1.0.1 
   │ ├── methods@1.1.2 
   │ ├─┬ on-finished@2.3.0 
   │ │ └── ee-first@1.1.1 
   │ ├── parseurl@1.3.2 
   │ ├── path-to-regexp@0.1.7 
   │ ├─┬ proxy-addr@2.0.3 
   │ │ ├── forwarded@0.1.2 
   │ │ └── ipaddr.js@1.6.0 
   │ ├── qs@6.5.1 
   │ ├── range-parser@1.2.0 
   │ ├── safe-buffer@5.1.1 
   │ ├─┬ send@0.16.2 
   │ │ ├── destroy@1.0.4 
   │ │ └── mime@1.4.1 
   │ ├── serve-static@1.13.2 
   │ ├── setprototypeof@1.1.0 
   │ ├── statuses@1.4.0 
   │ ├─┬ type-is@1.6.16 
   │ │ └── media-typer@0.3.0 
   │ ├── utils-merge@1.0.1 
   │ └── vary@1.1.2 
   └─┬ jade@1.11.0 
     ├── character-parser@1.2.1 
     ├─┬ clean-css@3.4.28 
     │ ├─┬ commander@2.8.1 
     │ │ └── graceful-readlink@1.0.1 
     │ └─┬ source-map@0.4.4 
     │   └── amdefine@1.0.1 
     ├── commander@2.6.0 
     ├─┬ constantinople@3.0.2 
     │ └── acorn@2.7.0 
     ├─┬ jstransformer@0.0.2 
     │ ├── is-promise@2.1.0 
     │ └─┬ promise@6.1.0 
     │   └── asap@1.0.0 
     ├─┬ mkdirp@0.5.1 
     │ └── minimist@0.0.8 
     ├─┬ transformers@2.1.0 
     │ ├─┬ css@1.0.8 
     │ │ ├── css-parse@1.0.4 
     │ │ └── css-stringify@1.0.5 
     │ ├─┬ promise@2.0.0 
     │ │ └── is-promise@1.0.1 
     │ └─┬ uglify-js@2.2.5 
     │   ├─┬ optimist@0.3.7 
     │   │ └── wordwrap@0.0.3 
     │   └── source-map@0.1.43 
     ├─┬ uglify-js@2.8.29 
     │ ├── source-map@0.5.7 
     │ ├── uglify-to-browserify@1.0.2 
     │ └─┬ yargs@3.10.0 
     │   ├── camelcase@1.2.1 
     │   ├─┬ cliui@2.1.0 
     │   │ ├─┬ center-align@0.1.3 
     │   │ │ ├─┬ align-text@0.1.4 
     │   │ │ │ ├─┬ kind-of@3.2.2 
     │   │ │ │ │ └── is-buffer@1.1.6 
     │   │ │ │ ├── longest@1.0.1 
     │   │ │ │ └── repeat-string@1.6.1 
     │   │ │ └── lazy-cache@1.0.4 
     │   │ ├── right-align@0.1.3 
     │   │ └── wordwrap@0.0.2 
     │   ├── decamelize@1.2.0 
     │   └── window-size@0.1.0 
     ├── void-elements@2.0.1 
     └─┬ with@4.0.3 
       ├── acorn@1.2.2 
       └── acorn-globals@1.0.9 
   Exit status 0
   Uploading droplet, build artifacts cache...
   Uploading build artifacts cache...
   Uploading droplet...
   Uploaded build artifacts cache (2.2M)
   Uploaded droplet (17.2M)
   Uploading complete
   Cell 92b34cdb-0d8d-4d00-82f9-b31d4586006f stopping instance 4d38d14e-d187-4efc-8836-ded8ffb93eb8
   Cell 92b34cdb-0d8d-4d00-82f9-b31d4586006f destroying container for instance 4d38d14e-d187-4efc-8836-ded8ffb93eb8
   Cell 92b34cdb-0d8d-4d00-82f9-b31d4586006f successfully destroyed container for instance 4d38d14e-d187-4efc-8836-ded8ffb93eb8

Waiting for app to start...

name:              cf-nodejs
requested state:   started
instances:         1/1
usage:             512M x 1 instances
routes:            cf-nodejs-active-civet.app.itp-inc.com
last uploaded:     Mon 09 Jul 02:44:39 EDT 2018
stack:             cflinuxfs2
buildpack:         nodejs
start command:     npm start

     state     since                  cpu    memory      disk      details
#0   running   2018-07-09T06:45:26Z   0.0%   0 of 512M   0 of 1G   

λ  cf-sample-app-nodejs master ✓
λ  cf-sample-app-nodejs master ✓ cf app cf-nodejs
Showing health and status for app cf-nodejs in org itp-cloud-engineering / space paas as admin...

name:              cf-nodejs
requested state:   started
instances:         1/1
usage:             512M x 1 instances
routes:            cf-nodejs-active-civet.app.itp-inc.com
last uploaded:     Mon 09 Jul 02:44:39 EDT 2018
stack:             cflinuxfs2
buildpack:         nodejs

     state     since                  cpu    memory          disk          details
#0   running   2018-07-09T06:45:26Z   0.2%   52.7M of 512M   63.6M of 1G   
λ  cf-sample-app-nodejs master ✓

You can see above app is deployed and a route is also created which we can access in browser - cf-nodejs-active-civet.app.itp-inc.com

pas15

We can also check logs

λ  cf-sample-app-nodejs master ✓ cf logs cf-nodejs --recent
Retrieving logs for app cf-nodejs in org itp-cloud-engineering / space paas as admin...

   2018-07-09T02:44:43.74-0400 [STG/0] OUT Downloading binary_buildpack...
   2018-07-09T02:44:45.02-0400 [STG/0] OUT Downloading app package...
   2018-07-09T02:44:45.19-0400 [STG/0] OUT Downloaded app package (1.2M)
   2018-07-09T02:44:47.12-0400 [STG/0] OUT -----> Nodejs Buildpack version 1.6.25
   2018-07-09T02:44:47.14-0400 [STG/0] OUT -----> Installing binaries
   2018-07-09T02:44:47.14-0400 [STG/0] OUT        engines.node (package.json): unspecified
   2018-07-09T02:44:47.14-0400 [STG/0] OUT        engines.npm (package.json): unspecified (use default)
   2018-07-09T02:44:47.14-0400 [STG/0] OUT        **WARNING** Node version not specified in package.json. See: http://docs.cloudfoundry.org/buildpacks/node/node-tips.html
   2018-07-09T02:44:47.14-0400 [STG/0] OUT -----> Installing node 6.14.2
   2018-07-09T02:44:47.14-0400 [STG/0] OUT        Copy [/tmp/buildpacks/180bd3e1f798f3affb7e6b743259c2b3/dependencies/fc7631adea611ac5bbf65365c90bb2d2/node-6.14.2-linux-x64-345ad39f.tgz]
   2018-07-09T02:44:49.48-0400 [STG/0] OUT        Using default npm version: 3.10.10
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├── content-type@1.0.4 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├── cookie@0.3.1 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├── cookie-signature@1.0.6 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├─┬ debug@2.6.9 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ │ └── ms@2.0.0 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├── depd@1.1.2 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├── encodeurl@1.0.2 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├── escape-html@1.0.3 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├── etag@1.8.1 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├─┬ finalhandler@1.1.1 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ │ └── unpipe@1.0.0 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├── fresh@0.5.2 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├── merge-descriptors@1.0.1 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├── methods@1.1.2 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├─┬ on-finished@2.3.0 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ │ └── ee-first@1.1.1 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├── parseurl@1.3.2 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├── path-to-regexp@0.1.7 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├─┬ proxy-addr@2.0.3 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ │ ├── forwarded@0.1.2 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ │ └── ipaddr.js@1.6.0 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├── qs@6.5.1 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├── range-parser@1.2.0 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├── safe-buffer@5.1.1 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├─┬ send@0.16.2 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ │ ├── destroy@1.0.4 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ │ └── mime@1.4.1 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├── serve-static@1.13.2 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├── setprototypeof@1.1.0 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├── statuses@1.4.0 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├─┬ type-is@1.6.16 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ │ └── media-typer@0.3.0 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ ├── utils-merge@1.0.1 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT │ └── vary@1.1.2 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT └─┬ jade@1.11.0 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   ├── character-parser@1.2.1 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   ├─┬ clean-css@3.4.28 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │ ├─┬ commander@2.8.1 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │ │ └── graceful-readlink@1.0.1 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │ └─┬ source-map@0.4.4 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │   └── amdefine@1.0.1 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   ├── commander@2.6.0 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   ├─┬ constantinople@3.0.2 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │ └── acorn@2.7.0 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   ├─┬ jstransformer@0.0.2 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │ ├── is-promise@2.1.0 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │ └─┬ promise@6.1.0 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │   └── asap@1.0.0 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   ├─┬ mkdirp@0.5.1 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │ └── minimist@0.0.8 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   ├─┬ transformers@2.1.0 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │ ├─┬ css@1.0.8 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │ │ ├── css-parse@1.0.4 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │ │ └── css-stringify@1.0.5 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │ ├─┬ promise@2.0.0 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │ │ └── is-promise@1.0.1 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │ └─┬ uglify-js@2.2.5 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │   ├─┬ optimist@0.3.7 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │   │ └── wordwrap@0.0.3 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │   └── source-map@0.1.43 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   ├─┬ uglify-js@2.8.29 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │ ├── source-map@0.5.7 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │ ├── uglify-to-browserify@1.0.2 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │ └─┬ yargs@3.10.0 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │   ├── camelcase@1.2.1 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │   ├─┬ cliui@2.1.0 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │   │ ├─┬ center-align@0.1.3 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │   │ │ ├─┬ align-text@0.1.4 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │   │ │ │ ├─┬ kind-of@3.2.2 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │   │ │ │ │ └── is-buffer@1.1.6 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │   │ │ │ ├── longest@1.0.1 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │   │ │ │ └── repeat-string@1.6.1 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │   │ │ └── lazy-cache@1.0.4 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │   │ ├── right-align@0.1.3 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │   │ └── wordwrap@0.0.2 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │   ├── decamelize@1.2.0 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   │   └── window-size@0.1.0 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   ├── void-elements@2.0.1 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT   └─┬ with@4.0.3 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT     ├── acorn@1.2.2 
   2018-07-09T02:45:06.67-0400 [STG/0] OUT     └── acorn-globals@1.0.9 
   2018-07-09T02:45:10.46-0400 [STG/0] OUT Exit status 0
   2018-07-09T02:45:10.46-0400 [STG/0] OUT Uploading droplet, build artifacts cache...
   2018-07-09T02:45:10.46-0400 [STG/0] OUT Uploading build artifacts cache...
   2018-07-09T02:45:10.46-0400 [STG/0] OUT Uploading droplet...
   2018-07-09T02:45:10.92-0400 [STG/0] OUT Uploaded build artifacts cache (2.2M)
   2018-07-09T02:45:12.32-0400 [API/0] OUT Creating droplet for app with guid 5db68d35-89d2-4124-b540-22a0bcfa56b1
   2018-07-09T02:45:15.50-0400 [STG/0] OUT Uploaded droplet (17.2M)
   2018-07-09T02:45:15.50-0400 [STG/0] OUT Uploading complete
   2018-07-09T02:45:15.56-0400 [STG/0] OUT Cell 92b34cdb-0d8d-4d00-82f9-b31d4586006f stopping instance 4d38d14e-d187-4efc-8836-ded8ffb93eb8
   2018-07-09T02:45:15.56-0400 [STG/0] OUT Cell 92b34cdb-0d8d-4d00-82f9-b31d4586006f destroying container for instance 4d38d14e-d187-4efc-8836-ded8ffb93eb8
   2018-07-09T02:45:15.97-0400 [CELL/0] OUT Cell da4f0c8e-de3e-4497-ba2a-c53cdb2629c5 creating container for instance 0a74077f-9c76-4f98-569f-5b72
   2018-07-09T02:45:16.53-0400 [STG/0] OUT Cell 92b34cdb-0d8d-4d00-82f9-b31d4586006f successfully destroyed container for instance 4d38d14e-d187-4efc-8836-ded8ffb93eb8
   2018-07-09T02:45:17.06-0400 [CELL/0] OUT Cell da4f0c8e-de3e-4497-ba2a-c53cdb2629c5 successfully created container for instance 0a74077f-9c76-4f98-569f-5b72
   2018-07-09T02:45:21.82-0400 [CELL/0] OUT Starting health monitoring of container
   2018-07-09T02:45:24.24-0400 [APP/PROC/WEB/0] OUT > cf-nodejs@1.0.0 start /home/vcap/app
   2018-07-09T02:45:24.24-0400 [APP/PROC/WEB/0] OUT > node server.js
   2018-07-09T02:45:26.70-0400 [CELL/0] OUT Container became healthy
  ......
  .......
   2018-07-09T02:50:57.10-0400 [RTR/0] OUT cf-nodejs-active-civet.app.itp-inc.com - [2018-07-09T06:50:57.102+0000] "GET /ping.txt HTTP/1.1" 304 0 0 "http://cf-nodejs-active-civet.app.itp-inc.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" "10.9.86.249:51854" "10.9.86.39:61012" x_forwarded_for:"10.9.100.79, 10.9.86.249" x_forwarded_proto:"http" vcap_request_id:"989e1aa3-9aee-4505-69e8-b5917debbc34" response_time:0.00571559 app_id:"5db68d35-89d2-4124-b540-22a0bcfa56b1" app_index:"0" x_b3_traceid:"4f2c8389d3cad8f0" x_b3_spanid:"4f2c8389d3cad8f0" x_b3_parentspanid:"-"
   2018-07-09T02:50:57.10-0400 [RTR/0] OUT 
λ  cf-sample-app-nodejs master ✓

Or, stream live logs:

cf logs cf-spring

Restart the app:

cf restart cf-nodejs

Horizontally Scale the App : Changes the number of instances. We will increase from 1 instance to 3

λ  cf-sample-app-nodejs master ✓ cf scale cf-nodejs -i 3
Scaling app cf-nodejs in org itp-cloud-engineering / space paas as admin...
OK
λ  cf-sample-app-nodejs master ✓ cf app cf-nodejs       
Showing health and status for app cf-nodejs in org itp-cloud-engineering / space paas as admin...

name:              cf-nodejs
requested state:   started
instances:         3/3
usage:             512M x 3 instances
routes:            cf-nodejs-active-civet.app.itp-inc.com
last uploaded:     Mon 09 Jul 02:44:39 EDT 2018
stack:             cflinuxfs2
buildpack:         nodejs

     state     since                  cpu    memory        disk          details
#0   running   2018-07-09T06:45:26Z   0.1%   53M of 512M   63.6M of 1G   
#1   running   2018-07-09T06:59:47Z   0.0%   40K of 512M   8K of 1G      
#2   running   2018-07-09T06:59:50Z   0.0%   0 of 512M     0 of 1G       
λ  cf-sample-app-nodejs master ✓ 

Vertically Scale the App : Changes the disk space limit or memory limit for each app instance.

Increase the memory limit for each app instance:

λ  cf-sample-app-nodejs master ✓ cf scale cf-nodejs -m 1G

This will cause the app to restart. Are you sure you want to scale cf-nodejs?> yes

Scaling app cf-nodejs in org itp-cloud-engineering / space paas as admin...
OK
Stopping app cf-nodejs in org itp-cloud-engineering / space paas as admin...
OK

Starting app cf-nodejs in org itp-cloud-engineering / space paas as admin...

0 of 3 instances running, 3 starting
1 of 3 instances running, 2 starting

App started


OK

App cf-nodejs was started using this command `npm start`

Showing health and status for app cf-nodejs in org itp-cloud-engineering / space paas as admin...
OK

requested state: started
instances: 3/3
usage: 1G x 3 instances
urls: cf-nodejs-active-civet.app.itp-inc.com
last uploaded: Mon Jul 9 06:44:39 UTC 2018
stack: cflinuxfs2
buildpack: nodejs

     state      since                    cpu    memory        disk          details
#0   running    2018-07-09 03:03:33 AM   0.1%   53.4M of 1G   63.6M of 1G
#1   starting   2018-07-09 03:03:26 AM   0.0%   44K of 1G     8K of 1G
#2   starting   2018-07-09 03:03:26 AM   0.0%   44.9M of 1G   63.6M of 1G

Increase the disk limit for each app instance:

λ  cf-sample-app-nodejs master ✓ cf scale cf-nodejs -k 512M

This will cause the app to restart. Are you sure you want to scale cf-nodejs?> yes

Scaling app cf-nodejs in org itp-cloud-engineering / space paas as admin...
OK
Stopping app cf-nodejs in org itp-cloud-engineering / space paas as admin...
OK

Starting app cf-nodejs in org itp-cloud-engineering / space paas as admin...

0 of 3 instances running, 3 starting
1 of 3 instances running, 2 starting

App started


OK

App cf-nodejs was started using this command `npm start`

Showing health and status for app cf-nodejs in org itp-cloud-engineering / space paas as admin...
OK

requested state: started
instances: 3/3
usage: 1G x 3 instances
urls: cf-nodejs-active-civet.app.itp-inc.com
last uploaded: Mon Jul 9 06:44:39 UTC 2018
stack: cflinuxfs2
buildpack: nodejs

     state      since                    cpu    memory        disk            details
#0   running    2018-07-09 03:05:02 AM   0.6%   15.1M of 1G   63.6M of 512M
#1   starting   2018-07-09 03:04:56 AM   0.8%   15M of 1G     63.6M of 512M
#2   starting   2018-07-09 03:04:56 AM   0.7%   15M of 1G     63.6M of 512M

PAS also has a GUI called Apps Manager which can also be used manage PAS.
GUI can be accessed by going to below URL login.SYSTEM-DOMAIN

https://login.system.itp-inc.com/

ap1

ap2

ap3

ap4

ap5

ap6

You can learn more about Apps Manager at below URL
https://docs.pivotal.io/pivotalcf/2-1/console/index.html

Explore more about Pivotal cloud Foundy :

How PCF Works
https://docs.pivotal.io/pivotalcf/concepts

PCF Documentation
https://docs.pivotal.io/pivotalcf/installing/pcf-docs.html

Installing PCF (IaaS-specific guides for installing PCF)
https://docs.pivotal.io/pivotalcf/installing/

Learn more about the Spring Framework
https://spring.io/guides

Explore and download more Cloud Foundry sample apps
https://github.com/cloudfoundry-samples/

In next blog we will try to cover Pivotal Container Server(PKS) it enables operators to provision, operate, and manage enterprise-grade Kubernetes clusters

Thank you
Cloud Engineering, ITP Innovation Labs