Skip to content
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
2 changes: 1 addition & 1 deletion website/docs/litmus-uninstallation.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ helm uninstall litmuschaos --namespace litmus
kubectl delete ns litmus
```

----
----

### **Uninstallation of Litmus Control Plane using kubectl**

Expand Down
196 changes: 196 additions & 0 deletions website/versioned_docs/version-2.0.0-Beta-8/agent-installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
---
id: agent-install
title: Litmus Chaos Agent Install
sidebar_label: Chaos Agent
---

In Litmus the Agents can be classified as two types

- Self Agent
- External Agent

As part of Litmus installation by default, a self cluster would be registered as Agent in the Portal. From Portal you induce chaos into self cluster and observe the results from the Portal.

As you are aware by now, Portal is a Cross Cloud Chaos Control plane. That is you can connect multiple external kubernetes agents to this portal. Once connected you can manage the chaos from the Portal that is you can induce chaos into this agent from the Portal and observe the results from the Portal. Using the command line utility _litmusctl_ you can connect the external agents to the Portal.

# Litmusctl

Litmusctl is a command line interface to manage LitmusPortal services.

## Requirements

The litmusctl CLI requires the following things:

- Kubeconfig - litmusctl needs the kubeconfig of the k8s cluster where we need to connect litmus agents. The CLI currently uses the default path of kubeconfig i.e. `~/.kube/config`.

## Installation

To install the latest version of litmusctl follow the below steps:

- Download the latest litmusctl(master) binary from:

| Platforms | Download Link |
| ------------------------------ | ------------------------------------------------------------------------------------------------------- |
| litmusctl-darwin-386 (MacOS) | [Click here](https://litmusctl-bucket.s3-eu-west-1.amazonaws.com/litmusctl-darwin-386-master.tar.gz) |
| litmusctl-darwin-amd64 (MacOS) | [Click here](https://litmusctl-bucket.s3-eu-west-1.amazonaws.com/litmusctl-darwin-amd64-master.tar.gz) |
| litmusctl-linux-386 | [Click here](https://litmusctl-bucket.s3-eu-west-1.amazonaws.com/litmusctl-linux-386-master.tar.gz) |
| litmusctl-linux-amd64 | [Click here](https://litmusctl-bucket.s3-eu-west-1.amazonaws.com/litmusctl-linux-amd64-master.tar.gz) |
| litmusctl-linux-arm | [Click here](https://litmusctl-bucket.s3-eu-west-1.amazonaws.com/litmusctl-linux-arm-master.tar.gz) |
| litmusctl-linux-arm64 | [Click here](https://litmusctl-bucket.s3-eu-west-1.amazonaws.com/litmusctl-linux-arm64-master.tar.gz) |
| litmusctl-windows-386 | [Click here](https://litmusctl-bucket.s3-eu-west-1.amazonaws.com/litmusctl-windows-386-master.tar.gz) |
| litmusctl-windows-amd64 | [Click here](https://litmusctl-bucket.s3-eu-west-1.amazonaws.com/litmusctl-windows-amd64-master.tar.gz) |
| litmusctl-windows-arm | [Click here](https://litmusctl-bucket.s3-eu-west-1.amazonaws.com/litmusctl-windows-arm-master.tar.gz) |

<br />

- Download the litmusctl(v0.2.0) binary from:

| Platforms | Download Link |
| ------------------------------ | ------------------------------------------------------------------------------------------------------- |
| litmusctl-darwin-386 (MacOS) | [Click here](https://litmusctl-bucket.s3-eu-west-1.amazonaws.com/litmusctl-darwin-386-v0.2.0.tar.gz) |
| litmusctl-darwin-amd64 (MacOS) | [Click here](https://litmusctl-bucket.s3-eu-west-1.amazonaws.com/litmusctl-darwin-amd64-v0.2.0.tar.gz) |
| litmusctl-linux-386 | [Click here](https://litmusctl-bucket.s3-eu-west-1.amazonaws.com/litmusctl-linux-386-v0.2.0.tar.gz) |
| litmusctl-linux-amd64 | [Click here](https://litmusctl-bucket.s3-eu-west-1.amazonaws.com/litmusctl-linux-amd64-v0.2.0.tar.gz) |
| litmusctl-linux-arm | [Click here](https://litmusctl-bucket.s3-eu-west-1.amazonaws.com/litmusctl-linux-arm-v0.2.0.tar.gz) |
| litmusctl-linux-arm64 | [Click here](https://litmusctl-bucket.s3-eu-west-1.amazonaws.com/litmusctl-linux-arm64-v0.2.0.tar.gz) |
| litmusctl-windows-386 | [Click here](https://litmusctl-bucket.s3-eu-west-1.amazonaws.com/litmusctl-windows-386-v0.2.0.tar.gz) |
| litmusctl-windows-amd64 | [Click here](https://litmusctl-bucket.s3-eu-west-1.amazonaws.com/litmusctl-windows-amd64-v0.2.0.tar.gz) |
| litmusctl-windows-arm | [Click here](https://litmusctl-bucket.s3-eu-west-1.amazonaws.com/litmusctl-windows-arm-v0.2.0.tar.gz) |

<br />

- Extract the binary

```shell
$ tar -zxvf litmusctl-<OS>-<ARCH>-<VERSION>.tar.gz
```

- Provide necessary permissions

```shell
$ chmod +x litmusctl
```

- Move the litmusctl binary to /usr/local/bin/litmusctl

```shell
$ sudo mv litmusctl /usr/local/bin/litmusctl
```

## Basic Commands

litmusctl CLI command has the following structure:

```shell
$ litmusctl <command> <subcommand> <subcommand> [options and parameters]
```

To get the version of the litmusctl CLI:

```shell
$ litmusctl version
```

### Connecting an agent

To connect Litmus Chaos agent:

```shell
$ litmusctl agent connect
```

Next, you need to enter LitmusPortal details to login into your LitmusPortal account. Fields to be filled in:

**LitmusPortal UI URL:** Enter the URL used to access the Litmus Portal UI.
Example, http://172.17.0.2:31696/

**Username:** Enter your LitmusPortal username.
**Password:** Enter your LitmusPortal password.

```shell
🔥 Connecting LitmusChaos agent

📶 Please enter LitmusChaos details --
👉 Host URL where litmus is installed: http://172.17.0.2:31696/
🤔 Username [admin]: admin
🙈 Password:
✅ Login Successful!
```

Upon successful login, there will be a list of exiting projects displayed on the terminal. Select the desired project by entering the sequence number indicated against it.

```shell
✨ Projects List:
1. abc

🔎 Select Project: 1
```

Next, select the installation mode. In case the selected mode was a Cluster there will be a prerequisites check to verify ClusterRole and ClusterRoleBinding.

```shell
🔌 Installation Modes:
1. Cluster
2. Namespace

👉 Select Mode [cluster]: 1

🏃 Running prerequisites check....
🔑 clusterrole - ✅
🔑 clusterrolebinding - ✅

🌟 Sufficient permissions. Connecting Agent
```

Next, enter the details of the new agent.

Fields to filled in:
**Agent Name:** Enter the name for the new agent.

**Agent Description:** Fill in details about the agent.

**Platform Name:** Enter the platform name on which this agent is hosted. For example, AWS, GCP, Rancher etc.

**Enter the namespace:** You can either enter an existing namespace or enter a new namespace. In cases where the namespace does not exist, LitmusPortal creates it for you.

**Enter service account:** Enter a name for your service account.

```shell
🔗 Enter the details of the agent ----
🤷 Agent Name: my-agent
📘 Agent Description: This is a new agent.
📦 Platform List
1. AWS
2. GKE
3. Openshift
4. Rancher
5. Others
🔎 Select Platform [Others]: 5
📁 Enter the namespace (new or existing) [litmus]: litmus
🔑 Enter service account [litmus]: litmus
```

Once, all these steps are implemented you will be able to see a summary of all the entered fields.
After verification of these details, you can proceed with the connection of the agent by entering Y. The process of connection might take up to a few seconds.

```shell
📌 Summary --------------------------

Agent Name: my-agent
Agent Description: This is a new agent.
Platform Name: Others
Namespace: litmus
Service Account: litmus
Installation Mode: cluster

-------------------------------------

🤷 Do you want to continue with the above details? [Y/N]: Y

