Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dedicated infra section #9638

Merged
merged 4 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,87 +28,6 @@ If you want to delete your environment, remove the environment references, that
### Enable Chaos

<Tabs>

<TabItem value="Dedicated Kubernetes Chaos Infrastructure">

#### Using Dedicated Chaos Infrastructure

You can enable chaos **on existing infrastructure** that uses a Harness cluster connector (also known as Harness Kubernetes connector) or **on new infrastructure**.

:::tip
You can choose between Kubernetes and Kubernetes (Harness infrastructure). The former is a dedicated infrastructure whereas the latter uses Harness Delegate.
:::

To enable chaos on an existing Harness Kubernetes connector:

1. Go to **Chaos > Environments**, and then select the environment you want to add chaos infrastructure to.

1. On the environment details page, select **+ Enable Chaos**.

1. On the next screen, select where to add chaos infrastructure, and then select **Continue**.

<Tabs>
<TabItem value="On Existing Infrastructure">

1. If you selected **On Existing Infrastructures**, on the next screen, select any connector under the **Project**, **Organization**, or **Account** scope. Select **Continue**.

![Chaos Infrastructure in Existing Infra](./static/enable-disable/chaos-infrastructure-in-existing-infra.png)

:::info note
A Harness Kubernetes connector with:
* **Cluster-wide read/write access** can be used to set up chaos infrastructure in cluster scope and namespace scope.
* **Specific namespace access** can be used to set up a chaos infrastructure in that specific Kubernetes namespace scope only.
* **Cluster-wide read access** cannot be used to set up a chaos infrastructure.
:::

2. The **Configure Chaos Infrastructure** screen appears. Select the installation type, access type, namespace, and service account name. Select **Next**.

Under **Choose Access Type**, choose one of the following modes.

* **Cluster Wide:** This mode of infrastructure installation allows targeting resources across the entire cluster, in all the namespaces, as part of an experiment.
* **Namespace Mode:** This mode of infrastructure installation allows targeting resources only in the namespace where the chaos infrastructure is deployed.

By default, chaos is installed in the `hce` namespace and uses `hce` service account, which you can configure under the K8s cluster details.

Optionally, you can specify the node selectors and Kubernetes toleration for chaos infrastructure deployment.

:::tip
- There can only be one cluster-wide chaos infrastructure per cluster.
- There may be multiple namespace-scoped chaos infrastructures per cluster.
:::

![Configure Chaos Infrastructure](./static/enable-disable/existing-2.png)

3. The **Deploying your Infrastructure** screen appears. If you're deploying **on existing infrastructure**, select **Done**. This is your final step. Harness installs the chaos infrastructure on your behalf.

</TabItem>
<TabItem value="On New Infrastructure">

1. If you're deploying on **new infrastructure**, provide a name for the new infrastructure, a **Description** (optional) and a **Tag** (optional). Select **Next**.

2. On the **Configure Chaos Infrastructure** screen, provide details like the installation type, access type, namespace, and service account name. Select **Next**.

3. Copy the given command(s), download the installation manifest YAML and run it on the terminal, based on cluster-wide or namespace access.

* **For cluster-wide access:**

1. Select **Download**, and then copy and run the `kubectl` command shown on your screen to install the chaos infrastructure. Select **Done**.

![Cluster Wide Setup Infrastructure](./static/enable-disable/cluster-wide-setup-infrastructure.png)

* **For namespace access:**

1. Run the first `kubectl` command to create the target namespace.
1. Run the second `kubectl` command to apply the chaos CRDs.
1. Select **Download**, and then copy and run the third command to install the chaos infrastructure. Select **Done**.

![Namespace Mode Setup Infrastructure](./static/enable-disable/ns-mode-setup-infrastructure.png)

</TabItem>
</Tabs>

</TabItem>

<TabItem value="Linux">

#### On Linux infrastructure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,25 +337,7 @@ You can install an infrastructure as a part of creating an experiment. This infr
:::


