Add a Tanzu Application Service (TAS) connector
Connect Harness to your Tanzu Application Service (TAS) accounts and spaces.
Use a Harness Tanzu Application Service (TAS) connector to connect Harness to your TAS environment. Use the TAS connector to deploy applications to your Tanzu cloud from Harness pipelines.
What you will learn from this topic
How to install the Cloud Foundry Command Line Interface (cf CLI) on your Harness Delegate.
How to create a TAS connector using the Harness Manager.
How to define a TAS connector using a YAML example.
How Harness supports refresh token authentication and custom configuration for extensible authentication with TAS.
Before you begin
Harness Delegate: A running Harness Delegate that can reach your TAS environment. Go to Delegate installation overview to install one. Connect through a Harness Delegate rather than the Harness Platform, because you need a delegate later to deploy to your TAS environment.
TAS Endpoint URL: The API endpoint of your TAS environment, for example
https://api.system.tas-mycompany.com.TAS credentials: A TAS username and password, stored as a Harness secret.
Install the Cloud Foundry Command Line Interface (cf CLI) on your Harness Delegate
After your delegate pods are created, edit your Harness Delegate YAML to install cf CLI v7, the autoscaler plugin, and the Create-Service-Push plugin. Harness uses these on the delegate to run Tanzu deployment steps in your pipelines.
Open
delegate.yamlin a text editor.Locate the
INIT_SCRIPTenvironment variable in theDeploymentobject.Replace
value: ""with the installation script for your delegate's operating system.
Use microdnf commands to install cf CLI on delegates running Red Hat-based distributions such as RHEL or Red Hat UBI.
Use apt-get commands to install cf CLI on delegates running Debian-based distributions such as Ubuntu.
Apply the script to the delegate and check the logs.
The output for
cf --versioniscf version 7.2.0+be4a5ce2b.2020-12-10. The output forcf pluginslists the installed plugins, includingApp AutoscalerandCreate-Service-Push.
Create a TAS connector
Perform the following steps to create the TAS connector using the Harness Manager.
Open a Harness project, and select Connectors under Project Setup. You can also create connectors at the account or organization levels.
Select New Connector, and then select Tanzu Application Service under Cloud Providers.
Overview
Enter a Name for the connector. Description and Tags are optional. Harness automatically creates an Id (entity identifier) for the connector based on the Name. Select Continue to proceed to Credentials.

Credentials
Select Continue after entering the following details:
Endpoint URL: Enter the TAS API endpoint URL, for example
https://api.system.tas-mycompany.com.Authentication: Select one of the following options for the username and password:
Plaintext: Enter the username, and select Create or Select a Secret to add the password.
Encrypted: Create or select a secret for both the username and the password.
Refresh Token (optional): Create or select a secret for the refresh token used to authenticate with TAS. Go to Refresh token support for details.

Select Connectivity Mode
Under Connect to the provider, select how you want Harness to connect to TAS, and then select Save and Continue:
Connect through Harness Platform: Harness communicates with TAS securely through the Harness Platform. Credentials are encrypted and stored in the Secret Manager configured in Harness.
Connect through a Harness Delegate: Harness communicates with TAS through a Harness Delegate installed in your environment. Select this option if TAS is behind a corporate firewall.

Delegates Setup
This step appears only if you selected Connect through a Harness Delegate. Select one of the following options, and then select Save and Continue:
Use any available Delegate.
Only use Delegates with all of the following tags: Enter the tag of the delegate you installed.

Connection Test
Harness validates the TAS connector authentication and permissions. Once verification succeeds, select Finish.

The connector now appears in the Connectors list.
YAML example
The following YAML defines a TAS connector that authenticates using a username and password, and connects through a Harness Delegate.
Refresh token support
Harness provides the option to use a refresh token to authenticate with the Tanzu connector. Harness uses this refresh token to verify your Tanzu instance. You still need to provide a username and password to authenticate with Tanzu. Harness uses these credentials to obtain a new refresh token. Once you provide the refresh token in the connector, Harness uses it to authenticate and perform each task. Harness authenticates with the refresh token before executing each Tanzu step defined in the pipeline.
You can retrieve the refresh token from the config.json file you receive when authenticating with the CF client. You can pass the refresh token as a secret stored in the Harness Secrets Manager or your secrets manager of choice.
To generate the refresh token using a client ID and client secret instead, go to Custom configuration for extensible authentication.
Custom configuration for extensible authentication
For Harness Delegate version 23.12.81811 and later, you can create a Tanzu connector by setting the ENABLE_TAS_REFRESH_TOKEN_CLIENT_ID, TAS_REFRESH_TOKEN_CLIENT_ID, and TAS_REFRESH_TOKEN_CLIENT_SECRET parameters, and providing the refresh token. The connector generates a refresh token using the client ID and secret ID environment variables.
ENABLE_TAS_REFRESH_TOKEN_CLIENT_ID: The setting to configure the alternative authentication mode on the Harness Delegate for Tanzu.TAS_REFRESH_TOKEN_CLIENT_ID: The client ID parameter for Tanzu authentication.TAS_REFRESH_TOKEN_CLIENT_SECRET: The client secret parameter for Tanzu authentication.
To configure the delegate YAML, do the following:
Go to the Kubernetes delegate YAML (deployment) or the actual deployed resource.
Under
spec.template.spec.containers.env, add the following environment variables.
Next steps
Delegate installation overview: Install and configure a Harness Delegate for your TAS connector.
Delegate troubleshooting: Resolve common delegate installation and connectivity issues.
Last updated
Was this helpful?