Skip to content

Commit 35afa81

Browse files
Update commands and logs with new terminology (#83)
* Update commands and logs with new terminology Signed-off-by: Sarthak Jain <sarthak.jain@harness.io> * Added compatibility matrix in readme Signed-off-by: Sarthak Jain <sarthak.jain@harness.io>
1 parent 92277b2 commit 35afa81

File tree

24 files changed

+317
-296
lines changed

24 files changed

+317
-296
lines changed

README.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![GitHub stars](https://img.shields.io/github/stars/litmuschaos/litmusctl?style=social)](https://github.com/litmuschaos/litmusctl/stargazers)
55
[![GitHub Release](https://img.shields.io/github/release/litmuschaos/litmusctl.svg?style=flat)]()
66

7-
The Litmuschaos command-line tool, litmusctl, allows you to manage litmuschaos's agent plane. You can use litmusctl to create agents, project, and manage multiple litmuschaos accounts.
7+
The Litmuschaos command-line tool, litmusctl, allows you to manage litmuschaos's agent plane. You can use litmusctl to connect Chaos Delegates, create project, schedule Chaos Scenarios, disconnect Chaos Delegates and manage multiple litmuschaos accounts.
88

99
## Usage
1010
For more information including a complete list of litmusctl operations, see the litmusctl reference documentation.
@@ -17,10 +17,44 @@ For more information including a complete list of litmusctl operations, see the
1717

1818
The litmusctl CLI requires the following things:
1919

20-
- 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`.
20+
- kubeconfig - litmusctl needs the kubeconfig of the k8s cluster where we need to connect litmus Chaos Delegates. The CLI currently uses the default path of kubeconfig i.e. `~/.kube/config`.
2121
- kubectl- litmusctl is using kubectl under the hood to apply the manifest. To install kubectl, follow: [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)
2222

2323

24+
## Compatibility matrix
25+
26+
To check compatibility of chaosctl with Chaos Center
27+
28+
<table>
29+
<th>litmusctl version</th>
30+
<th>Chaos Center supported versions</th>
31+
32+
<tr>
33+
<td>0.6.0</td>
34+
<td>2.2.0, 2.3.0</td>
35+
</tr>
36+
<tr>
37+
<td>0.7.0</td>
38+
<td>2.4.0, 2.5.0, 2.6.0, 2.7.0, 2.8.0</td>
39+
</tr>
40+
<tr>
41+
<td>0.8.0</td>
42+
<td>2.4.0, 2.5.0, 2.6.0, 2.7.0, 2.8.0</td>
43+
</tr>
44+
<tr>
45+
<td>0.9.0</td>
46+
<td>2.4.0, 2.5.0, 2.6.0, 2.7.0, 2.8.0</td>
47+
</tr>
48+
<tr>
49+
<td>0.10.0</td>
50+
<td>2.9.0, 2.10.0, 2.11.0</td>
51+
</tr>
52+
<tr>
53+
<td>0.11.0</td>
54+
<td>2.9.0, 2.10.0, 2.11.0</td>
55+
</tr>
56+
</table>
57+
2458
## Installation
2559

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

Usage.md

Lines changed: 53 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,78 @@
1-
# Usage: Litmusctl v0.3.0 (Non-Interactive mode)
2-
> Notes:
3-
> * For litmusctl v0.3.0 or latest
4-
> * Compatible with Litmus 2.0.0-Beta9 or latest
5-
61
### litmusctl Syntax
72
`litmusctl` has a syntax to use as follows:
83

94
```shell
105
litmusctl [command] [TYPE] [flags]
116
```
12-
* Command: refers to what you do want to perform (create, get and config)
13-
* Type: refers to the feature type you are performing a command against (agent, project etc.)
7+
* Command: refers to what you do want to perform (connect, create, get and config)
8+
* Type: refers to the feature type you are performing a command against (chaos-delegate, project etc.)
149
* Flags: It takes some additional information for resource operations. For example, `--installation-mode` allows you to specify an installation mode.
1510

1611
Litmusctl is using the `.litmusconfig` config file to manage multiple accounts
1712
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.
1813
2. Otherwise, the ${HOME}/.litmusconfig file is used, and no merging takes place.
1914

2015
Litmusctl supports both interactive and non-interactive(flag based) modes.
21-
> 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.
16+
> Only `litmusctl connect chaos-delegate` 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.
2217
2318
### Installation modes
24-
Litmusctl can install an agent in two different modes.
25-
* cluster mode: With this mode, the agent can run the chaos in any namespace. It installs appropriate cluster roles and cluster role bindings to achieve this mode. It can be enabled by passing a flag `--installation-mode=cluster`
19+
Litmusctl can install a Chaos Delegate in two different modes.
20+
* cluster mode: With this mode, the Chaos Delegate can run the chaos in any namespace. It installs appropriate cluster roles and cluster role bindings to achieve this mode. It can be enabled by passing a flag `--installation-mode=cluster`
2621

27-
* namespace mode: With this mode, the agent can run the chaos in its namespace. It installs appropriate roles and role bindings to achieve this mode. It can be enabled by passing a flag `--installation-mode=namespace`
22+
* namespace mode: With this mode, the Chaos Delegate can run the chaos in its namespace. It installs appropriate roles and role bindings to achieve this mode. It can be enabled by passing a flag `--installation-mode=namespace`
2823

29-
Note: With namespace mode, the user needs to create the namespace to install the agent as a prerequisite.
24+
Note: With namespace mode, the user needs to create the namespace to install the Chaos Delegate as a prerequisite.
3025

31-
### Minimal steps to create an agent
26+
### Minimal steps to connect a Chaos Delegate
3227

3328
* To setup an account with litmusctl
3429
```shell
3530
litmusctl config set-account --endpoint="" --username="" --password=""
3631
```
3732

38-
* To create an agent without a project
39-
>Note: If the user doesn't have any project, it will create a random project and add the agent in that random project.
40-
```shell
41-
litmusctl connect agent --agent-name="" --non-interactive
42-
```
43-
44-
### Or,
45-
46-
* To create an agent with an existing project
33+
* To create an Chaos Delegate with an existing project
4734
> Note: To get `project-id`. Apply `litmusctl get projects`
4835
4936
```shell
50-
litmusctl connect agent --agent-name="" --project-id="" --non-interactive
37+
litmusctl connect chaos-delegate --name="" --project-id="" --non-interactive
5138
```
5239

53-
### Flags for `connect agent` command
40+
### Flags for `connect chaos-delegate` command
5441
<table>
5542
<tr>
5643
<th>Flag</th>
5744
<th>Short Flag</th>
5845
<th>Type</th>
5946
<th>Description</th>
6047
<tr>
61-
<td>--agent-description</td>
48+
<td>--description</td>
6249
<td></td>
6350
<td>String</td>
64-
<td>Set the agent description (default "---")</td>
51+
<td>Set the Chaos Delegate description (default "---")</td>
6552
</tr>
6653
<tr>
67-
<td>--agent-name</td>
54+
<td>--name</td>
6855
<td></td>
6956
<td>String</td>
70-
<td>Set the cluster-type to external for external agents | Supported=external/internal (default "external")</td>
57+
<td>Set the name of Chaos Delegate which should be unique</td>
7158
</tr>
7259
<tr>
73-
<td>--skip-agent-ssl</td>
60+
<td>--skip-ssl</td>
7461
<td></td>
7562
<td>Boolean</td>
76-
<td>Set whether agent will skip ssl/tls check (can be used for self-signed certs, if cert is not provided in portal) (default false)</td>
63+
<td>Set whether Chaos Delegate will skip ssl/tls check (can be used for self-signed certs, if cert is not provided in portal) (default false)</td>
7764
</tr>
7865
<tr>
79-
<td>--cluster-type</td>
66+
<td>--chaos-delegate-type</td>
8067
<td></td>
8168
<td>String</td>
82-
<td>Set the cluster-type to external for external agents | Supported=external/internal (default "external")</td>
69+
<td>Set the chaos-delegate-type to external for external Chaos Delegates | Supported=external/internal (default "external")</td>
8370
</tr>
8471
<tr>
8572
<td>--installation-mode</td>
8673
<td></td>
8774
<td>String</td>
88-
<td>Set the installation mode for the kind of agent | Supported=cluster/namespace (default "cluster")</td>
75+
<td>Set the installation mode for the kind of Chaos Delegate | Supported=cluster/namespace (default "cluster")</td>
8976
</tr>
9077
<tr>
9178
<td>--kubeconfig</td>
@@ -97,13 +84,13 @@ litmusctl connect agent --agent-name="" --project-id="" --non-interactive
9784
<td>--namespace</td>
9885
<td></td>
9986
<td>String</td>
100-
<td>Set the namespace for the agent installation (default "litmus")</td>
87+
<td>Set the namespace for the Chaos Delegate installation (default "litmus")</td>
10188
</tr>
10289
<tr>
10390
<td>--node-selector</td>
10491
<td></td>
10592
<td>String</td>
106-
<td>Set the node-selector for agent components | Format: key1=value1,key2=value2)
93+
<td>Set the node-selector for Chaos Delegate components | Format: key1=value1,key2=value2)
10794
</tr>
10895
<tr>
10996
<td>--non-interactive</td>
@@ -133,7 +120,7 @@ litmusctl connect agent --agent-name="" --project-id="" --non-interactive
133120
<td>--service-account</td>
134121
<td></td>
135122
<td>String</td>
136-
<td>Set the service account to be used by the agent (default "litmus")</td>
123+
<td>Set the service account to be used by the Chaos Delegate (default "litmus")</td>
137124
</tr>
138125
<tr>
139126
<td>--config</td>
@@ -145,19 +132,19 @@ litmusctl connect agent --agent-name="" --project-id="" --non-interactive
145132

146133
---
147134

148-
### Steps to create a Chaos Workflow
135+
### Steps to create a chaos scenaro
149136

150137
* To setup an account with litmusctl
151138
```shell
152139
litmusctl config set-account --endpoint="" --username="" --password=""
153140
```
154141

155-
* To create a Chaos Workflow by passing a manifest file
142+
* To create a Chaos Scenario by passing a manifest file
156143
> Note:
157144
> * To get `project-id`, apply `litmusctl get projects`
158-
> * To get `agent-id`, apply `litmusctl get agents --project-id=""`
145+
> * To get `chaos-delegate-id`, apply `litmusctl get chaos-delegates --project-id=""`
159146
```shell
160-
litmusctl create workflow -f custom-chaos-workflow.yml --project-id="" --agent-id=""
147+
litmusctl create chaos-scenario -f custom-chaos-scenario.yml --project-id="" --chaos-delegate-id=""
161148
```
162149

163150
---
@@ -224,65 +211,65 @@ PROJECT ID PROJECT NAME CREATEDAT
224211
```
225212

226213

227-
* To get an overview of the agents available within a project, issue the following command.
214+
* To get an overview of the Chaos Delegates available within a project, issue the following command.
228215
```shell
229-
litmusctl get agents --project-id=""
216+
litmusctl get chaos-delegates --project-id=""
230217
```
231218

232219
**Output:**
233220

234221
```
235-
AGENTID AGENTNAME STATUS REGISTRATION
236-
55ecc7f2-2754-43aa-8e12-6903e4c6183a agent-1 ACTIVE REGISTERED
237-
13dsf3d1-5324-54af-4g23-5331g5v2364f agent-2 INACTIVE NOT REGISTERED
222+
CHAOS DELEGATE ID CHAOS DELEGATE NAME STATUS REGISTRATION
223+
55ecc7f2-2754-43aa-8e12-6903e4c6183a chaos-delegate-1 ACTIVE REGISTERED
224+
13dsf3d1-5324-54af-4g23-5331g5v2364f chaos-delegate-2 INACTIVE NOT REGISTERED
238225
```
239226

240227

241-
* To disconnect an agent, issue the following command..
228+
* To disconnect a Chaos Delegate, issue the following command..
242229
```shell
243-
litmusctl disconnect agent <agent-id> --project-id=""
230+
litmusctl disconnect chaos-delegate <chaos-delegate-id> --project-id=""
244231
```
245232

246233
**Output:**
247234

248235
```
249-
🚀 ChaosAgent successfully disconnected.
236+
🚀 Chaos Delegate successfully disconnected.
250237
```
251238

252239

253-
* To list the created workflows within a project, issue the following command.
240+
* To list the created Chaos Scenarios within a project, issue the following command.
254241
```shell
255-
litmusctl get workflows --project-id=""
242+
litmusctl get chaos-scenarios --project-id=""
256243
```
257244

258245
**Output:**
259246

260247
```
261-
WORKFLOW ID WORKFLOW NAME WORKFLOW TYPE NEXT SCHEDULE AGENT ID AGENT NAME LAST UPDATED BY
262-
9433b48c-4ab7-4544-8dab-4a7237619e09 custom-chaos-workflow-1627980541 Non Cron Workflow None f9799723-29f1-454c-b830-ae8ba7ee4c30 Self-Agent admin
248+
CHAOS SCENARIO ID CHAOS SCENARIO NAME CHAOS SCENARIO TYPE NEXT SCHEDULE CHAOS DELEGATE ID CHAOS DELEGATE NAME LAST UPDATED BY
249+
9433b48c-4ab7-4544-8dab-4a7237619e09 custom-chaos-scenario-1627980541 Non Cron Chaos Scenario None f9799723-29f1-454c-b830-ae8ba7ee4c30 Self-Chaos-delegate admin
263250
264-
Showing 1 of 1 workflows
251+
Showing 1 of 1 Chaos Scenarios
265252
```
266253

267254

268-
* To list all the chaos workflow runs within a project, issue the following command.
255+
* To list all the Chaos Scenario runs within a project, issue the following command.
269256
```shell
270-
litmusctl get workflowruns --project-id=""
257+
litmusctl get chaos-scenario-runs --project-id=""
271258
```
272259

273260
**Output:**
274261

275262
```
276-
WORKFLOW RUN ID STATUS RESILIENCY SCORE WORKFLOW ID WORKFLOW NAME TARGET AGENT LAST RUN EXECUTED BY
277-
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
263+
CHAOS SCENARIO RUN ID STATUS RESILIENCY SCORE CHAOS SCENARIO ID CHAOS SCENARIO NAME TARGET CHAOS DELEGATE LAST RUN EXECUTED BY
264+
8ceb712c-1ed4-40e6-adc4-01f78d281506 Running 0.00 9433b48c-4ab7-4544-8dab-4a7237619e09 custom-chaos-scenario-1627980541 Self-Chaos-Delegate June 1 2022, 10:28:02 pm admin
278265
279-
Showing 1 of 1 workflow runs
266+
Showing 1 of 1 Chaos Scenario runs
280267
```
281268

282269

283-
* To describe a particular chaos workflow, issue the following command.
270+
* To describe a particular Chaos Scenario, issue the following command.
284271
```shell
285-
litmusctl describe workflow <workflow-id> --project-id=""
272+
litmusctl describe chaos-scenario <chaos-scenario-id> --project-id=""
286273
```
287274

288275
**Output:**
@@ -294,28 +281,29 @@ metadata:
294281
creationTimestamp: null
295282
labels:
296283
cluster_id: f9799723-29f1-454c-b830-ae8ba7ee4c30
297-
subject: custom-chaos-workflow_litmus
284+
subject: custom-chaos-scenario_litmus
298285
workflow_id: 9433b48c-4ab7-4544-8dab-4a7237619e09
299286
workflows.argoproj.io/controller-instanceid: f9799723-29f1-454c-b830-ae8ba7ee4c30
300-
name: custom-chaos-workflow-1627980541
287+
name: custom-chaos-scenario-1627980541
301288
namespace: litmus
302289
spec:
303290
...
304291
```
305292

306293

307-
* To delete a particular chaos workflow, issue the following command.
294+
* To delete a particular Chaos Scenario, issue the following command.
308295
```shell
309-
litmusctl delete workflow <workflow-id> --project-id=""
296+
litmusctl delete chaos-scenario <chaos-scenario-id> --project-id=""
310297
```
311298

312299
**Output:**
313300

314301
```
315-
🚀 ChaosWorkflow successfully deleted.
302+
🚀 Chaos Scenario successfully deleted.
316303
```
317304

318305

306+
319307
For more information related to flags, Use `litmusctl --help`.
320308

321309
----

0 commit comments

Comments
 (0)