Create a Basic Tanzu (formerly PCF) Deployment

Updated 3 weeks ago by Chakravarthy Tenneti

A Tanzu Application Service (formerly PCF) Workflow performing a Basic deployment simply takes your Harness PCF Service and deploys it to your PCF Infrastructure Definition.

Once the PCF app is set up in the Workflow using the App Setup command, you can resize the number of instances specified in the Service manifest.yml or App Setup command using the App Resize command.

Here is an example of a successful PCF Basic deployment:

In this topic:

Before You Begin

Step 1: Set Up a PCF Basic Deployment

To set up a PCF Basic deployment, do the following:

  1. In your Harness Application, create your PCF Service, as described in Connect to Your Target PCF Account.
  2. Create your PCF Infrastructure Definition, as described in Define Your PCF Target Infrastructure.
  3. In your Harness Application, click Workflows.
  4. Click Add Workflow. The Workflow dialog appears.
  5. Name your Workflow, and then, in Workflow Type, select Basic Deployment.
  6. In Environment, select the Environment containing your target Infrastructure Definition.
  7. In Service, select the PCF Service you want to deploy.
  8. In Infrastructure Definition, select your target Infrastructure Definition.

When you are done, the dialog will look something like this:

Click Submit. The PCF Basic Workflow is created.

Step 2: App Setup

The App Setup command uses the manifest.yml in your Harness PCF Service to set up your app.

The Match running instances setting can be used after your first deployment to override the instances setting in the manifest.yml.

To add routes in addition to the routes defined in the Service manifest, select routes in Additional Routes.

For information on using the Use App Autoscaler Plugin settings, see Use the App Autoscaler Service.

Step 3: App Resize

When you first create your PCF Workflow, the App Resize command is displayed as incomplete. Harness simply needs you to confirm or change the default number of desired instances, 100 Percent.

You can select to use a percentage of the number specified in your manifest.yml, or if you used the App Setup Match desired count with current running instances setting, the current number of running instances. You can also use a count to explicitly set the number of desired instances.

Click Advanced to see Desired Instances - Old Version. Here you can set the number of instances for the previous version of the app. By default, the app will downsize to the same number as the number of new app instances.

You can only have one App Resize step in a Basic PCF Workflow.

Step 4: App Rollback

In Rollback Steps, you can see the App Rollback command.

There is nothing to set in this command. It is simply the command to rollback to the old version of the app in case of a deployment failure.

Deploy a PCF Basic Workflow

To deploy your PCF Basic Workflow, click Deploy.

Select the artifact for your new app and click Submit. The Workflow is deployed.

The App Setup command output shows your app was created successfully:

---------- Starting PCF App Setup Command

# Fetching all existing applications
# No Existing applications found

# Creating new Application
# Manifest File Content:
- name: ExampleForDoc__PCF__basic__Staging__0
memory: ((PCF_APP_MEMORY))
instances: 0
path: /home/ubuntu/harness-delegate/./repository/pcfartifacts/BY3yUoB7Q3ibJicbwmgn8Q/1573586245429SampleWebApp.war
random-route: true

# CF_HOME value: /home/ubuntu/harness-delegate/./repository/pcfartifacts/BY3yUoB7Q3ibJicbwmgn8Q
# Performing "login"
API endpoint:

Targeted org Harness
Targeted space AD00001863

API endpoint: (API version: 2.142.0)
Org: Harness
Space: AD00001863
# Login Successful
# Performing "cf push"
Pushing from manifest to org Harness / space AD00001863 as
Using manifest file /home/ubuntu/harness-delegate/./repository/pcfartifacts/BY3yUoB7Q3ibJicbwmgn8Q/ExampleForDoc__PCF__basic__Staging__0_1.yml
Getting app info...
Creating app with these attributes...
+ name: ExampleForDoc__PCF__basic__Staging__0
path: /home/ubuntu/harness-delegate/repository/pcfartifacts/BY3yUoB7Q3ibJicbwmgn8Q/1573586245429SampleWebApp.war
+ instances: 0
+ memory: 350M

Creating app ExampleForDoc__PCF__basic__Staging__0...
Mapping routes...
Comparing local files to remote cache...
Packaging files to upload...
Uploading files...
0 B / 4.70 KiB 0.00% 4.70 KiB / 4.70 KiB 100.00% 4.70 KiB / 4.70 KiB 100.00% 4.70 KiB / 4.70 KiB 100.00% 4.70 KiB / 4.70 KiB 100.00% 4.70 KiB / 4.70 KiB 100.00% 4.70 KiB / 4.70 KiB 100.00% 1s
Waiting for API to complete processing files...
There are no running instances of this process.

# Application created successfully
# App Details:
NAME: ExampleForDoc__PCF__basic__Staging__0

---------- PCF Setup process completed successfully
# Deleting any temporary files created

Next, the App Resize command shows the app instances upsized to the new instance count, in our example, 1.

---------- Starting PCF Resize Command
# Downsizing previous application version/s
# No Application is available for downsize
# Upsizing new application:
APPLICATION-NAME: ExampleForDoc__PCF__basic__Staging__0
# Application upsized successfully

# Application state details after upsize:
NAME: ExampleForDoc__PCF__basic__Staging__0

Instance Details:
Index: 0
Disk Usage: 0
CPU: 0.0
Memory Usage: 0
--------- PCF Resize completed successfully

You PCF Basic Workflow is complete.

PCF Versioning and Rollback

As you can see the app name is ExampleForDoc__PCF__basic__Staging__0, and it has a suffix __0. The suffix identifies the version of the app. The next time this app is deployed the suffix will increase to __1.

You cannot disable the versioning suffix because it is used to identify the version of the app and perform rollbacks to previous versions, if needed.

Next Steps

How did we do?