> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/harness-platform/use-harness-platform/service-discovery/customize-agent.md).

# Customize Discovery Agent

This topic describes how to create a discovery agent and configure it to discover services, edit it, and delete it.

#### Create Discovery Agent <a href="#create-discovery-agent" id="create-discovery-agent"></a>

1. Navigate to **Project Settings** and select **Discovery**.

   ![](/files/CXtOMcbxsS2VaeAxjtkJ)
2. Click **New Discovery Agent**.

   ![](/files/7RwakcdWbcvkZC575REO)
3. Specify the following variables:
   * **Environment** (this is created earlier, and is the place where you install infrastructure)
   * **Infrastructure** (this is created earlier, where your target cluster is housed).
   * Specify **Discovery Agent Name**.
   * For the **Namespace**, provide the dedicated namespace you created in your target cluster for Harness. This is the namespace where Harness runs chaos runners, discovers services and executes chaos experiments.

     ![create agent](/files/GrCPPPR7LFdFXkd6xyTy)
4. Select one of the following based on your requirement.
   * **Namespace Selector**: Selects one or more namespaces based on [level selector](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/).
   * **Exclusion**: Select this option to avoid Harness from discovering certain namespaces. Provide the name of the namespaces to be excluded.
   * **Inclusion**: Select this option to allow Harness to discover specific namespaces. Provide the name of the namespaces to be included.

     ![exclusion settings](/files/dBJJtjZ2QFfJquRuRYRs)
5. If your cluster control plane node has a taint, **Add Node Selector** so that Harness launches its pod only on the worker nodes.

   ![node selector](/files/kWCWsS3I25IQSByEegoC)
6. Populate the **Use this Service Account** field with the Service Account name that you created in the dedicated namespace in your target cluster for Harness.

   ![service account](/files/OlQFqms9DpsQ2EgOMP29)
7. Click **Create New Discovery Agent** on the top right corner of the page.

   ![](/files/o7PryENFfF0m5YGaqFMD)

#### Edit Discovery Agent <a href="#edit-discovery-agent" id="edit-discovery-agent"></a>

1. To edit a discovery agent, navigate to the agent (that you created earlier) and click **Edit**. Make the necessary changes to the required fields.

   ![](/files/RIXILbmNKy3LcXqfIaAp)
2. Select **Update Discovery Agent**.

   ![](/files/8RVVqkCjPc9SPznYCasF)

#### Delete Discovery Agent <a href="#delete-discovery-agent" id="delete-discovery-agent"></a>

1. To delete a discovery agent, navigate to the agent you want to delete and select **Delete**.

   ![](/files/Mc5ljdoYrQMzt5Kii0GC)
2. Select **Delete**.

   ![](/files/ZlhCeOCLLEWHmEcEqQ7g)
