Common Delegate Profile Scripts

Updated 4 days ago by Michael Cretzman

A Delegate Profile enables you to run a startup script on the host/container/pod for a Harness Delegate when the Delegate is installed, or apply the script to a running Delegate. You can create a single Delegate Profile and apply it to multiple Delegates.

This topic provides information on script availability and some common Delegate Profile scripts:

For information on using encrypted text or files in a Delegate Profile script, for usernames, passwords, etc, see Using Secrets in a Profile.

Profile Execution

It might take a couple of minutes for a Delegate Profile to be applied to a Delegate. Ensure that a timestamp appears next to the profile before deploying anything that depends on the profile script.

For example, in the following Delegate, a script using printenv is applied:

Once the script is run, a timestamp appears next to it. You can click the timestamp to view the output:

For extensive information on installing and running the Harness Delegate, see Delegate Installation and Management.


# Install TF
curl -O -L
mv ./terraform /usr/bin/
# Check TF install
terraform --version


Installing Helm and Tiller in the Delegate's cluster:

If you are using remote Helm charts in your Harness Kubernetes Service, you can use the helm init --client-only option as Tiller is not needed. See Helm charts for more information.
# Add the Helm version that you want to install
# v2.13.0
# v2.12.0
# v2.11.0


echo "Installing Helm $DESIRED_VERSION ..."

curl | bash

# If Tiller is already installed in the cluster
helm init --client-only

# If Tiller is not installed in the cluster
# helm init
DESIRED_VERSION is used by a function in the Helm install script.

If Helm is being installed in a cluster outside of the Delegate's cluster ensure that the kubeconfig in the Delegate cluster is pointing to the correct cluster using:

kubectl config current-context cluster_name
If you are using TLS for communication between Helm and Tiller, ensure that you use the --tls parameter with your commands. For more information, see Command Flags in Helm Deploy Step in the Helm Deployment guide, and see Using SSL Between Helm and Tiller from Helm, and the section Securing your Helm Installation in that document.

Here is an example of how to add a Helm chart from a private repo using secrets repoUsername and repoPassword from Harness Secrets Management.

# Other installation method
# curl >
# chmod 700
# ./

curl | bash

helm init --client-only

helm repo add --username ${secrets.getValue("repoUsername")} --password ${secrets.getValue("repoPassword")} nginx

helm repo update
For information on using encrypted text or files in a Delegate Profile script, for usernames, passwords, etc, see Using Secrets in a Profile.


# Install pip
apt-get -y install python-pip
# Check pip install
pip -v


# Install Unzip
apt-get install unzip


# Install AWS CLI
curl -L -O ""
./awscli-bundle/install -b ~/bin/aws
# Check AWS CLI install
/root/bin/aws --version


# Install Git with auto approval
yes | apt-get install git
# Check git install
git --version

Stop Shell Script Delegate

To stop a Shell Script Delegate, apply the following Delegate Profile:


To start the Delegate, you will need to SSH into the Delegate host and run:


How did we do?