Install Harness delegates on Azure
A delegate is a Harness service that performs the tasks of a pipeline. Delegates run on your local network and work in parallel with Harness Manager. The creation of a delegate requires infrastructure that supports computational tasks. This is typically a Kubernetes cluster.
This tutorial explains how to create a Kubernetes cluster on a free Microsoft Azure account. The cluster you create is the foundation of your CI/CD pipeline infrastructure. After you prepare the infrastructure, you can install a delegate.
For additional information about delegates, see Delegate overview.
To complete this tutorial, you'll need the following cluster resources and permissions.
For information about access and permissions, see Permissions.
For information about delegate memory requirements, see Compute Resources.
To sign up for a free Azure account, go to https://azure.microsoft.com/en-in/free/.
To sign up for a student account, go to https://azure.microsoft.com/en-in/free/students/.
Create a cluster
The cluster you'll create has the following requirements:
- Number of nodes: A minimum of 3 nodes.
- Machine type: 4vCPU
- Memory: 12GB RAM and 6GB disk space. The delegate requires 8GB RAM. The remaining memory supports Kubernetes and containers.
- Networking: Outbound HTTPS for the Harness connection, and to connect to any container image repository. Allow TCP port 22 for SSH.
To create your cluster, follow the steps in the Azure Kubernetes Service (AKS) documentation.
Modify the delegate YAML file
For purposes of this tutorial, modify the harness-delegate.yaml file to create one replica pod.
Open a terminal window and navigate to the folder that contains the delegate file.
Open the YAML file in your editor. Locate and set the
replicasfield to 1.
Save the YAML file.
Authenticate to the cluster
Use terminal to connect and login to your cluster:
From terminal, connect to your cluster.
Login to your Kubernetes cluster.
Most cloud platforms provide a cluster access command. To copy this command, select your cluster and click
Install the delegate
kubectl apply command to add the delegate to your cluster:
To install the delegate, apply the harness-delegate.yaml file. In the terminal that is connected to your cluster, run:
kubectl apply -f harness-delegate.yaml
The successful output is something like this:
In Harness, click Verify. The verification process takes a few minutes. After the installation is verified, close the wizard.
Connect your delegate to your cluster
Enable a connection from your delegate to your cluster:
Return to Set Up Delegates, and select the delegate you created. The list of delegates should include your delegate and its tags.
Select Connect using Delegates and choose the Tags option.
Add a descriptive tag for the delegate, and then click Save and Continue.
The connector is tested.
Confirm that the delegate pod is up and running
Use the following command to confirm that the delegate pod is running in your Kubernetes cluster:
kubectl get pods -n harness-delegate-ng
kubectl utility to add resources to your cluster. For a tutorial on creating a CI/CD pipeline, see Start Deploying in 5 Minutes with a Delegate-first Approach.