Skip to main content

Enable and disable infrastructure

This topic describes how you can enable and disable a chaos infrastructure.

Before you begin, review the following

Install Infrastructure

You can install chaos infrastructure as a Kubernetes service, as a Linux daemon, or as a Windows agent, based on the targets. A chaos infrastructure is created within an environment.

Create Environment

  1. In your Harness project, navigate to Chaos > Environments. Select + New Environment. In the Create a new environment screen, specify a Name for the environment, and optionally a Description and a Tag. For Environment type, choose either Production or Non-Production, and then click Create.

tip

If you want to delete your environment, remove the environment references, that is, the infrastructure(s) associated with it first.

Enable Chaos

Using DDCR

  1. Select the Environment you created, and choose the Infrastructure type. In this example, you can select Kubernetes and click + New Infrastructure.

  2. To use Harness Delegate, select Yes. To use a dedicated chaos infrastructure, select No. In this example, select Yes, and click Next.

  3. Provide a Name, Deployment Type, Select Infrastructure Type, and provide Cluster Details, such as Connector, and Namespace. To create a new connector, go to Create Kubernetes Connector. While creating a Kubernetes connetor, select or create a new Delegate. Go to Create new Delegate. Once your Delegate shows up in the list, enter its name in the search bar, and select Save and Continue. This will test your connection and describe if it was a success or no. Contact Harness Support if you encounter issues with the verification.

tip
  • Ensure your Delegate version is 24.09.83900 or above to support executing chaos experiments using DDCR.
  • Currently, DDCR (or Harness Delegate) can only be installed to execute Kubernetes-based faults. This means you can only create Kubernetes connectors.
  • To execute faults on Linux and Windows, install Linux and Windows agents respectively.
  • To configure mTLS with DDCR and Discovery Agent, go to mTLS Support.
  • To configure mTLS with DDCR and and Discovery Agent proxy settings, go to proxy Support.

Validate Chaos Infrastructure 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 -> Windows (or Kubernetes or Linux), you can see the connection status is CONNECTED.

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

Disable Chaos Infrastructure

Disabling a chaos infrastructure removes it from the environment where it resides. It also removes the infrastructure services from the Kubernetes cluster.

Go to the Environments under the Chaos tab, that lists all the environments created under the current project. Select the environment that has the chaos infrastructure to be deleted.

Based on the infrastructure you have used, you can follow the steps to disconnect Kubernetes, Linux, and Windows infrastructure, respectively.

select to disconnect

Kubernetes

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

    Delete Chaos Infra

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

With that, the chaos infrastructure will be disabled.