To use secrets in a Delegate Profile, create encrypted text in Harness Secrets Management for the credentials, and then use variable names for those credentials in the Delegate Profile.
For Delegate Profiles, if you wanted to add a Helm repo that requires login credentials to every Kubernetes pod running a Harness Kubernetes Delegate, you can create encrypted text in Harness Secrets Management for those credentials, and then use variable names for those credentials in the Delegate Profile using the ${secrets.getValue("secret_name")} expression.
In Harness, select Continuous Security > Secrets Management. The Secrets Management page appears.
Under Execution Credentials, click Encrypted Text. The Encrypted Text page appears.
Click Add Encrypted Text. The Add Encrypted Text dialog appears.
In Name, enter repoUsername. This name will be used later in the Delegate Profile script to reference this secret.
In Value, enter any username. The dialog will look like this:
In Usage Scope, click Scope to Account. This will scope the secret to the Account-level. It can then be used in a Delegate Profile.
You must set Usage Scope to Scope to Account to use the secret in a Delegate Profile. Once it is set to Scope to Account, the secret can used in a Delegate Profile only.
Click Submit.
Add a second encrypted text with the name repoPassword, using any password. Be sure to set Usage Scope to Scope to Account, also. The dialog will look like this:
Click Submit. Now you can create a Delegate Profile and use these secrets.
Step 2: Manage Delegate Profiles
Click Setup.
Click Harness Delegates.
Click Manage Delegate Profiles, and then Add Delegate Profile.The Manage Delegate Profile dialog appears.
In Name, enter Helm Repo.
Step 3: Use Secret in Profile Script
In Startup Script, enter your Helm commands using the secrets you created:
The Manage Delegate Profile dialog will look like this:
Click Submit.
Now when you add this profile to a Kubernetes Delegate, it will add the Helm repo using the credentials you added as Encrypted Text in Harness Secrets Management.
A quick way to get the name of a secret is to hover over the secrets in Secrets Management and click the Copy icon: