Skip to content

Commit 6b7922d

Browse files
Added litmus v2.10.0 docs and updated litmusctl docs (#194)
* Added litmus v2.10.0 docs and updated litmusctl docs Signed-off-by: Sarthak Jain <[email protected]>
1 parent ebcef7d commit 6b7922d

File tree

285 files changed

+10695
-26
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

285 files changed

+10695
-26
lines changed
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
---
2+
id: chaos-workflow-creation
3+
title: Create Chaos Workflows using Litmusctl
4+
sidebar_label: Create Chaos Workflows
5+
---
6+
7+
---
8+
9+
# Usage: Litmusctl v0.10.0
10+
11+
> Notes:
12+
>
13+
> - For litmusctl v0.10.0 or latest
14+
> - Compatible with Litmus 2.9.0 or latest
15+
### litmusctl Syntax
16+
17+
`litmusctl` has a syntax to use as follows:
18+
19+
```shell
20+
litmusctl [command] [TYPE] [flags]
21+
```
22+
23+
- Command: refers to what you do want to perform (create, get and config)
24+
- Type: refers to the feature type you are performing a command against (agent, project etc.)
25+
- Flags: It takes some additional information for resource operations. For example, `--installation-mode` allows you to specify an installation mode.
26+
27+
Litmusctl is using the `.litmusconfig` config file to manage multiple accounts
28+
29+
1. If the --config flag is set, then only the given file is loaded. The flag may only be set once and no merging takes place.
30+
2. Otherwise, the ${HOME}/.litmusconfig file is used, and no merging takes place.
31+
32+
---
33+
34+
### Steps to create a Chaos Workflow
35+
36+
* To setup an account with litmusctl
37+
```shell
38+
litmusctl config set-account --endpoint="" --username="" --password=""
39+
```
40+
41+
* To create a Chaos Workflow by passing a manifest file
42+
> Note:
43+
> * To get `project-id`, apply `litmusctl get projects`
44+
> * To get `agent-id`, apply `litmusctl get agents --project-id=""`
45+
```shell
46+
litmusctl create workflow -f custom-chaos-workflow.yml --project-id="" --agent-id=""
47+
```
48+
#### Verify the new Chaos Workflow
49+
50+
To verify the successful creation, you can either view the list of chaos workflows at the ChaosCenter dashboard or run the below given command to list the chaos workflow within a given project.
51+
52+
```shell
53+
litmusctl get workflows --project-id=""
54+
```
55+
56+
**Output:**
57+
58+
```
59+
WORKFLOW ID WORKFLOW NAME WORKFLOW TYPE NEXT SCHEDULE AGENT ID AGENT NAME LAST UPDATED BY
60+
9433b48c-4ab7-4544-8dab-4a7237619e09 custom-chaos-workflow-1627980541 Non Cron Workflow None f9799723-29f1-454c-b830-ae8ba7ee4c30 Self-Agent admin
61+
Showing 1 of 1 workflows
62+
```
63+
64+
---
65+
66+
### Additional commands
67+
68+
* To list all the chaos workflow runs within a project, issue the following command.
69+
```shell
70+
litmusctl get workflowruns --project-id=""
71+
```
72+
73+
**Output:**
74+
75+
```
76+
WORKFLOW RUN ID STATUS RESILIENCY SCORE WORKFLOW ID WORKFLOW NAME TARGET AGENT LAST RUN EXECUTED BY
77+
8ceb712c-1ed4-40e6-adc4-01f78d281506 Running 0.00 9433b48c-4ab7-4544-8dab-4a7237619e09 custom-chaos-workflow-1627980541 Self-Agent June 1 2022, 10:28:02 pm admin
78+
Showing 1 of 1 workflow runs
79+
```
80+
81+
82+
* To describe a particular chaos workflow, issue the following command.
83+
```shell
84+
litmusctl describe workflow 9433b48c-4ab7-4544-8dab-4a7237619e09 --project-id=""
85+
```
86+
87+
**Output:**
88+
89+
```
90+
apiVersion: argoproj.io/v1alpha1
91+
kind: Workflow
92+
metadata:
93+
creationTimestamp: null
94+
labels:
95+
cluster_id: f9799723-29f1-454c-b830-ae8ba7ee4c30
96+
subject: custom-chaos-workflow_litmus
97+
workflow_id: 9433b48c-4ab7-4544-8dab-4a7237619e09
98+
workflows.argoproj.io/controller-instanceid: f9799723-29f1-454c-b830-ae8ba7ee4c30
99+
name: custom-chaos-workflow-1627980541
100+
namespace: litmus
101+
spec:
102+
...
103+
```
104+
105+
106+
* To delete a particular chaos workflow, issue the following command.
107+
```shell
108+
litmusctl delete workflow df91c6b2-ad33-45ae-9a2f-00cb87978657 --project-id=""
109+
```
110+
111+
**Output:**
112+
113+
```
114+
🚀 ChaosWorkflow successfully deleted.
115+
```
116+
117+
For more information related to flags, Use `litmusctl --help`.
118+
119+
---
120+
121+
## Learn More
122+
123+
- [Learn More about Litmusctl](installation.md)
124+
- [Installing ChaosAgents in interactive mode](./usage-interactive-mode.md)
125+
- [Installing ChaosAgents in non interactive mode](./usage-non-interactive-mode.md)
126+
- [Setup Endpoints and Access ChaosCenter without Ingress](../user-guides/setup-without-ingress.md)
127+
- [Setup Endpoints and Access ChaosCenter with Ingress](../user-guides/setup-with-ingress.md)

website/docs/litmusctl/usage-interactive-mode.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ sidebar_label: Using interactive mode
66

77
---
88

9-
# Usage: Litmusctl v0.3.0
9+
# Usage: Litmusctl v0.10.0
1010

1111
> Notes:
1212
>
13-
> - For litmusctl v0.3.0 or latest
14-
> - Compatible with Litmus 2.0.0 or latest
13+
> - For litmusctl v0.10.0 or latest
14+
> - Compatible with Litmus 2.9.0 or latest
1515
1616
### litmusctl Syntax
1717

@@ -32,11 +32,11 @@ Litmusctl is using the `.litmusconfig` config file to manage multiple accounts
3232

3333
Litmusctl supports both interactive and non-interactive(flag based) modes.
3434

35-
> Only `litmusctl create agent` command needs --non-interactive flag, other commands don't need this flag to be in non-interactive mode. If mandatory flags aren't passed, then litmusctl takes input in an interactive mode.
35+
> Only `litmusctl connect agent` command needs --non-interactive flag, other commands don't need this flag to be in non-interactive mode. If mandatory flags aren't passed, then litmusctl takes input in an interactive mode.
3636
3737
Multiple external ChaosAgents can be connected to the ChaosCenter with the help of the command line utility [litmusctl](installation.md)
3838

39-
### Steps to create an agent
39+
### Steps to connect an agent
4040

4141
- To setup an account with litmusctl
4242

@@ -61,10 +61,10 @@ Password:
6161
account.username/admin configured
6262
```
6363

64-
- To create an agent in a cluster mode
64+
- To connect an agent in a cluster mode
6565

6666
```shell
67-
litmusctl create agent
67+
litmusctl connect agent
6868
```
6969

7070
There will be a list of existing projects displayed on the terminal. Select the desired project by entering the sequence number indicated against it.
@@ -271,9 +271,21 @@ Enter the Project ID: 50addd40-8767-448c-a91a-5071543a2d8e
271271
**Output:**
272272

273273
```
274-
AGENTID AGENTNAME STATUS
275-
55ecc7f2-2754-43aa-8e12-6903e4c6183a agent-1 ACTIVE
276-
13dsf3d1-5324-54af-4g23-5331g5v2364f agent-2 INACTIVE
274+
AGENTID AGENTNAME STATUS REGISTRATION
275+
55ecc7f2-2754-43aa-8e12-6903e4c6183a agent-1 ACTIVE REGISTERED
276+
13dsf3d1-5324-54af-4g23-5331g5v2364f agent-2 INACTIVE NOT REGISTERED
277+
```
278+
279+
- To disconnect an agent, issue the following command.
280+
281+
```shell
282+
litmusctl disconnect agent 55ecc7f2-2754-43aa-8e12-6903e4c6183a --project-id=""
283+
```
284+
285+
**Output:**
286+
287+
```
288+
🚀 ChaosAgent successfully disconnected.
277289
```
278290

279291
For more information related to flags, Use `litmusctl --help`.
@@ -282,5 +294,6 @@ For more information related to flags, Use `litmusctl --help`.
282294

283295
- [Learn More about Litmusctl](installation.md)
284296
- [Installing ChaosAgents in non interactive mode](./usage-non-interactive-mode.md)
297+
- [Create Chaos Workflows using Litmusctl](./chaos-workflow-creation.md)
285298
- [Setup Endpoints and Access ChaosCenter without Ingress](../user-guides/setup-without-ingress.md)
286299
- [Setup Endpoints and Access ChaosCenter with Ingress](../user-guides/setup-with-ingress.md)

website/docs/litmusctl/usage-non-interactive-mode.md

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ sidebar_label: Using non interactive mode
66

77
---
88

9-
# Usage: Litmusctl v0.3.0
9+
# Usage: Litmusctl v0.10.0
1010
> Notes:
11-
> * For litmusctl v0.3.0 or latest
12-
> * Compatible with Litmus 2.0.0 or latest
11+
> * For litmusctl v0.10.0 or latest
12+
> * Compatible with Litmus 2.9.0 or latest
1313
1414
### litmusctl Syntax
1515
`litmusctl` has a syntax to use as follows:
@@ -26,7 +26,7 @@ Litmusctl is using the `.litmusconfig` config file to manage multiple accounts
2626
2. Otherwise, the ${HOME}/.litmusconfig file is used, and no merging takes place.
2727

2828
Litmusctl supports both interactive and non-interactive(flag based) modes.
29-
> Only `litmusctl create agent` command needs --non-interactive flag, other commands don't need this flag to be in non-interactive mode. If mandatory flags aren't passed, then litmusctl takes input in an interactive mode.
29+
> Only `litmusctl connect agent` command needs --non-interactive flag, other commands don't need this flag to be in non-interactive mode. If mandatory flags aren't passed, then litmusctl takes input in an interactive mode.
3030
3131
### Installation modes
3232
Litmusctl can install an agent in two different modes.
@@ -36,33 +36,33 @@ Litmusctl can install an agent in two different modes.
3636

3737
Note: With namespace mode, the user needs to create the namespace to install the agent as a prerequisite.
3838

39-
### Minimal steps to create an agent
39+
### Minimal steps to connect an agent
4040

4141
* To setup an account with litmusctl
4242
```shell
4343
litmusctl config set-account --endpoint="" --username="" --password=""
4444
```
4545

46-
* To create an agent without a project in a cluster mode
46+
* To connect an agent without a project in a cluster mode
4747
>Note: If the user doesn't have any project, it will create a random project and add the agent in that random project.
4848
```shell
49-
litmusctl create agent --agent-name="" --non-interactive
49+
litmusctl connect agent --agent-name="" --non-interactive
5050
```
5151

5252
Or,
5353

54-
* To create an agent with an existing project
54+
* To connect an agent with an existing project
5555
> Note: To get `project-id`. Apply `litmusctl get projects`
5656
5757
```shell
58-
litmusctl create agent --agent-name="" --project-id="" --non-interactive
58+
litmusctl connect agent --agent-name="" --project-id="" --non-interactive
5959
```
6060

6161
#### Verify the new Agent Connection
6262

6363
To verify, if the connection process was successful you can view the list of connected agents from the Targets section on your ChaosCenter and ensure that the connected agent is in Active State.
6464

65-
### Flags for `create agent` command
65+
### Flags for `connect agent` command
6666
<table>
6767
<th>Flag</th>
6868
<th>Short Flag</th>
@@ -219,18 +219,28 @@ litmusctl get agents --project-id=""
219219
**Output:**
220220

221221
```
222-
AGENTID AGENTNAME STATUS
223-
55ecc7f2-2754-43aa-8e12-6903e4c6183a agent-1 ACTIVE
224-
13dsf3d1-5324-54af-4g23-5331g5v2364f agent-2 INACTIVE
222+
AGENTID AGENTNAME STATUS REGISTRATION
223+
55ecc7f2-2754-43aa-8e12-6903e4c6183a agent-1 ACTIVE REGISTERED
224+
13dsf3d1-5324-54af-4g23-5331g5v2364f agent-2 INACTIVE NOT REGISTERED
225225
```
226226

227-
For more information related to flags, Use `litmusctl --help`.
227+
- To disconnect an agent, issue the following command.
228+
229+
```shell
230+
litmusctl disconnect agent 55ecc7f2-2754-43aa-8e12-6903e4c6183a --project-id=""
231+
```
232+
233+
**Output:**
234+
235+
```
236+
🚀 ChaosAgent successfully disconnected.
237+
```
228238

229-
---
230239

231240
## Learn More
232241

233242
- [Learn More about Litmusctl](installation.md)
234243
- [Installing ChaosAgents in interactive mode](./usage-interactive-mode.md)
244+
- [Create Chaos Workflows using Litmusctl](./chaos-workflow-creation.md)
235245
- [Setup Endpoints and Access ChaosCenter without Ingress](../user-guides/setup-without-ingress.md)
236246
- [Setup Endpoints and Access ChaosCenter with Ingress](../user-guides/setup-with-ingress.md)

website/sidebars.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ module.exports = {
161161
'litmusctl/installation',
162162
{
163163
'Connect Agent': ['litmusctl/usage-non-interactive-mode', 'litmusctl/usage-interactive-mode']
164-
}
164+
},
165+
'litmusctl/chaos-workflow-creation'
165166
]
166167
},
167168

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
id: architecture-summary
3+
title: Architecture Summary
4+
sidebar_label: Architecture Summary
5+
---
6+
7+
---
8+
<img src={require("../assets/architecture-summary.png").default} alt="Architecture Overview" />
9+
10+
The Litmus architecture can be segregated into two parts:
11+
12+
1. **Control Plane:** Contains the components required for the functioning of Chaos Center, the website-based portal for Litmus.
13+
14+
2. **Execution Plane:** Contains the components required for the injection of chaos in the target resources.
15+
16+
Chaos Center can be used for creating, scheduling, and monitoring Chaos Workflows, a set of chaos experiments defined in a definitive sequence to achieve desired chaos impact on the target resources upon execution. Users can log in to the Chaos Center using valid login credentials and leverage the interactive web UI to define their chaos workflow to target multiple aspects of their infrastructure. Once the user creates a Chaos Workflow using the Chaos Center, it is passed on to the Execution Plane. The Execution Plane can be present either in the host cluster containing the Control Plane if the self agent is being used, or in the target cluster if an external agent is being used. The Execution Plane interprets the Chaos Workflow as a list of steps required for injecting chaos into the target resources. It ensures efficient orchestration of chaos in cloud-native environments using various Kubernetes CRs. Once the Chaos Workflow is executed, Execution Plane sends the chaos result to the Control Plane for their post-processing using either the built-in monitoring dashboard of Litmus or using external observability tools such as Prometheus DB and Grafana dashboard. Litmus also achieves automated Chaos Workflow runs to execute chaos as part of the CI/CD pipeline based on a set of defined conditions using GitOps.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
id: chaos-control-plane
3+
title: Chaos Control Plane
4+
sidebar_label: Chaos Control Plane
5+
---
6+
7+
---
8+
9+
<img src={require("../assets/chaos-control-plane.png").default} alt="Chaos Control Plane" />
10+
11+
Chaos Control Plane consists of micro-services responsible for the functioning of the Chaos Center, the website-based portal that can be used for interacting with Litmus, apart from the CLI. Chaos Plane facilitates the creation and scheduling of chaos workflows, system observability during the event of chaos, and post-processing and analysis of experiment results.
12+
13+
## Chaos Control Plane Components
14+
15+
* **Authentication Server:** A Golang micro-service that is responsible for authorizing, authenticating the requests received from Chaos Center and managing users along with their projects. It primarily serves the cause of user creation, user login, resetting the password, updating user information, creating project, managing project related operations.
16+
17+
* **Backend Server:** A GraphQL based Golang micro-service that serves the requests received from Chaos Center, by either querying the database for the relevant information or by fetching information from the Execution Plane.
18+
19+
* **Database:** A NoSQL MongoDB database micro-service that is accountable for storing users' information, past workflows, saved workflow templates, user projects, ChaosHubs, and GitOps details, among the other information.
20+
21+
* **Chaos Center:** Refers to the interfaces used by Litmus for creation and scheduling of chaos workflows, system observability during chaos injection, and post chaos result analysis. It includes:
22+
23+
* **Web UI:** A React.js based frontend application micro-service with built-in system observability capabilities and an analytics dashboard. It also facilitates teams of users to collaborate over chaos workflows using role-based user accounts.
24+
25+
* **Litmusctl:** A command-line tool that allows management of Litmus Agent Infrastructure components. It can be used to create agents, project, and manage multiple Litmus accounts.
26+
27+
* **Litmus API:** Refers to two different Litmus APIs, namely Litmus Authentication API and Litmus Portal API:
28+
29+
* **Litmus Authentication API:** Used to authenticate the identity of a user and to perform several user and project specific tasks like create new users, update profile, update password, create project, invite users to project, get project details etc. It uses the Authentication Server to perform these tasks.
30+
31+
* **Litmus Portal API:** Provides command-line and UI experience for managing and monitoring the events around chaos workflows. It uses the Backend Server to perform its functions.
32+
33+
## Standard Chaos Control Plane Flow
34+
35+
1. The User logs in to the ChaosCenter using a valid login credential. A default project is created for the user on initial login. Every user is a part of a project and has a role assigned to them. To schedule a workflow, the user needs to have an Editor or Owner role assigned in the project.
36+
2. The user uploads a Chaos Workflow manifest using the ChaosCenter, which is received by the Backend Server.
37+
3. Backend Server stores the manifest in the Database and also sends it to the Chaos Agent.
38+
4. Chaos Agent uses the Chaos Workflow manifest to inject chaos into the target resources. The steps of the Chaos Workflow execution can be visualized using the ChaosCenter.
39+
5. Chaos Agent returns the results of the chaos experiments that were a part of the workflow back to the Backend Server, along with the experiment logs.
40+
6. Backend Server then sends the chaos experiment results and logs to the ChaosCenter. It also stores the results into the Database for generating post-chaos workflow statistics and information.

0 commit comments

Comments
 (0)