💡 Connecting agent to Litmus Portal.
🏃 Agents running!!
🚀 Agent Connection Successful!! 🎉
👉 Litmus agents can be accessed here: http://172.17.0.2:31696/targets
```

To verify, if the connection process was successful you can view the list of connected agents from the Targets section on your LitmusPortal and ensure that the connected agent is in Active State.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
id: agent-uninstall
title: Litmus Chaos Agent Uninstall
sidebar_label: Chaos Agent
---

As part of uninstalling agent components, we need to perform two steps
1. Disconnect the Agent from Portal

- Login to Chaos Control Plane

- Click on Agent

- Click on the Disconnect icon on the required Chaos Agent which needs to be disconnected

- On the above operation it would remove the subscriber component from Chaos Agent and removes the connectivity between the Chaos Agent and Chaos Control Plane.

**Note** If the Chaos Agent is not reachable it would remove only the entry from the database of the Chaos control plane

2. Remove the Chaos Agent components from the system manually


```bash
kubectl delete chaosengine,chaosexperiments,chaosresults --all -A
kubectl delete ns litmus
```
81 changes: 81 additions & 0 deletions website/versioned_docs/version-2.0.0-Beta-8/architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
id: architecture
title: Litmus Architecture
sidebar_label: Architecture
---

---

<img src={require('./assets/portal-arch.jpg').default} width="800" />

The above picture gives you a high-level architecture of the Litmus. At highlevel, Litmus components can be classified into two parts

1. Portal
2. Agents

**Portal** is a set of Litmus components which act as Cross Cloud Chaos Control plane (WebUI) which is be used to orchestrate and observe the chaos workflows on Agents.

**Agent** is the set of Litmus components which induces Chaos using the chaos workflows on the K8S cluster component.

Typical user scenario, The user would install litmus. This would in-turn install Portal and Agent on the self cluster. Using the portal user can create/schedule new chaos workflows on the Agents and observe the results from here. User can also connect more clusters to the portal, and use the Portal as single window pane for cross cloud chaos management.



**Portal Components**

Portal has the following components

- Litmus WebUI

Litmus UI provides web user interface, where user can construct and observe the chaos workflow at ease. Also this act as cross cloud chaos control plane that is

- Litmus Server

Litmus Server act as middle ware which is use to handle API request from the user interface, store the config and results details into the DB. This also act as interface to communicate between the requests and scheduling the workflow to Agent.

- Litmus DB

Litmus DB act as config store for chaos workflows and its results.

**Agent components**

Agents has the following Litmus components

- Chaos Operator

Chaos-Operator watches for the ChaosEngine CR and executes the Chaos-Experiments mentioned in the CR. Chaos-Operator is namespace scoped. By default, it runs in `litmus` namespace. Once the experiment is completed, chaos-operator invokes chaos-exporter to export chaos metrics to a Prometheus database.

- CRDs

During installation, the following three CRDs are installed on the Kubernetes cluster.

```
chaosexperiments.litmuschaos.io
chaosengines.litmuschaos.io
chaosresults.litmuschaos.io
```

- Chaos Experiment

Chaos Experiment is a CR and are available as YAML files on [Chaos Hub](https://hub.litmuschaos.io/). For more details visit Chaos Hub [documentation](https://litmusdocs-beta.netlify.app/docs/chaoshub).

- Chaos Engine

ChaosEngine CR links application to experiments. User has to create ChaosEngine YAML by specifying the application label and experiments and create the CR. The CR is watched by Chaos-Operator and chaos-experiments are executed on a given application.

- Chaos Results

ChaosResult resource holds the results of a ChaosExperiment with a namespace scope. It is created or updated at runtime by the experiment itself. It holds important information like the ChaosEngine reference, Experiment State, Verdict of the experiment (on completion), salient application/result attributes. It is also a source for metrics collection. It is updated/patched with the status of the experiment run. It is not removed as part of the default cleanup procedures to allow for extended reference.

- Chaos Probes

Litmus probes are pluggable checks that can be defined within the ChaosEngine for any chaos experiment. The experiment pods execute these checks based on the mode they are defined in & factor their success as necessary conditions in determining the verdict of the experiment (along with the standard “in-built” checks).

- Chaos Exporter

Optionally metrics can be exported to a Prometheus database. Chaos-Exporter implements the Prometheus metrics endpoint.

- Subscriber

Subscriber is the component used in Agent side which interact with Litmus Server component to get the details of Chaos workflow and send the results back.

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.
Binary file not shown.
Loading