Skip to main content

Enable and disable infrastructure

This topic describes how you can enable and disable a Harness Delegate to use with chaos experiments.

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. Before creating an infrastructure, create an environment because a chaos infrastructure is created within an environment.

tip

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

Enable Chaos

On Windows

important

Ensure that you have fulfilled the prerequisites before connecting to a Windows chaos infrastructure.

  1. Go to Environments and click Windows. click Enable chaos.

  2. Add name (mandatory), and an admin user ("Administrator"). Select Next.

  3. Copy the command generated. The prerequisites discusses how you can configure a password. If you have a password, replace it in the <your-password> placeholder. Execute this command on your terminal (remember to open the command prompt as an admin if you are not an admin by default). Click Done once you finish the execution.

This displays the following updates about the installation on your terminal.

    Directory: C:\


Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 3/7/2024 7:48 AM HCE
Downloading Testlimit...
Extracting Testlimit...
Accepting Testlimit EULA...
Testlimit EULA accepted.
Downloading windows-chaos-infrastructure binary...
Config file created at C:\\HCE\config.yaml


Directory: C:\HCE\Logs


Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 3/7/2024 7:51 AM 0 windows-chaos-infrastructure.log
[SC] CreateService SUCCESS
Service created and started successfully.

Harness Terraform Provider

You can create Harness Delegate (DDCR) using Harness Terraform provider.

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.