For the complete documentation index, see llms.txt. This page is also available as Markdown.

OpenShift Chaos Infrastructure

This topic describes OpenShift Chaos Infrastructure and its installation.

Harness CE supports the installation of OpenShift infrastructure to execute chaos experiments. Follow the steps below to install the OpenShift infrastructure.

Step 1: Create / identify target namespace and install the service accounts

Create or identify the target chaos namespace in which you will deploy the chaos infrastructure. You will use the hce namespace in this case.

kubectl create ns hce

You can create the service account in the cluster mode or the namespace mode.

To install in the cluster mode, create the service accounts using the cluster-mode-sa.yaml file. You can download the file and apply it.

To install in the namespace mode, create the service accounts using the namespace-mode-sa.yaml file. You can download the file and apply it.

If you have a different namespace, replace the namespace with <your-namespace> in the manifest.

kubectl create cluster-mode-sa.yaml -n  hce

Output

$> kubectl apply -f cluster-mdoe-sa.yaml -n hce
serviceaccount/litmus-admin created
serviceaccount/hce created
serviceaccount/argo-chaos created
serviceaccount/argo created
serviceaccount/litmus-cluster-scope created

Step 2: Create Litmus Security Context Constraint (SCC) and authenticate it with the service account

To create the litmus SCC,

  • Copy the contents of the litmus SCC manifest to litmus-scc.yaml file.

  • Apply this manifest to your chaos infrastructure.

Output

  • Authenticate all hce service accounts with litmus-scc:

  • Replace <CHAOS-NAMESPACE> with the namespace where litmus is installed. (Here litmus)

  • Replace <SERVICE-ACCOUNT-NAME> with the name of hce service accounts.

In this case, the exact command is:

Output

To learn more about SCC, go to SCC documentation.

Step 3: Get manifest to install chaos infrastructure

After connecting to a chaos infrastructure, select the installation mode (cluster scope or namespace scope).

configure-chaos-infra

Provide the namespace and the service account name. To use a service account other than hce, create a new service account and authenticate it with litmus-scc by following steps 1 and 2.

Step 4: Verify the installation

Verify if all the pods are in Running state (optional).

Ensure that the state of the chaos infrastructure is CONNECTED.

verify-chaos-infra-state

Step 5: Run chaos experiments

To run Kubernetes experiments, you need to tune the parameters associated with the fault. You can update or add the below mentioned environment variables while tuning the faults.

Last updated

Was this helpful?