2 - Services for PCF
The topic describes how to create a Harness Application with a PCF Service containing your artifact and PCF manifest.
In this topic:
- Add a PCF Service
- Artifact Sources
- Deployment Specification
- Configuration Variables and Files
- Next Step
Add a PCF Service
To add a PCF service, do the following:
- Ensure you have set up a PCF cloud provider connection in Harness, as described in Add Cloud Providers. This connection will log into the foundation.
- Ensure you have set up an artifact server connection in Harness, as described in Add Artifact Servers.
- Create a Harness application. The PCF service is managed within a Harness application, along with its environment, workflows, pipelines, etc. For more information, see Application Components.
- Click Setup, and then click Add Application. The Application dialog appears.
- Enter a name for your application, such as PCF_App, and click SUBMIT. The application is created.
- Click your application’s name. The application entities appear.
Next, add the PCF services to your application, including its artifact sources, container types, configuration variables, and files.
- Add the PCF service and artifact.
- In your application, click Services. On the Services page, click Add Service. The Service dialog appears.
- In Name, enter a name for your service. Typically, the name is the same as the micro-service or app you are going to deploy.
- In Artifact Type, select Pivotal Cloud Foundry. Once you select an artifact type, Harness will only present configuration options related to that type.
- Click SUBMIT. The new service is added.
- Next, add an artifact source for the service. Click Add Artifact Source, and select the artifact source.For a list of the PCF-supported artifact sources, see Artifact Sources below.
The artifact source for your Harness Service is taken from one of the Artifact Servers set up in Add Artifact Servers and is compatible with PCF.
For more information, see Service Types and Artifact Sources.
When you create the PCF service, the Deployment Specification section is created and a default PCF manifest file is added.
Manifests provide consistency and reproducibility, and help automate in deploying apps. For more information about the manifests file, see Deploying with Application Manifest from Pivotal.
The comments in the manifest file identify the required fields and their placeholders.
Here is an example manifest made from the placeholders at runtime:
- name: my-app
INSTANCES : 1
- route: example.com
Configuration Variables and Files
Configuration variables and files enable you to specify information in the service that can be referenced in other parts of the Harness application. For example, you can specify a variable in the service once, and then use it in multiple workflows without having to manage multiple values.
- Config Variables - You can create Service-level variables to use throughout your service configuration settings. Any Service variables are added as environment variables when the app is created in the Pivotal environment (cf push).
- Config Files - You can upload config files with variables to be used when deploying the Service. The secrets variable file is an example.
For details on configuration variables and files, see Configuration Variables and Files.
Secrets Variable File
A secrets.yml defines a format for mapping a variable to a location where a secret is stored.
You can add a secrets.yml variable file to your service and when the service is deployed, the secrets.yml file will be added to the cf push command.