> 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-ai/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**.

   ![](https://173309742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3F2TpHXhur2QtQnORSM9%2Fuploads%2Fgit-blob-60f28f5b64c6302994088ed4f4a17a12bf690505%2Fdiscovery.png?alt=media)
2. Click **New Discovery Agent**.

   ![](https://173309742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3F2TpHXhur2QtQnORSM9%2Fuploads%2Fgit-blob-63be9c0260b92e8d74ccc787ce3e6d6cc3b28096%2Fselect-agent.png?alt=media)
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](https://173309742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3F2TpHXhur2QtQnORSM9%2Fuploads%2Fgit-blob-31a740c81d4a2578f0b5773a8c99df41135ecc6b%2Fcreate-agent-1.png?alt=media)
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](https://173309742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3F2TpHXhur2QtQnORSM9%2Fuploads%2Fgit-blob-9da7cad471409e724a2043c6cde5782f3846ea0f%2Fexclusion-2.png?alt=media)
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](https://173309742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3F2TpHXhur2QtQnORSM9%2Fuploads%2Fgit-blob-ef33fc52bd3348ffeb5514d71a7e1da3e46286fa%2Fnode-selector-3.png?alt=media)
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](https://173309742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3F2TpHXhur2QtQnORSM9%2Fuploads%2Fgit-blob-5c78cc032a9a5be58c02d2f05bed640dd3e08ca8%2Fservice-acc-4.png?alt=media)
7. Click **Create New Discovery Agent** on the top right corner of the page.

   ![](https://173309742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3F2TpHXhur2QtQnORSM9%2Fuploads%2Fgit-blob-64b371edc459d4de8d179225aec20bea1739f299%2Fadd-details-discovery.png?alt=media)

#### 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.

   ![](https://173309742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3F2TpHXhur2QtQnORSM9%2Fuploads%2Fgit-blob-2bdfaa6289315c9ecda86304561ddd4c6062233f%2Fedit-dis-agent-1.png?alt=media)
2. Select **Update Discovery Agent**.

   ![](https://173309742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3F2TpHXhur2QtQnORSM9%2Fuploads%2Fgit-blob-8b18f4bda89b427605eaa401b06c27876bbc186c%2Fedit-details-discovery.png?alt=media)

#### 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**.

   ![](https://173309742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3F2TpHXhur2QtQnORSM9%2Fuploads%2Fgit-blob-637d87b8be7828abae4d8a8b59a3a54cf7f0cc9f%2Fdelete-1.png?alt=media)
2. Select **Delete**.

   ![](https://173309742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3F2TpHXhur2QtQnORSM9%2Fuploads%2Fgit-blob-cd8047ce182acff4ad8aa89af62014e07ce9c7ac%2Fconfirm-2.png?alt=media)

{% @harness-feedback/feedback module="harness-ai" pagePath="harness-ai/use-harness-platform/service-discovery/customize-agent" %}
