> 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/resilience-testing/chaos-testing/infrastructure/kubernetes/network-config.md).

# Network configuration

Configure mTLS and Harness Network Proxy (HNP) for the chaos runner and Discovery Agent on Kubernetes chaos infrastructure.

This page covers the two network settings the chaos runner (DDCR) and the Discovery Agent expose on **Kubernetes chaos infrastructure**: **mTLS** for stronger client authentication on top of Harness token auth, and **proxy** (your own proxy or Harness Network Proxy) for outbound traffic from restricted clusters.

***

### Before you begin <a href="#before-you-begin" id="before-you-begin"></a>

* **Familiarity with Delegate mTLS.** Go to [Delegate mTLS support](/harness-ai/use-harness-platform/delegates/delegate/secure-delegates/delegate-mtls-support.md) for the platform-level concepts.
* **An installed Delegate (DDCR).** Go to [Set up Kubernetes infrastructure](/resilience-testing/chaos-testing/infrastructure/kubernetes.md) if you do not have one yet.
* **Cluster-side TLS material.** A client certificate and key, ideally stored in a Kubernetes secret on the cluster where the chaos runner executes.

***

### How traffic flows <a href="#how-traffic-flows" id="how-traffic-flows"></a>

The chaos runner authenticates to Harness with a token by default. The Discovery Agent runs in the same cluster and uses the same outbound path.