HCE facilitates installing two types of chaos infrastructure:
Harness CE facilitates installing two types of chaos infrastructure:
- [DDCR](#what-is-ddcr) (Delegate Driven Chaos Runner) aka **Harness Delegate**; and
- [Harness Chaos infrastructure](#what-is-harness-chaos-infrastructure) that uses a dedicated infrastructure (aka Legacy Kubernetes Infrastructure).

## What is Harness Chaos Infrastructure?

Harness Chaos Infrastructure (also known as Legacy Kubernetes Infrastructure) uses a dedicated infrastructure to facilitate and execute chaos experiments.

:::tip
Unless specified, chaos infrastructure refers to the dedicated chaos infrastructure (or legacy chaos infrastructure), and **NOT** DDCR.
:::

### Chaos infrastructure requirements

The table below lists the chaos infrastructure execution plane components and the required resources for Legacy Kubernetes Infrastructure. You can install these components in your target cluster, allowing the chaos infrastructure to run experiments here. Chaos infrastructure runs within your target environment to aid HCE in accessing the target resources and injecting chaos at a cloud-native scale.

| Deployment | Container | CPU<br />required | Memory<br />required | Image |
|------------|-----------|-------------------|----------------------|-------|
| chaos-operator-ce | chaos-operator-ce | 125m | 300M | chaosnative/chaos-operator |
| chaos-exporter | chaos-exporter | 125m | 300M | chaosnative/chaos-exporter |
| subscriber | subscriber | 125m | 300M | chaosnative/harness-chaos-subscriber|
| workflow-controller| workflow-controller | 125m | 300M | chaosnative/workflow-controller |
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
---
title: Dedicated Chaos Infrastructure
sidebar_position: 1
redirect_from:
- /docs/category/harness-dedicated-infrastructure
- /docs/chaos-engineering/onboarding/harness-infra
- /docs/chaos-engineering/features/chaos-infrastructure/harness-infra/
- /docs/chaos-engineering/get-started/prerequisites/#chaos-infrastructure-requirements
---

This topic describes the following:
- [What is Dedicated Chaos Infrastructure?](/docs/chaos-engineering/use-harness-ce/infrastructures/types/legacy-infra#what-is-harness-chaos-infrastructure)
- [Resource Requirements](/docs/chaos-engineering/use-harness-ce/infrastructures/types/legacy-infra#chaos-infrastructure-requirements)
- [Installation steps](/docs/chaos-engineering/use-harness-ce/infrastructures/types/legacy-infra#install-dedicated-chaos-infrastructure)
- [Validate the installation](/docs/chaos-engineering/use-harness-ce/infrastructures/types/legacy-infra#validate-installation)
- [Disable the infrastructure](/docs/chaos-engineering/use-harness-ce/infrastructures/types/legacy-infra#disable-infrastructure)

## What is Harness Chaos Infrastructure?

Harness Chaos Infrastructure (also known as Legacy Kubernetes Infrastructure) uses a dedicated infrastructure to facilitate and execute chaos experiments.

:::tip
Unless specified, chaos infrastructure refers to the dedicated chaos infrastructure (or legacy chaos infrastructure), and **NOT** DDCR.
:::

## Chaos infrastructure requirements

The table below lists the chaos infrastructure execution plane components and the required resources for Legacy Kubernetes Infrastructure. You can install these components in your target cluster, allowing the chaos infrastructure to run experiments here. Chaos infrastructure runs within your target environment to aid HCE in accessing the target resources and injecting chaos at a cloud-native scale.

<table>
<thead>
<tr>
<th>Deployment</th>
<th>Container</th>
<th>CPU<br />Required</th>
<th>Memory<br />Required</th>
<th>Image</th>
</tr>
</thead>
<tbody>
<tr>
<td>chaos-operator-ce</td>
<td>chaos-operator-ce</td>
<td>125m</td>
<td>300M</td>
<td>docker.io/harness/chaos-operator</td>
</tr>
<tr>
<td>chaos-exporter</td>
<td>chaos-exporter</td>
<td>125m</td>
<td>300M</td>
<td>docker.io/harness/chaos-exporter</td>
</tr>
<tr>
<td>subscriber</td>
<td>subscriber</td>
<td>125m</td>
<td>300M</td>
<td>docker.io/harness/chaos-subscriber</td>
</tr>
<tr>
<td>workflow-controller</td>
<td>workflow-controller</td>
<td>125m</td>
<td>300M</td>
<td>docker.io/harness/chaos-workflow-controller</td>
</tr>
</tbody>
</table>



## Install Dedicated Chaos Infrastructure

You can enable chaos **on existing infrastructure** that uses a Harness cluster connector (also known as Harness Kubernetes connector) or **on new infrastructure**.

:::tip
You can choose between Kubernetes and Kubernetes (Harness infrastructure). The former refers to a dedicated infrastructure whereas the latter refers to Harness Delegate.
:::

### On Existing Infrastructure
To enable chaos on an existing Harness Kubernetes connector:

1. Go to **Chaos > Environments**, and then select the environment you want to add chaos infrastructure to.

1. On the environment details page, select **+ Enable Chaos**.

1. On the next screen, select where to add chaos infrastructure, and then select **Continue**.

4. If you selected **On Existing Infrastructures**, on the next screen, select any connector under the **Project**, **Organization**, or **Account** scope. Select **Continue**.

![Chaos Infrastructure in Existing Infra](./static/chaos-infrastructure-in-existing-infra.png)

:::info note
A Harness Kubernetes connector with:
* **Cluster-wide read/write access** can be used to set up chaos infrastructure in cluster scope and namespace scope.
* **Specific namespace access** can be used to set up a chaos infrastructure in that specific Kubernetes namespace scope only.
* **Cluster-wide read access** cannot be used to set up a chaos infrastructure.
:::

5. The **Configure Chaos Infrastructure** screen appears. Select the installation type, access type, namespace, and service account name. Select **Next**.

Under **Choose Access Type**, choose one of the following modes.

* **Cluster Wide:** This mode of infrastructure installation allows targeting resources across the entire cluster, in all the namespaces, as part of an experiment.
* **Namespace Mode:** This mode of infrastructure installation allows targeting resources only in the namespace where the chaos infrastructure is deployed.

By default, chaos is installed in the `hce` namespace and uses `hce` service account, which you can configure under the K8s cluster details.

Optionally, you can specify the node selectors and Kubernetes toleration for chaos infrastructure deployment.

:::tip
- There can only be one cluster-wide chaos infrastructure per cluster.
- There may be multiple namespace-scoped chaos infrastructures per cluster.
:::

![Configure Chaos Infrastructure](./static/existing-2.png)

6. The **Deploying your Infrastructure** screen appears. If you're deploying **on existing infrastructure**, select **Done**. This is your final step. Harness installs the chaos infrastructure on your behalf.


### On New Infrastructure

1. If you're deploying on **new infrastructure**, provide a name for the new infrastructure, a **Description** (optional) and a **Tag** (optional). Select **Next**.

2. On the **Configure Chaos Infrastructure** screen, provide details like the installation type, access type, namespace, and service account name. Select **Next**.

3. Copy the given command(s), download the installation manifest YAML and run it on the terminal, based on cluster-wide or namespace access.

* **For cluster-wide access:**

1. Select **Download**, and then copy and run the `kubectl` command shown on your screen to install the chaos infrastructure. Select **Done**.

![Cluster Wide Setup Infrastructure](./static/cluster-wide-setup-infrastructure.png)

* **For namespace access:**

1. Run the first `kubectl` command to create the target namespace.
1. Run the second `kubectl` command to apply the chaos CRDs.
1. Select **Download**, and then copy and run the third command to install the chaos infrastructure. Select **Done**.

![Namespace Mode Setup Infrastructure](./static/ns-mode-setup-infrastructure.png)


## Validate Installation

After adding chaos infrastructure, Harness takes some time to set up all the chaos infrastructure resources. On the UI, if you navigate to **Environments** -> **Kubernetes**, you can see the connection status is `CONNECTED`.

![](./static/confirm-3.png)

That's it! Now you have a dedicated chaos infrastructure and you're all set to inject chaos into your infrastructure.

## Disable Infrastructure

1. Select the `⋮` icon against the chaos infrastructure name and select **Disable**.

![Delete Chaos Infra](./static/delete-chaos-infra-short.png)

2. Execute the commands displayed in the modal from your terminal to remove the chaos infrastructure components. Finally, select **Confirm**.

## Next Steps

- [Delegate-Driven Chaos Infrastructure](/docs/chaos-engineering/use-harness-ce/infrastructures/types/ddcr/)
- [Dedicated versus Delegate Driven Infrastructure](/docs/chaos-engineering/use-harness-ce/infrastructures/ddcr-vs-dedicated)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This topic describes different types of infrastructure, that can be used to exec
Based on the target environments, you can install chaos infrastructure as a Kubernetes service, a Linux daemon or a Windows agent.

There are different types of chaos infrastructure such as:
- Legacy Infrastructure
- [Legacy Infrastructure](/docs/chaos-engineering/use-harness-ce/infrastructures/types/legacy-infra)
- OpenShift
- [Delegate-Driven Chaos Infrastructure](/docs/chaos-engineering/use-harness-ce/infrastructures/types/ddcr/)
- Linux
Expand Down