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.
In this topic:
- Before You Begin
- Review: System Requirements
- Step 1: Download the Docker Delegate
- Step 2: Name and Tag the Delegate
- Step 3: Run the Docker Delegate Script
- Harness Docker Delegate Environment Variables
- See Also
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.
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.
Step 3: Run the Docker Delegate Script
docker-compose. Simply run
docker pull harness/delegateto 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
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.
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
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.
The Harness account Id for the account where this Delegate will attempt to register.
The Harness account token used to register the Delegate.
The Harness SaaS manager URL.
The URL for the Watcher versions.
The Delegate version location for the Watcher to check for.
- name: WATCHER_CHECK_LOCATION
The CDN URL for Watcher builds.
- name: REMOTE_WATCHER_URL_CDN
The URL where published Delegate jars are stored.
- name: DELEGATE_STORAGE_URL
The storage location hosting the published Delegate versions.
- name: DELEGATE_CHECK_LOCATION
Deployment mode: Kubernetes, Docker, etc.
- name: DEPLOY_MODE
The 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
- name: DELEGATE_NAME
Indicates that this Delegate will register in Harness NextGen.
If it set to
- name: NEXT_GEN
The 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
The type of Delegate.
- name: DELEGATE_TYPE
The 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.
- name: DELEGATE_TAGS
The 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
The 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
The 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
Indicates whether to use the Harness Manager or a proxy. If you use
You can run scripts on the Delegate using
For example, if you wanted to install software on the Delegate pod, you can enter the script in
A multiline script must follow the YAML spec for literal scalar style.
Makes the Delegate use a CDN for new versions.
- name: USE_CDN
The CDN URL for Delegate versions.
- name: CDN_URL
By default, the Delegate always checks for new versions (via the Watcher).
- name: VERSION_CHECK_DISABLED