![Discovery Agent and Chaos Runner traffic flow](https://3217710372-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRmV5EkLS9r45VPaoUnJZ%2Fuploads%2Fgit-blob-cbeedf70641eebb47b4c9482611654dc7b7ed011%2Fagent-proxy.png?alt=media)

* Inbound connections to the runner always come **through the Delegate**.
* Outbound calls go straight to the Harness control plane if the cluster has connectivity.
* If the cluster cannot reach the control plane directly, route outbound traffic through your own proxy or through Harness Network Proxy (HNP). Each is configured the same way: set `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` on the Delegate and the Discovery Agent.

{% hint style="info" %}
HNP supports custom certificates, so you can pin TLS material to the proxy rather than spread it across every target cluster.
{% endhint %}

***

### Use mTLS with DDCR and the Discovery Agent <a href="#use-mtls-with-ddcr-and-the-discovery-agent" id="use-mtls-with-ddcr-and-the-discovery-agent"></a>

For both components, the configuration is the same: store the client cert and key in a Kubernetes secret in the cluster the component runs in, then point the component at that secret in the UI.

#### Configure mTLS on DDCR <a href="#configure-mtls-on-ddcr" id="configure-mtls-on-ddcr"></a>

1. Create a Kubernetes secret containing the client certificate and key on the target cluster.
2. Edit the Kubernetes chaos infrastructure and reference the secret in the mTLS fields.

   ![mTLS fields on the infrastructure](https://3217710372-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRmV5EkLS9r45VPaoUnJZ%2Fuploads%2Fgit-blob-a57dd28f13cddfcb4e64c17fc9a46ef9858f206c%2Fmtls-1.png?alt=media)

If you do not want to provision a secret in every target cluster, [install HNP](#install-harness-network-proxy-hnp) with the cert and key, then point the chaos runner at the HNP URL instead.

![Proxy URL on the chaos runner](https://3217710372-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRmV5EkLS9r45VPaoUnJZ%2Fuploads%2Fgit-blob-3ed74a0a8db46e5ef00822099dae1ec35d5d3329%2Fproxy-2.png?alt=media)

#### Configure mTLS on the Discovery Agent <a href="#configure-mtls-on-the-discovery-agent" id="configure-mtls-on-the-discovery-agent"></a>

Same pattern. Create the secret on the cluster the Discovery Agent runs in, then reference it in the discovery agent settings under **Resilience Testing → Project Settings → Discovery**.

![mTLS fields on the discovery agent](https://3217710372-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRmV5EkLS9r45VPaoUnJZ%2Fuploads%2Fgit-blob-a57dd28f13cddfcb4e64c17fc9a46ef9858f206c%2Fmtls-1.png?alt=media)

The HNP fallback applies here too.

![Proxy URL on the discovery agent](https://3217710372-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRmV5EkLS9r45VPaoUnJZ%2Fuploads%2Fgit-blob-3ed74a0a8db46e5ef00822099dae1ec35d5d3329%2Fproxy-2.png?alt=media)

***

### Configure proxy settings <a href="#configure-proxy-settings" id="configure-proxy-settings"></a>

If the cluster cannot reach the Harness control plane directly, the chaos runner and Discovery Agent can be put behind a proxy. Either use a proxy you already operate, or install [Harness Network Proxy (HNP)](#install-harness-network-proxy-hnp).

Both components understand the standard environment variables:

* `HTTP_PROXY`
* `HTTPS_PROXY`
* `NO_PROXY` (include the in-cluster `kubernetes` service IP in the `default` namespace so intra-cluster traffic bypasses the proxy)

You can also set `PROXY_URL` directly on the component, which has the same effect for Harness-portal communication.

#### Set the proxy on DDCR <a href="#set-the-proxy-on-ddcr" id="set-the-proxy-on-ddcr"></a>

1. Go to **Resilience Testing → Project Settings → Environments** and pick the environment that hosts the Delegate.

   ![Environments list](https://3217710372-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRmV5EkLS9r45VPaoUnJZ%2Fuploads%2Fgit-blob-64bb1291a366f8176b3951dcb96a9aa03d8af5e1%2Fproj-env.png?alt=media)
2. Open the Delegate, click the **⋮** menu, and select **Edit**.

   ![Edit the Delegate](https://3217710372-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRmV5EkLS9r45VPaoUnJZ%2Fuploads%2Fgit-blob-d142340e3dd324227b756aecdb5e7572e9e36669%2Fselect-edit.png?alt=media)
3. Set `HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY` (or `PROXY_URL`) and save.

   ![Proxy settings on the Delegate](https://3217710372-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRmV5EkLS9r45VPaoUnJZ%2Fuploads%2Fgit-blob-537b5b916643ffc0e24c026154e5d31f310dc07c%2Fproxy.png?alt=media)

   ![PROXY\_URL on the Delegate](https://3217710372-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRmV5EkLS9r45VPaoUnJZ%2Fuploads%2Fgit-blob-0c9abf024925be3a5974cdc122c195e691ef7396%2Fmtls.png?alt=media)

#### Set the proxy on the Discovery Agent <a href="#set-the-proxy-on-the-discovery-agent" id="set-the-proxy-on-the-discovery-agent"></a>

1. Go to **Resilience Testing → Project Settings → Discovery**.

   ![Discovery in Project Settings](https://3217710372-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRmV5EkLS9r45VPaoUnJZ%2Fuploads%2Fgit-blob-ee39d004a5984b3f2e544c5096d1a22044f439c7%2Fproj-set.png?alt=media)
2. Open the discovery agent and click **Edit**.

   ![Edit the discovery agent](https://3217710372-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRmV5EkLS9r45VPaoUnJZ%2Fuploads%2Fgit-blob-a42102bfb3de9cc27c065a0eb7666071c4549c38%2Fedit-discovery.png?alt=media)
3. Set the proxy environment variables (or `PROXY_URL`) and save.

   ![Proxy settings on the discovery agent](https://3217710372-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRmV5EkLS9r45VPaoUnJZ%2Fuploads%2Fgit-blob-537b5b916643ffc0e24c026154e5d31f310dc07c%2Fproxy.png?alt=media)

   ![PROXY\_URL on the discovery agent](https://3217710372-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRmV5EkLS9r45VPaoUnJZ%2Fuploads%2Fgit-blob-0c9abf024925be3a5974cdc122c195e691ef7396%2Fmtls.png?alt=media)

***

### Install Harness Network Proxy (HNP) <a href="#install-harness-network-proxy-hnp" id="install-harness-network-proxy-hnp"></a>

HNP is an in-cluster proxy that consolidates outbound calls from the chaos runner and Discovery Agent. It can be deployed with or without mTLS.

```bash
helm repo add harness-chaos https://harness.github.io/chaos-infra-helm-chart
helm upgrade --install chaos-agent-proxy harness-chaos/chaos-infra \
  -n hce -f override.yaml
```

#### Without mTLS <a href="#without-mtls" id="without-mtls"></a>

```yaml
tags:
  agentProxy: true
global:
  serverAddress: https://app.harness.io
```

#### With mTLS <a href="#with-mtls" id="with-mtls"></a>

Create the client certificate first. Go to [Enable mTLS on delegate](/harness-ai/use-harness-platform/delegates/delegate/secure-delegates/delegate-mtls-support.md#enable-mtls-on-delegate).

```yaml
tags:
  agentProxy: true
global:
  serverAddress: https://<customer-name>.agent.app.harness.io

agent-proxy:
  volumes:
    - name: client-certificate
      secret:
        secretName: client-certificate
  volumeMounts:
    - mountPath: /etc/mtls
      name: client-certificate
      readOnly: true
  env:
    - name: CLIENT_CERT_PATH
      value: /etc/mtls/client.crt
    - name: CLIENT_KEY_PATH
      value: /etc/mtls/client.key
```

Replace `<customer-name>` with the subdomain assigned to your Harness account.

***

### Next steps <a href="#next-steps" id="next-steps"></a>

* [Set up Kubernetes infrastructure](/resilience-testing/chaos-testing/infrastructure/kubernetes.md): install the Delegate-driven runner.
* [Cluster permissions](/resilience-testing/chaos-testing/infrastructure/kubernetes/permissions.md): review the Kubernetes RBAC the chaos service account needs.
* [Delegate mTLS support](/harness-ai/use-harness-platform/delegates/delegate/secure-delegates/delegate-mtls-support.md): platform-level mTLS reference.

{% @harness-feedback/feedback %}
