Skip to content

Commit 96c2dc9

Browse files
add missing fault docs (#11544)
* add missing fault docs * wip * wip
1 parent 63b24c9 commit 96c2dc9

File tree

19 files changed

+1100
-0
lines changed

19 files changed

+1100
-0
lines changed

docs/chaos-engineering/faults/chaos-faults/aws/aws.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,36 @@ Windows EC2 network loss causes network packet loss on Windows VM for the target
11291129
- Simulates network partitions (split-brain) between peer replicas for a stateful application.
11301130
- It may stall the EC2 instance or get corrupted waiting endlessly for a packet.
11311131
- It degrades the network without marking the EC2 instance as unhealthy (or unworthy) of traffic, which is resolved using a middleware that switches traffic based on SLOs (performance parameters).
1132+
</Accordion>
1133+
</FaultDetailsCard>
1134+
1135+
<FaultDetailsCard category="aws">
1136+
1137+
### Windows EC2 Process Kill
1138+
1139+
Windows EC2 Process Kill fault kills the target processes running on a Windows EC2 instance. This fault disrupts application-critical processes running on the instance by killing their underlying processes or threads.
1140+
1141+
<Accordion color="green">
1142+
<summary>Use cases</summary>
1143+
1144+
- Simulate loss of processes on Windows EC2 instances to check the app resiliency
1145+
- Evaluate the impact of process loss on application performance.
1146+
1147+
</Accordion>
1148+
</FaultDetailsCard>
1149+
1150+
<FaultDetailsCard category="aws">
1151+
1152+
### Lambda Block TCP Connection
1153+
1154+
Lambda Block TCP Connection is an AWS fault that simulates network blocks for TCP connections of a Lambda function. This fault helps you evaluate how your application responds when outbound TCP connections from a Lambda function are blocked.
1155+
1156+
<Accordion color="green">
1157+
<summary>Use cases</summary>
11321158

1159+
- Simulate network blocks to test Lambda function resilience.
1160+
- Evaluate the impact of blocked TCP connections on application performance and error handling.
1161+
- Test fallback mechanisms and error reporting in serverless architectures.
11331162

11341163
</Accordion>
11351164
</FaultDetailsCard>

docs/chaos-engineering/faults/chaos-faults/aws/experiments.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,4 +435,18 @@ export const experiments: ExperimentDetails[] = [
435435
tags: ['memory', 'stress', 'windows'],
436436
category: "aws",
437437
},
438+
{
439+
name: "Windows EC2 Process Kill",
440+
description:
441+
"Windows EC2 Process Kill fault kills the target processes running on a Windows EC2 instance. This fault disrupts application-critical processes such as databases or message queues running on the instance by killing their underlying processes or threads.",
442+
tags: ['process', 'kill', 'windows', 'ec2'],
443+
category: "aws",
444+
},
445+
{
446+
name: "Lambda Block TCP Connection",
447+
description:
448+
"Lambda Block TCP Connection is an AWS fault that simulates network blocks for TCP connections of a Lambda function. This fault helps you evaluate how your application responds when outbound TCP connections from a Lambda function are blocked.",
449+
tags: ['lambda', 'tcp', 'network', 'block'],
450+
category: "aws",
451+
},
438452
];
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
---
2+
id: lambda-block-tcp-connection
3+
title: Lambda Block TCP Connection
4+
redirect_from:
5+
- /docs/chaos-engineering/technical-reference/chaos-faults/aws/lambda-block-tcp-connection
6+
- /docs/chaos-engineering/chaos-faults/aws/lambda-block-tcp-connection
7+
---
8+
9+
Lambda Block TCP Connection is an AWS fault that simulates network blocks for TCP connections of a Lambda function. This fault helps you evaluate how your application responds when outbound TCP connections from a Lambda function are blocked.
10+
11+
![Lambda Block TCP Connection](./static/images/lambda-inject-latency.png)
12+
13+
## Use cases
14+
- Simulate network blocks to test Lambda function resilience.
15+
- Evaluate the impact of blocked TCP connections on application performance and error handling.
16+
- Test fallback mechanisms and error reporting in serverless architectures.
17+
18+
### Prerequisites
19+
- Kubernetes >= 1.17
20+
- The Lambda function must be up and running.
21+
- Kubernetes secret must have the AWS access configuration (key) in the `CHAOS_NAMESPACE`. Below is a sample secret file:
22+
```yaml
23+
apiVersion: v1
24+
kind: Secret
25+
metadata:
26+
name: cloud-secret
27+
type: Opaque
28+
stringData:
29+
cloud_config.yml: |-
30+
# Add the cloud AWS credentials respectively
31+
[default]
32+
aws_access_key_id = XXXXXXXXXXXXXXXXXXX
33+
aws_secret_access_key = XXXXXXXXXXXXXXX
34+
```
35+
36+
:::tip
37+
HCE recommends that you use the same secret name, that is, `cloud-secret`. Otherwise, you will need to update the `AWS_SHARED_CREDENTIALS_FILE` environment variable in the fault template with the new secret name and you won't be able to use the default health check probes.
38+
:::
39+
40+
Below is an example AWS policy to execute the fault.
41+
42+
```json
43+
{
44+
"Version": "2012-10-17",
45+
"Statement": [
46+
{
47+
"Effect": "Allow",
48+
"Action": [
49+
"lambda:GetFunction",
50+
"lambda:GetFunctionConfiguration",
51+
"lambda:UpdateFunctionConfiguration"
52+
],
53+
"Resource": "*"
54+
}
55+
]
56+
}
57+
```
58+
59+
:::info note
60+
- Go to [superset permission/policy](/docs/chaos-engineering/faults/chaos-faults/aws/security-configurations/policy-for-all-aws-faults) to execute all AWS faults.
61+
- Go to the [common tunables](/docs/chaos-engineering/faults/chaos-faults/common-tunables-for-all-faults) and [AWS-specific tunables](/docs/chaos-engineering/faults/chaos-faults/aws/aws-fault-tunables) to tune the common tunables for all faults and AWS-specific tunables.
62+
- Go to [AWS named profile for chaos](/docs/chaos-engineering/faults/chaos-faults/aws/security-configurations/aws-switch-profile) to use a different profile for AWS faults.
63+
- Currently, it is supported in Python; support for other languages is coming soon.
64+
:::
65+
66+
### Mandatory tunables
67+
68+
<table>
69+
<caption>Lambda Chaos Fault Tunables</caption>
70+
<thead>
71+
<tr>
72+
<th>Tunable</th>
73+
<th>Description</th>
74+
<th>Notes</th>
75+
</tr>
76+
</thead>
77+
<tbody>
78+
<tr>
79+
<td>FUNCTION_NAME</td>
80+
<td>Name of the target Lambda function.</td>
81+
<td>For example, <code>test-function</code>. For more information, go to <a href="#function-name">function name</a>.</td>
82+
</tr>
83+
<tr>
84+
<td>REGION</td>
85+
<td>The AWS region where the Lambda function is deployed.</td>
86+
<td>For example, <code>us-east-1</code>. For more information, go to <a href="/docs/chaos-engineering/faults/chaos-faults/aws/aws-fault-tunables">region</a>.</td>
87+
</tr>
88+
<tr>
89+
<td>TARGET_HOSTNAMES</td>
90+
<td>Comma-separated list of hostnames to block TCP connections to.</td>
91+
<td>For example, <code>example.com,api.example.com</code>. For more information, go to <a href="#target-hostnames">target hostnames</a>.</td>
92+
</tr>
93+
</tbody>
94+
</table>
95+
96+
97+
### Optional tunables
98+
99+
<table>
100+
<caption>Common Chaos Tunables</caption>
101+
<thead>
102+
<tr>
103+
<th>Tunable</th>
104+
<th>Description</th>
105+
<th>Notes</th>
106+
</tr>
107+
</thead>
108+
<tbody>
109+
<tr>
110+
<td>TOTAL_CHAOS_DURATION</td>
111+
<td>Duration for which chaos is injected (in seconds).</td>
112+
<td>Default: 30 s. For more information, go to <a href="/docs/chaos-engineering/faults/chaos-faults/common-tunables-for-all-faults#duration-of-the-chaos">duration of the chaos</a>.</td>
113+
</tr>
114+
<tr>
115+
<td>CHAOS_INTERVAL</td>
116+
<td>The interval (in seconds) between successive network block attempts.</td>
117+
<td>Default: 30 s. For more information, go to <a href="/docs/chaos-engineering/faults/chaos-faults/common-tunables-for-all-faults#chaos-interval">chaos interval</a>.</td>
118+
</tr>
119+
<tr>
120+
<td>AWS_SHARED_CREDENTIALS_FILE</td>
121+
<td>Path to the AWS secret credentials.</td>
122+
<td>Default: <code>/tmp/cloud_config.yml</code>. For more information, go to <a href="/docs/chaos-engineering/faults/chaos-faults/aws/aws-fault-tunables">AWS shared credentials file</a>.</td>
123+
</tr>
124+
<tr>
125+
<td>RAMP_TIME</td>
126+
<td>Period to wait before and after injecting chaos (in seconds).</td>
127+
<td>Optional. For more information, go to <a href="/docs/chaos-engineering/faults/chaos-faults/common-tunables-for-all-faults#ramp-time">ramp time</a>.</td>
128+
</tr>
129+
</tbody>
130+
</table>
131+
132+
133+
#### Target Hostnames
134+
135+
The `TARGET_HOSTNAMES` environment variable defines the list of hostnames to which TCP connections should be blocked from the target Lambda function during chaos execution.
136+
137+
138+
Block TCP connections to specific hostnames from a Lambda function.
139+
140+
[embedmd]:# (./static/manifests/lambda-block-tcp-connection/target-hostnames.yaml yaml)
141+
```yaml
142+
---
143+
# Block TCP connections to specific hostnames from a Lambda function
144+
apiVersion: litmuschaos.io/v1alpha1
145+
kind: ChaosEngine
146+
metadata:
147+
name: lambda-block-tcp-connection
148+
spec:
149+
engineState: "active"
150+
chaosServiceAccount: litmus-admin
151+
experiments:
152+
- name: lambda-block-tcp-connection
153+
spec:
154+
components:
155+
env:
156+
- name: TARGET_HOSTNAMES
157+
value: 'example.com,api.example.com'
158+
```
159+
160+
#### Function Name
161+
162+
The `FUNCTION_NAME` environment variable specifies the name of the target AWS Lambda function whose host will be subjected to chaos.
163+
164+
[embedmd]:# (./static/manifests/lambda-block-tcp-connection/function-name.yaml yaml)
165+
```yaml
166+
---
167+
# Block TCP connections from a specific Lambda function
168+
apiVersion: litmuschaos.io/v1alpha1
169+
kind: ChaosEngine
170+
metadata:
171+
name: lambda-block-tcp-connection
172+
spec:
173+
engineState: "active"
174+
chaosServiceAccount: litmus-admin
175+
experiments:
176+
- name: lambda-block-tcp-connection
177+
spec:
178+
components:
179+
env:
180+
- name: FUNCTION_NAME
181+
value: 'test-function'
182+
```
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Block TCP connections from a specific Lambda function
2+
apiVersion: litmuschaos.io/v1alpha1
3+
kind: ChaosEngine
4+
metadata:
5+
name: lambda-block-tcp-connection
6+
spec:
7+
engineState: "active"
8+
chaosServiceAccount: litmus-admin
9+
experiments:
10+
- name: lambda-block-tcp-connection
11+
spec:
12+
components:
13+
env:
14+
- name: FUNCTION_NAME
15+
value: 'test-function'
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Block TCP connections to specific hostnames from a Lambda function
2+
apiVersion: litmuschaos.io/v1alpha1
3+
kind: ChaosEngine
4+
metadata:
5+
name: lambda-block-tcp-connection
6+
spec:
7+
engineState: "active"
8+
chaosServiceAccount: litmus-admin
9+
experiments:
10+
- name: lambda-block-tcp-connection
11+
spec:
12+
components:
13+
env:
14+
- name: TARGET_HOSTNAMES
15+
value: 'example.com,api.example.com'
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Kills processes by names with FORCE enabled on a Windows EC2 instance
2+
apiVersion: litmuschaos.io/v1alpha1
3+
kind: ChaosEngine
4+
metadata:
5+
name: windows-ec2-process-kill
6+
spec:
7+
engineState: "active"
8+
chaosServiceAccount: litmus-admin
9+
experiments:
10+
- name: windows-ec2-process-kill
11+
spec:
12+
components:
13+
env:
14+
- name: PROCESS_NAMES
15+
value: 'notepad'
16+
- name: FORCE
17+
value: 'enable'
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Kills processes by IDs on a Windows EC2 instance
2+
apiVersion: litmuschaos.io/v1alpha1
3+
kind: ChaosEngine
4+
metadata:
5+
name: windows-ec2-process-kill
6+
spec:
7+
engineState: "active"
8+
chaosServiceAccount: litmus-admin
9+
experiments:
10+
- name: windows-ec2-process-kill
11+
spec:
12+
components:
13+
env:
14+
- name: PROCESS_IDS
15+
value: '1234,5678'
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Kills processes by names on a Windows EC2 instance
2+
apiVersion: litmuschaos.io/v1alpha1
3+
kind: ChaosEngine
4+
metadata:
5+
name: windows-ec2-process-kill
6+
spec:
7+
engineState: "active"
8+
chaosServiceAccount: litmus-admin
9+
experiments:
10+
- name: windows-ec2-process-kill
11+
spec:
12+
components:
13+
env:
14+
- name: PROCESS_NAMES
15+
value: 'notepad,explorer'

0 commit comments

Comments
 (0)