Create a Basic PCF Deployment
A 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
- Step 2: App Setup
- Step 3: App Resize
- Step 4: App Rollback
- PCF Versioning and Rollback
- Next Steps
Before You Begin
Step 1: Set Up a PCF Basic Deployment
To set up a PCF Basic deployment, do the following:
- In your Harness Application, create your PCF Service, as described in Connect to Your Target PCF Account.
- Create your PCF Infrastructure Definition, as described in Define Your PCF Target Infrastructure.
- In your Harness Application, click Workflows.
- Click Add Workflow. The Workflow dialog appears.
- Name your Workflow, and then, in Workflow Type, select Basic Deployment.
- In Environment, select the Environment containing your target Infrastructure Definition.
- In Service, select the PCF Service you want to deploy.
- 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.
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
# CF_HOME value: /home/ubuntu/harness-delegate/./repository/pcfartifacts/BY3yUoB7Q3ibJicbwmgn8Q
# Performing "login"
API endpoint: api.run.pivotal.io
Targeted org Harness
Targeted space AD00001863
API endpoint: https://api.run.pivotal.io (API version: 2.142.0)
# Login Successful
# Performing "cf push"
Pushing from manifest to org Harness / space AD00001863 as email@example.com...
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
+ instances: 0
+ memory: 350M
Creating app ExampleForDoc__PCF__basic__Staging__0...
Comparing local files to remote cache...
Packaging files to upload...
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:
---------- 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 upsized successfully
# Application state details after upsize:
Disk Usage: 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.