Skip to main content

Install a Docker delegate

The Harness Delegate is a worker process you run in your deployment target environment, such as your local network, VPC, or cluster. The Delegate connects all of your artifact, infrastructure, collaboration, verification and other providers with the Harness Manager.

Most importantly, the Delegate performs all deployment operations.

There are several types of Delegates. This topic describes how to install the Docker Delegate.

Before you begin

Review: System Requirements

The Docker Delegate has the following system requirements:

  • Default 0.5 CPU.
  • Default 768MB RAM: there is a cap of 768MB per Delegate, but when the Delegate is updating there might be two Delegates running. Hence, the minimum is 1.5GB. Ensure that you provide the minimum memory for the Delegate and enough memory for the host/node system.

Step 1: Download the Docker Delegate

The Delegate can be installed at the Harness account, Organization, or Project level.

You can install a Delegate as part of setting up a Connector or independent of another process.

Once you have selected New Delegate on a Delegates page or as part of setting up a Connector, the Delegates selection page appears.

Click Docker and then click Continue.

Step 2: Name and Tag the Delegate

Enter a name for the Delegate. This is the name you will see when the Delegate is listed in Harness.

Do not run Delegates with the same name in different clusters. See Troubleshooting.Add Tags to the Delegate. By default, Harness adds a Tag using the name you enter, but you can more. Simply type them in and press Enter.

These Tags are useful for selecting the Delegate when creating a Connector.

Click Continue.

Step 3: Run the Docker Delegate Script

If you system already has a Delegate image, then Harness doesn't pull the latest image when you run docker-compose. Simply run docker pull harness/delegate to pull the latest.Now you can see the YAML file for the Delegate:

Click Download YAML file and copy the Docker compose file to a machine where you have Docker installed.

Run the following command to install the Delegate in Docker:

docker-compose -f docker-compose.yaml up -d

The Delegate installs. Type docker ps to see the container:

CONTAINER ID        IMAGE                     COMMAND                  CREATED             STATUS                          PORTS                    NAMES  
6b242707a57a harness/delegate:latest "/bin/sh -c './entry…" 3 days ago Up 32 seconds local-docker_harness-ng-del

Verification

For an overview of verification, see Delegate Registration and Verification.

In the Delegate wizard, click Verify and Harness will verify that it is receiving heartbeats from the Delegate.

Your Delegate is installed.

You can see the registered Delegate in the Delegate list.

![](./static/install-a-docker-delegate-03 Note the Connected status. If there is a connectivity error, you will see Not Connected. If there's an error, ensure the Docker host can connect to https://app.harness.io.

That's it. The Delegate is installed and registered and connected.

Harness Docker Delegate Environment Variables

The following table lists each of the environment variables in the Harness Docker Delegate YAML.

NameDescriptionExample
ACCOUNT_IDThe Harness account Id for the account where this Delegate will attempt to register.- ACCOUNT_ID=H5W8i2828282828Xg
DELEGATE_TOKENThe Harness account token used to register the Delegate.- DELEGATE_TOKEN=d229ee88bf7bbxxxx6ea
MANAGER_HOST_AND_PORTThe Harness SaaS manager URL. https indicates port 443.- MANAGER_HOST_AND_PORT=https://app.harness.io
WATCHER_STORAGE_URLThe URL for the Watcher versions. See Delegate Installation Overview.- WATCHER_STORAGE_URL=https://app.harness.io/public/prod/premium/watchers
WATCHER_CHECK_LOCATIONThe Delegate version location for the Watcher to check for.- name: WATCHER_CHECK_LOCATION value: current.version
REMOTE_WATCHER_URL_CDNThe CDN URL for Watcher builds.- name: REMOTE_WATCHER_URL_CDN value: https://app.harness.io/public/shared/watchers/builds
DELEGATE_STORAGE_URLThe URL where published Delegate jars are stored.- name: DELEGATE_STORAGE_URL value: https://app.harness.io
DELEGATE_CHECK_LOCATIONThe storage location hosting the published Delegate versions.- name: DELEGATE_CHECK_LOCATION value: delegateprod.txt
DEPLOY_MODEDeployment mode: Kubernetes, Docker, etc.- name: DEPLOY_MODE value: DOCKER
DELEGATE_NAMEThe name of the Delegate. This is the name that will appear in Harness when the Delegate is registered.You can automate Delegate creation by omitting the name, and then have a script copying the Delegate YAML file and add a unique name to value for each new Delegate you want to register.See Automate Delegate Installation.- name: DELEGATE_NAME value: qa
NEXT_GENIndicates that this Delegate will register in Harness NextGen(true) or FirstGen(false).- name: NEXT_GEN value: "true"
DELEGATE_DESCRIPTIONThe description added to the Delegate in the Harness Manager or YAML before registering.It appears in the Delegate details page in the Harness Manager.- name: DELEGATE_DESCRIPTION value: ""
DELEGATE_TYPEThe type of Delegate.- name: DELEGATE_TYPE value: "DOCKER"
DELEGATE_TAGSThe Tags added to the Delegate in the Harness Manager or YAML before registering.Tags are generated by Harness using the Delegate name but you can also add your own Tags.Tags appear in the Delegate details page in the Harness Manager.See Tags Reference and Select Delegates with Tags.- name: DELEGATE_TAGS value: ""
DELEGATE_TASK_LIMITThe maximum number of tasks the Delegate can perform at once.All of the operations performed by the Delegate are categorized as different types of tasks.- name: DELEGATE_TASK_LIMIT value: "50"
DELEGATE_ORG_IDENTIFIERThe Harness Organization Identifier where the Delegate will register.Delegates at the account-level do not have a value for this variable.- name: DELEGATE_ORG_IDENTIFIER value: "engg"
DELEGATE_PROJECT_IDENTIFIERThe Harness Project Identifier where the Delegate will register.Delegates at the account or Org-level do not have a value for this variable.-name: DELEGATE_PROJECT_IDENTIFIER value: "myproject"
PROXY_MANAGERIndicates whether to use the Harness Manager or a proxy. If you use true (the default) you are indicating that you proxy outbound traffic to Harness.- PROXY_MANAGER=true
INIT_SCRIPTYou can run scripts on the Delegate using INIT_SCRIPT.For example, if you wanted to install software on the Delegate pod, you can enter the script in INIT_SCRIPT and then apply the Delegate YAML.A multiline script must follow the YAML spec for literal scalar style.See Run Scripts on Delegates.- INIT_SCRIPT= echo hello world!
USE_CDNMakes the Delegate use a CDN for new versions.- name: USE_CDN value: "true"
CDN_URLThe CDN URL for Delegate versions.- name: CDN_URL value: https://app.harness.io
VERSION_CHECK_DISABLEDBy default, the Delegate always checks for new versions (via the Watcher).- name: VERSION_CHECK_DISABLED value: "false"

See also