-
Notifications
You must be signed in to change notification settings - Fork 201
add missing fault docs #11544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
add missing fault docs #11544
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
182 changes: 182 additions & 0 deletions
182
docs/chaos-engineering/faults/chaos-faults/aws/lambda-block-tcp-connection.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
--- | ||
id: lambda-block-tcp-connection | ||
title: Lambda Block TCP Connection | ||
redirect_from: | ||
- /docs/chaos-engineering/technical-reference/chaos-faults/aws/lambda-block-tcp-connection | ||
- /docs/chaos-engineering/chaos-faults/aws/lambda-block-tcp-connection | ||
--- | ||
|
||
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. | ||
|
||
 | ||
|
||
## Use cases | ||
- Simulate network blocks to test Lambda function resilience. | ||
- Evaluate the impact of blocked TCP connections on application performance and error handling. | ||
- Test fallback mechanisms and error reporting in serverless architectures. | ||
|
||
### Prerequisites | ||
- Kubernetes >= 1.17 | ||
- The Lambda function must be up and running. | ||
- Kubernetes secret must have the AWS access configuration (key) in the `CHAOS_NAMESPACE`. Below is a sample secret file: | ||
```yaml | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: cloud-secret | ||
type: Opaque | ||
stringData: | ||
cloud_config.yml: |- | ||
# Add the cloud AWS credentials respectively | ||
[default] | ||
aws_access_key_id = XXXXXXXXXXXXXXXXXXX | ||
aws_secret_access_key = XXXXXXXXXXXXXXX | ||
``` | ||
|
||
:::tip | ||
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. | ||
::: | ||
|
||
Below is an example AWS policy to execute the fault. | ||
|
||
```json | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Action": [ | ||
"lambda:GetFunction", | ||
"lambda:GetFunctionConfiguration", | ||
"lambda:UpdateFunctionConfiguration" | ||
], | ||
"Resource": "*" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
:::info note | ||
- Go to [superset permission/policy](/docs/chaos-engineering/faults/chaos-faults/aws/security-configurations/policy-for-all-aws-faults) to execute all AWS faults. | ||
- 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. | ||
- 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. | ||
- Currently, it is supported in Python; support for other languages is coming soon. | ||
::: | ||
|
||
### Mandatory tunables | ||
|
||
<table> | ||
<caption>Lambda Chaos Fault Tunables</caption> | ||
<thead> | ||
<tr> | ||
<th>Tunable</th> | ||
<th>Description</th> | ||
<th>Notes</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>FUNCTION_NAME</td> | ||
<td>Name of the target Lambda function.</td> | ||
<td>For example, <code>test-function</code>. For more information, go to <a href="#function-name">function name</a>.</td> | ||
</tr> | ||
<tr> | ||
<td>REGION</td> | ||
<td>The AWS region where the Lambda function is deployed.</td> | ||
<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> | ||
</tr> | ||
<tr> | ||
<td>TARGET_HOSTNAMES</td> | ||
<td>Comma-separated list of hostnames to block TCP connections to.</td> | ||
<td>For example, <code>example.com,api.example.com</code>. For more information, go to <a href="#target-hostnames">target hostnames</a>.</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
|
||
### Optional tunables | ||
|
||
<table> | ||
<caption>Common Chaos Tunables</caption> | ||
<thead> | ||
<tr> | ||
<th>Tunable</th> | ||
<th>Description</th> | ||
<th>Notes</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>TOTAL_CHAOS_DURATION</td> | ||
<td>Duration for which chaos is injected (in seconds).</td> | ||
<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> | ||
</tr> | ||
<tr> | ||
<td>CHAOS_INTERVAL</td> | ||
<td>The interval (in seconds) between successive network block attempts.</td> | ||
<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> | ||
</tr> | ||
<tr> | ||
<td>AWS_SHARED_CREDENTIALS_FILE</td> | ||
<td>Path to the AWS secret credentials.</td> | ||
<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> | ||
</tr> | ||
<tr> | ||
<td>RAMP_TIME</td> | ||
<td>Period to wait before and after injecting chaos (in seconds).</td> | ||
<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> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
|
||
#### Target Hostnames | ||
|
||
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. | ||
|
||
|
||
Block TCP connections to specific hostnames from a Lambda function. | ||
|
||
[embedmd]:# (./static/manifests/lambda-block-tcp-connection/target-hostnames.yaml yaml) | ||
```yaml | ||
--- | ||
# Block TCP connections to specific hostnames from a Lambda function | ||
apiVersion: litmuschaos.io/v1alpha1 | ||
kind: ChaosEngine | ||
metadata: | ||
name: lambda-block-tcp-connection | ||
spec: | ||
engineState: "active" | ||
chaosServiceAccount: litmus-admin | ||
experiments: | ||
- name: lambda-block-tcp-connection | ||
spec: | ||
components: | ||
env: | ||
- name: TARGET_HOSTNAMES | ||
value: 'example.com,api.example.com' | ||
``` | ||
|
||
#### Function Name | ||
|
||
The `FUNCTION_NAME` environment variable specifies the name of the target AWS Lambda function whose host will be subjected to chaos. | ||
|
||
[embedmd]:# (./static/manifests/lambda-block-tcp-connection/function-name.yaml yaml) | ||
```yaml | ||
--- | ||
# Block TCP connections from a specific Lambda function | ||
apiVersion: litmuschaos.io/v1alpha1 | ||
kind: ChaosEngine | ||
metadata: | ||
name: lambda-block-tcp-connection | ||
spec: | ||
engineState: "active" | ||
chaosServiceAccount: litmus-admin | ||
experiments: | ||
- name: lambda-block-tcp-connection | ||
spec: | ||
components: | ||
env: | ||
- name: FUNCTION_NAME | ||
value: 'test-function' | ||
``` |
15 changes: 15 additions & 0 deletions
15
...g/faults/chaos-faults/aws/static/manifests/lambda-block-tcp-connection/function-name.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Block TCP connections from a specific Lambda function | ||
apiVersion: litmuschaos.io/v1alpha1 | ||
kind: ChaosEngine | ||
metadata: | ||
name: lambda-block-tcp-connection | ||
spec: | ||
engineState: "active" | ||
chaosServiceAccount: litmus-admin | ||
experiments: | ||
- name: lambda-block-tcp-connection | ||
spec: | ||
components: | ||
env: | ||
- name: FUNCTION_NAME | ||
value: 'test-function' |
15 changes: 15 additions & 0 deletions
15
...aults/chaos-faults/aws/static/manifests/lambda-block-tcp-connection/target-hostnames.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Block TCP connections to specific hostnames from a Lambda function | ||
apiVersion: litmuschaos.io/v1alpha1 | ||
kind: ChaosEngine | ||
metadata: | ||
name: lambda-block-tcp-connection | ||
spec: | ||
engineState: "active" | ||
chaosServiceAccount: litmus-admin | ||
experiments: | ||
- name: lambda-block-tcp-connection | ||
spec: | ||
components: | ||
env: | ||
- name: TARGET_HOSTNAMES | ||
value: 'example.com,api.example.com' |
17 changes: 17 additions & 0 deletions
17
...-engineering/faults/chaos-faults/aws/static/manifests/windows-ec2-process-kill/force.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Kills processes by names with FORCE enabled on a Windows EC2 instance | ||
apiVersion: litmuschaos.io/v1alpha1 | ||
kind: ChaosEngine | ||
metadata: | ||
name: windows-ec2-process-kill | ||
spec: | ||
engineState: "active" | ||
chaosServiceAccount: litmus-admin | ||
experiments: | ||
- name: windows-ec2-process-kill | ||
spec: | ||
components: | ||
env: | ||
- name: PROCESS_NAMES | ||
value: 'notepad' | ||
- name: FORCE | ||
value: 'enable' |
15 changes: 15 additions & 0 deletions
15
...eering/faults/chaos-faults/aws/static/manifests/windows-ec2-process-kill/process-ids.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Kills processes by IDs on a Windows EC2 instance | ||
apiVersion: litmuschaos.io/v1alpha1 | ||
kind: ChaosEngine | ||
metadata: | ||
name: windows-ec2-process-kill | ||
spec: | ||
engineState: "active" | ||
chaosServiceAccount: litmus-admin | ||
experiments: | ||
- name: windows-ec2-process-kill | ||
spec: | ||
components: | ||
env: | ||
- name: PROCESS_IDS | ||
value: '1234,5678' |
15 changes: 15 additions & 0 deletions
15
...ring/faults/chaos-faults/aws/static/manifests/windows-ec2-process-kill/process-names.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Kills processes by names on a Windows EC2 instance | ||
apiVersion: litmuschaos.io/v1alpha1 | ||
kind: ChaosEngine | ||
metadata: | ||
name: windows-ec2-process-kill | ||
spec: | ||
engineState: "active" | ||
chaosServiceAccount: litmus-admin | ||
experiments: | ||
- name: windows-ec2-process-kill | ||
spec: | ||
components: | ||
env: | ||
- name: PROCESS_NAMES | ||
value: 'notepad,explorer' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.