Centralized Delegate
Configure Centralized Delegate
This topic describes the permissions required to execute chaos experiments when the target application and Delegate are running on different clusters.
Prerequisites
The Delegate must be installed within your centralized infrastructure.
Ensure network connectivity between the centralized infrastructure and the target cluster infrastructure where chaos experiments will be executed.
The diagram below describes how the Harness environment and your (user) environment communicate with the help of Harness Delegate to execute chaos experiments.

Permissions to manage Delegate resources
Step 1: Create Service Account and RBAC
When the target application and Delegate are running on different clusters, create a service account with the given permission in the target cluster to provide permissions for Harness chaos transient pods in a dedicated namespace. Harness recommends you keep the delegate, chaos infrastructure and delegate namespace as same.
While using Harness Delegate, transient pods are created. Delegate manages the resources, that require specific permissions in the dedicated namespace.
Generate Service Account Token
Use the following kubectl command to get a SA bound token:
Here, chaos-sa-secret is the actual name of the token secret and harness-delegate-chaos is the namespace of the token secret, so change it accordingly.
Step 2. Create Kubernetes Connector
A connector describes how the Delegate communicates with the target cluster. Create a Kubernetes cluster connector using service account based authentication where the service account token is base64 decoded. You would have obtained the token in the previous step. Obtain the master URL by executing the command kubectl cluster-info and get the service account token and secret from the Kubernetes secret.

Step 3. Create Cluster Role
Create a cluster role and provide cluster-wide access or cluster role binding for selected namespaces using role binding, depending on your usage. You can use this configuration to onboard application namespaces. To discover the resources and run chaos, use the permissions (described below) in each namespace.
Step 4: Onboard Namespaces
You can onboard all namespaces or specific namespaces (one or more) to inject chaos.
Access All Namespaces
You can provide access to all the namespaces by creating a role binding in the application namespace.
Access Specific Namespace
To onboard a namespace, create a RoleBinding in the application namespace (for example, app1, app2, and so on.)
Step 5. Create Harness Infrastructure Definition
Create Harness infrastructure definition using the same Kubernetes cluster connector that was created in Step 2.


Step 6. Edit Infrastructure
Follow this step only after enabling chaos on the infrastructure. Edit the infrastructure you created in step 5 to provide the details of the dedicated namespace that was created. This is the namespace where the chaos runner is launched along with the Service Account to ensure that experiments are executed with relevant permissions.

Last updated
Was this helpful?