Skip to content

Commit 5e1c2cd

Browse files
pablochacinRoberto Santalla
andauthored
Document Pod termination fault (#1381)
* Document Pod termination fault Signed-off-by: Pablo Chacin <[email protected]> --------- Signed-off-by: Pablo Chacin <[email protected]> Co-authored-by: Roberto Santalla <[email protected]>
1 parent e0c242d commit 5e1c2cd

File tree

6 files changed

+76
-0
lines changed

6 files changed

+76
-0
lines changed

src/data/markdown/docs/40 xk6-disruptor/03 API/01 Faults.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ A fault is as an abnormal condition that affects a system component and which ma
99
| ---------- | ---------- |
1010
| [gRPC Fault](/javascript-api/xk6-disruptor/api/faults/grpc) | Fault affecting gRPC requests from a target |
1111
| [HTTP Fault](/javascript-api/xk6-disruptor/api/faults/http) | Fault affecting HTTP requests from a target |
12+
| [Pod Termination Fault](/javascript-api/xk6-disruptor/api/faults/pod-termination) | Fault terminating a number of target Pods |
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: 'Pod Termination'
3+
excerpt: 'xk6-disruptor: Pod Termination Fault attributes'
4+
---
5+
6+
A Pod Termination Fault allows terminating either a fixed number or a percentage of the pods that matching a selector or back a service.
7+
8+
A Pod Termination fault is defined by the following attributes:
9+
10+
| Attribute | Type | Description |
11+
| ------------- | ------ | --------|
12+
| count | integer or percentage | the number of pods to be terminated. It can be specified as a integer number or as a percentage (e.g. `30%`) that defines the fraction of target pods to be terminated|
13+
14+
15+
<Blockquote mod="note">
16+
If the count is a percentage and there are no enough elements in the target pod list, the number is rounded up.
17+
For example '25%' of a list of 2 target pods will terminate one pod.
18+
If the list of target pods is not empty, at least one pod is always terminated.
19+
</Blockquote>
20+
21+
## Example
22+
23+
This example defines a PorTermination fault that will terminate `30%` of target pods
24+
```javascript
25+
const fault = {
26+
count: '30%'
27+
};
28+
```

src/data/markdown/docs/40 xk6-disruptor/03 API/02 PodDisruptor.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ To construct a `PodDisruptor`, use the [PodDisruptor() constructor](/javascript-
1414
| [PodDisruptor.injectGrpcFaults()](/javascript-api/xk6-disruptor/api/poddisruptor/injectgrpcfaults) | Inject [gRPC faults](/javascript-api/xk6-disruptor/api/faults/grpc) in the target Pods|
1515
| [PodDisruptor.injectHTTPFaults()](/javascript-api/xk6-disruptor/api/poddisruptor/injecthttpfaults) | Inject [HTTP faults](/javascript-api/xk6-disruptor/api/faults/http) in the target Pods|
1616
| PodDisruptor.targets() | Returns the list of target Pods of the PodDisruptor |
17+
| [PodDisruptor.terminatePods()](/javascript-api/xk6-disruptor/api/poddisruptor/terminatepods) | executes a [Pod Termination fault](/javascript-api/xk6-disruptor/api/faults/pod-termination) in the target Pods|
1718

1819

1920
## Example
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: 'terminatePods()'
3+
excerpt: 'xk6-disruptor: PodDisruptor.terminatePods method'
4+
---
5+
6+
`terminatePods` terminates a number of the pods matching the selector configured in the PodDisruptor.
7+
8+
| Parameter | Type | Description |
9+
| --------- | ------ |------- |
10+
| fault | object | description of the [Pod Termination fault](/javascript-api/xk6-disruptor/api/faults/pod-termination) |
11+
12+
13+
## Example
14+
15+
<!-- eslint-skip -->
16+
17+
```javascript
18+
const fault = {
19+
count: 2,
20+
}
21+
disruptor.terminatePods(fault)
22+
```

src/data/markdown/docs/40 xk6-disruptor/03 API/03 ServiceDisruptor.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ To construct a `ServiceDisruptor`, use the [ServiceDisruptor() constructor](/jav
1414
| ------ | ----------- |
1515
| [ServiceDisruptor.injectGrpcFaults()](/javascript-api/xk6-disruptor/api/servicedisruptor/injectgrpcfaults) | Inject [gRPC faults](/javascript-api/xk6-disruptor/api/faults/grpc) in the target Pods|
1616
| [ServiceDisruptor.injectHTTPFaults()](/javascript-api/xk6-disruptor/api/servicedisruptor/injecthttpfaults) | Inject [HTTTP faults](/javascript-api/xk6-disruptor/api/faults/http) in the target Pods|
17+
| ServiceDisruptor.targets() | Returns the list of target Pods of the ServiceDisruptor |
18+
| [ServiceDisruptor.terminatePods()](/javascript-api/xk6-disruptor/api/servicedisruptor/terminatepods) | executes a [Pod Termination fault](/javascript-api/xk6-disruptor/api/faults/pod-termination) in the target Pods|
1719

1820

1921
## Example
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: 'terminatePods()'
3+
excerpt: 'xk6-disruptor: ServiceDisruptor.terminatePods method'
4+
---
5+
6+
`terminatePods` terminates a number of pods that belong to the service specified in the ServiceDisruptor.
7+
8+
| Parameter | Type | Description |
9+
| --------- | ------ |------- |
10+
| fault | object | description of the [Pod Termination fault](/javascript-api/xk6-disruptor/api/faults/pod-termination) |
11+
12+
13+
## Example
14+
15+
<!-- eslint-skip -->
16+
17+
```javascript
18+
const fault = {
19+
count: 2,
20+
}
21+
disruptor.terminatePods(fault)
22+
```

0 commit comments

Comments
 (0)