Use Custom Helm Binaries on Harness Delegates

Updated 1 month ago by Michael Cretzman

When you Install and run a new Harness Delegate, Harness includes Helm 3 support automatically.

But in some cases, you might want to use one of the custom Helm binaries available from Helm release. For example, a Helm chart you are using in your Harness deployment is incompatible with the version of Helm included in Harness by default.

Using a custom Helm binary with a Harness Delegate is as simple as adding the binary to the Delegate host(s), updating the Delegate config file with the path to the binary, and then starting or restarting the Delegate.

In this topic:

Before You Begin

Step 1: Create a Delegate Profile to Install the Custom Binary

To download and install the custom Helm binary onto a Harness Delegate, you can use a Delegate Profile.

A Delegate Profile is simply a script that you can apply to any new or existing Delegate.

  1. In Harness, click Setup, and then click Harness Delegates.
  2. Click Manage Delegate Profiles, and click Add Delegate Profile.
  3. In Display Name, give your custom binary Profile a name.
  4. In Startup Script, add the script to download and install the custom binary.

The Delegate Profile script should do the following:

  1. Download your desired Helm version.
  2. Unpack it.
  3. Move it to its desired destination on the Delegate host. This is the location you will add to the Delegate config file later.

Example Delegate Profile script:

curl -O https://get.helm.sh/helm-v3.2.3-linux-amd64.tar.gz
tar -xvf helm-v3.2.3-linux-amd64.tar.gz
path=`echo $PATH | awk -F':' '{ print $1}'`
echo $path
mv linux-amd64/helm $path

It will look something like this:

Next, you can add a Delegate Profile to a new or existing Delegate.

Step 2: Apply the Profile to a New or Existing Delegate

If you are adding a new Delegate, you select the profile when you download the Delegate.

If you apply the profile to an existing Delegate, you simply select the it in the Delegate's Profile setting:

Step 3: Update the Delegate Config File and Start the Delegate

Each type of Delegate uses a configuration file that you must update with the path to the custom binary installed by your Delegate Profile.

Here are the different types of Delegates and the configuration settings you must update:

Kubernetes

  1. Open the Kubernetes Delegate file harness-delegate.yaml. If the Delegate is already running, this must be the same file you used to create the Delegate on your cluster.
  2. In the StatefulSet settings, locate the Helm path settings:
...
- name: HELM3_PATH
value: ""
- name: HELM_PATH
value: ""
...
  1. For a Helm 3 binary, enter the path in HELM3_PATH.
  2. For a Helm 2 binary, enter the path in HELM_PATH.
  3. Apply and start (or restart) the Harness Delegate:
kubectl apply -f harness-delegate.yaml

You can also delete the Delegate pod and it will be recreated by the StatefulSet. For example, if you have the Delegate pod name mydelegate-vutpmk-0 then you would do the following:

kubectl delete pod mydelegate-vutpmk -n harness-delegate

For information about the Kubernetes Delegate, see Harness Kubernetes Quickstart.

ECS

  1. For a new ECS Delegate, open the ECS task spec ecs-task-spec.json you downloaded from Harness.
    If this is an existing ECS Delegate, open the task definition in the AWS console and create a new revision. You can edit the JSON for the task definition in the new revision. For more information, see Updating a Task Definition from AWS.
  2. In containerDefinitions, locate the Helm path settings:
...
{
"name": "HELM3_PATH",
"value": ""
},
{
"name": "HELM_PATH",
"value": ""
}
...
  1. For a Helm 3 binary, enter the path in HELM3_PATH.
  2. For a Helm 2 binary, enter the path in HELM_PATH.
  3. Register the task definition and create the ECS service as described in the Harness ECS Quickstart.
    If this is an existing ECS Delegate, update the ECS Delegate service by following the steps in Updating a Service from AWS.

Shell Script

  1. For the Shell Script Delegate, you must first run the Delegate (./start.sh) to create the config file, config-delegate.yml.
  2. Open config-delegate.yml in a text editor.
  3. For a Helm 2 binary, add helmPath.
  4. For a Helm 3 binary, add helm3Path.
  5. Next, enter the path to the binary. For example: helm3Path: /usr/local/bin/helm_3.
  6. Restart the Delegate with ./stop and then ./start.

For more information about the Shell Script Delegates, see any of the Harness AWS AMI Quickstart.

Helm

  1. Open the Helm Delegate values.yaml file you downloaded from Harness, harness-delegate-values.yaml. If the Delegate is already running, this must be the same file you used to create the Delegate on your cluster.
  2. For a Helm 3 binary, enter the path in helm3Path.
  3. For a Helm 2 binary, enter the path in helmPath.
  4. Install the Helm Delegate using the harness-delegate-values.yaml file:
helm install --name helm-delegate-doc harness/harness-delegate -f harness-delegate-values.yaml

For more information about the Helm Delegates, see Install the Harness Helm Delegate.

Docker

  1. Open the Docker Delegate values.yaml file you downloaded from Harness, launch-harness-delegate.sh. If the Delegate is already running, this must be the same file you used to create the Delegate on your cluster.
  2. For a Helm 3 binary, enter the path before the \ in -e HELM3_PATH= \.
  3. For a Helm 2 binary, enter the path before the \ in -e HELM_PATH= \.
  4. Start or restart the Docker Delegate:
./launch-harness-delegate.sh

See Also


How did we do?