Skip to content

Commit 4edda21

Browse files
pablochacinppcanoRoberto Santalla
authored
Update xk6-disruptor welcome page (#1233)
* Update xk6-disruptor welcome page Signed-off-by: Pablo Chacin <[email protected]> * intro change * Merge contributing/demos in `Learn more` + Update Get started * Rewrite key features * vale accepts `Killercoda` * update example * Disruptor use cases * fix vale error / rephrase use cases * Reword for clarity and accuracy Signed-off-by: Pablo Chacin <[email protected]> * style: consistent bullet points * Update src/data/markdown/docs/40 xk6-disruptor/01 Get started/01 Welcome.md Co-authored-by: Roberto Santalla <[email protected]> --------- Signed-off-by: Pablo Chacin <[email protected]> Co-authored-by: Pepe Cano <[email protected]> Co-authored-by: Roberto Santalla <[email protected]>
1 parent f0ebd73 commit 4edda21

File tree

4 files changed

+61
-29
lines changed

4 files changed

+61
-29
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ node_modules/
44
docs/sources/get-started/run-cloud-tests-from-the-CLI.md
55
docs/sources/get-started/run-your-first-tests.md
66
CONTRIBUTING_FILE_FORMAT.md
7+
src/data/markdown/docs/40 xk6-disruptor/01 Get started/01 Welcome.md
78
src/data/markdown/docs/40 xk6-disruptor/04 Examples/01 Inject Grpc faults into Service.md
89
src/data/markdown/docs/40 xk6-disruptor/04 Examples/02 Inject HTTP faults into Pod.md
910
src/data/markdown/docs/05 Examples/02 Tutorials/01 Get started with k6/100 Test-for-functional-behavior.md

.vale/Vocab/docs/accept.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ hostname
7878
htop
7979
kafka
8080
keyserver
81+
Killercoda
8182
iftop
8283
iters
8384
initializer
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
---
22
title: 'Get started'
3-
excerpt: ''
3+
excerpt: 'xk6-disruptor is an extension that adds fault injection capabilities to k6. Start here to learn the basics and how to use the disruptor'
44
---
55

6-
[Welcome](/javascript-api/xk6-disruptor/)
6+
Inject faults into kubernetes-based applications with `xk6-disruptor`. Start here to learn the basics to use the disruptor:
77

8-
[Requirements](/javascript-api/xk6-disruptor/get-started/requirements)
8+
- [About `xk6-disruptor`](/javascript-api/xk6-disruptor/)
99

10-
[Installation](/javascript-api/xk6-disruptor/get-started/installation)
10+
- [Requirements](/javascript-api/xk6-disruptor/get-started/requirements)
1111

12-
[Exposing Your Applications](/javascript-api/xk6-disruptor/get-started/expose-your-application/)
12+
- [Installation](/javascript-api/xk6-disruptor/get-started/installation)
13+
14+
- [Exposing your Kubernetes application](/javascript-api/xk6-disruptor/get-started/expose-your-application/)

src/data/markdown/docs/40 xk6-disruptor/01 Get started/01 Welcome.md

Lines changed: 52 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,74 @@ head_title: 'xk6-disruptor Documentation'
55
excerpt: 'xk6-disruptor is a k6 extension providing fault injection capabilities to test system reliability under turbulent conditions.'
66
---
77

8-
xk6-disruptor is a k6 extension that can inject faults into a system to simulate turbulent conditions.
8+
[xk6-disruptor](https://github.com/grafana/xk6-disruptor) is an extension that adds fault injection capabilities to k6. It implements the principles of the Chaos Engineering discipline to test the reliability of our applications under turbulent conditions such as delays and response errors.
99

10-
xk6-disruptor intends to help testers approach the discipline of "Chaos Engineering" with k6 way&mdash;providing the best developer experience as a primary objective.
10+
Key features include:
1111

12-
The extension offers an [API](/javascript-api/xk6-disruptor/api/) to create disruptors that target one specific type of component (for example, Pods).
13-
These disruptors can inject different types of [faults](/javascript-api/xk6-disruptor/api/faults), such as errors in HTTP requests, served by that component.
14-
Currently, disruptors exist for [Pods](/javascript-api/xk6-disruptor/api/poddisruptor) and [Services](/javascript-api/xk6-disruptor/api/servicedisruptor), but others will be introduced in the future, along with other types of faults for existing disruptors.
12+
- Everything as code. Facilitate test reuse and collaboration between teams without learning a new DSL.
13+
- Fast to adopt with no day-two surprises. [No need to deploy and maintain](/javascript-api/xk6-disruptor/explanations/how-xk6-disruptor-works/) a fleet of agents or operators.
14+
- Easy to extend and integrate with other types of k6 tests. No need to try to glue multiple tools together to get the job done.
1515

16-
<Blockquote mod="note">
16+
## Capabilities
1717

18-
xk6-disruptor is intended for systems running in Kubernetes. Other platforms are not supported at this time.
18+
Currently, the disruptor is intended to test applications running in Kubernetes. Other platforms are not supported at this time.
1919

20-
</Blockquote>
20+
It provides a Javascript API to inject different [faults](/javascript-api/xk6-disruptor/api/faults/) in HTTP and gRPC requests, such as errors and delays, into the selected Kubernetes [Pods](javascript-api/xk6-disruptor/api/poddisruptor) or [Services](/javascript-api/xk6-disruptor/api/servicedisruptor).
2121

22-
## Use case for xk6-disruptor
22+
Other types of faults and disruptors will be introduced in the future. The [Roadmap](https://github.com/grafana/xk6-disruptor/blob/main/ROADMAP.md) presents the project's goals for the coming months regarding new functionalities and enhancements.
2323

24-
The main use case for xk6-disruptor is to test how resilient an application is to diverse types of disruptions. xk6-disruptor can reproduce the effects of these disruptions, without having to reproduce their root causes.
25-
For example, you can inject delays in the HTTP requests that an application makes to a service without having to stress or interfere with the infrastructure (network, nodes) on which the service runs.
24+
```javascript
25+
export default function () {
26+
// Create a new pod disruptor with a selector
27+
// that matches pods from the "default" namespace with the label "app=my-app"
28+
const disruptor = new PodDisruptor({
29+
namespace: "default",
30+
select: { labels: { "app.kubernetes.io/name": "my-app" } },
31+
});
2632

27-
In this way, xk6-disruptor makes reliability tests repeatable, predictable, and with a limited blast radius.
28-
These characteristics make it easier to incorporate such tests into the test suites of applications that deploy on shared infrastructures (such as staging environments).
33+
// Check that there is at least one target
34+
const targets = disruptor.targets();
35+
if (targets.length === 0) {
36+
throw new Error("expected list to have one target");
37+
}
2938

39+
// Disrupt the targets by injecting HTTP faults into them for 30 seconds
40+
const fault = {
41+
averageDelay: 500,
42+
errorRate: 0.1,
43+
errorCode: 500
44+
}
45+
disruptor.injectHTTPFaults(fault, "30s")
46+
}
47+
```
3048

31-
<Blockquote mod="attention">
49+
## Use cases
3250

33-
xk6-disruptor is in the alpha phase, undergoing active development. k6 doesn't guarantee API compatibility between releases.
34-
Until this extension reaches v1.0 release, your k6 scripts may need to be updated on each release .
51+
The disruptor lets you test the resiliency of distributed applications by introducing errors in the requests served by your services.
3552

36-
</Blockquote>
53+
The disruptor does not try to reproduce root causes, such as failed application instances or degraded computing or network resources.
54+
It focuses on reproducing the side effects of such failures, so you can focus on understanding the propagation of errors between internal and public services and improving the error handling in your application.
3755

38-
## Try out xk6-disruptor on our demo environment
56+
This way, the disruptor makes reliability tests repeatable and predictable while limiting their blast radius.
57+
These are essentials to test applications deployed on shared infrastructures such as pre-production and testing environments.
3958

40-
We provide an [interactive demo environment in Killercoda](https://killercoda.com/grafana-xk6-disruptor/scenario/killercoda) which you can use to try xk6-disruptor right away without having to install Kubernetes on your local machine.
59+
Common use cases are:
60+
- Test resilient policies such as backoff, timeouts, retries, etc.
61+
- Test the fallback functionality when internal failures arise.
62+
- Test SLOs under common internal failures.
63+
- Test application performance when experiencing delays.
64+
- Add fault injection to existing performance tests.
4165

42-
You can use this sandbox to try out xk6-disruptor and start writing fault injection on a microservices application right away.
66+
## Learn more
4367

44-
## Install xk6-disruptor on your environment
68+
Check the [requirements](/javascript-api/xk6-disruptor/requirements/), [installation](/javascript-api/xk6-disruptor/installation/), and [how to expose your application](/javascript-api/xk6-disruptor/expose-your-application/) to get started with the disruptor.
4569

46-
1. Check the [requirements](/javascript-api/xk6-disruptor/get-started/requirements).
70+
This documentation presents a few [examples of injecting faults in different scenarios](/javascript-api/xk6-disruptor/examples/).
71+
72+
Also, an [interactive demo environment in Killercoda](https://killercoda.com/grafana-xk6-disruptor/scenario/killercoda) is available to use the k6 disruptor right away. You can fail the services of a demo application without having to install Kubernetes on your local machine.
73+
74+
For any unexpected behavior, please search the [GitHub issues](https://github.com/grafana/xk6-disruptor/issues) first.
75+
76+
And if you are interested in contributing to the development of this project, check the [contributing guide](https://github.com/grafana/xk6-disruptor/blob/main/docs/01-development/01-contributing.md).
4777

48-
2. [Install](/javascript-api/xk6-disruptor/get-started/installation) the xk6-disrutor binary in your system.
4978

50-
3. Run the [Injecting HTTP faults to a Pod](/javascript-api/xk6-disruptor/examples/inject-http-faults-into-pod) example.

0 commit comments

Comments
 (0)