Skip to content

Commit

Permalink
Merge pull request #150 from harness/fix-all-faults
Browse files Browse the repository at this point in the history
chore(chaos): Update 'experiment' to 'fault' in fault docs and update tutorials
  • Loading branch information
SmritiSatya authored Dec 7, 2022
2 parents 79b232e + 4171b3a commit 9e1787f
Show file tree
Hide file tree
Showing 143 changed files with 895 additions and 947 deletions.

This file was deleted.

40 changes: 40 additions & 0 deletions docs/chaos-engineering/chaos-faults/aws/aws-fault-tunables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: Common AWS Fault Tunables
---
AWS specific fault tunables.

### Managed Nodegroup

It specifies whether or not AWS EC2 instances are part of managed nodeGroups. If instances belong to the managed nodeGroups then provide `MANAGED_NODEGROUP` as `enable` else provide it as `disable`. The default value is `disabled`.

Use the following example to tune this:

[embedmd]:# (./static/manifests/common/managed-nodegroup.yaml yaml)
```yaml
# it provided as enable if instances are part of self managed groups
# it is applicable for [ec2-terminate-by-id, ec2-terminate-by-tag]
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: ec2-terminate-by-tag
spec:
components:
env:
# if instance is part of a managed node-group
# supports enable and disable values, default value: disable
- name: MANAGED_NODEGROUP
value: 'enable'
# region for the EC2 instance
- name: REGION
value: 'us-east-1'
# tag of the EC2 instance
- name: INSTANCE_TAG
value: 'key:value'
- name: TOTAL_CHAOS_DURATION
VALUE: '60'
```
22 changes: 11 additions & 11 deletions docs/chaos-engineering/chaos-faults/aws/ebs-loss-by-id.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ title: EBS Loss By ID
---

## Introduction
- It causes chaos to disrupt state of ebs volume by detaching it from the node/ec2 instance for a certain chaos duration using volume id.
- In case of EBS persistent volumes, the volumes can get self-attached and experiment skips the re-attachment step.
- It causes chaos to disrupt state of EBS volume by detaching it from the node/EC2 instance for a certain chaos duration using volume id.
- In case of EBS persistent volumes, the volumes can get self-attached and the re-attachment step is skipped.
Tests deployment sanity (replica availability & uninterrupted service) and recovery workflows of the application pod.

:::tip Fault execution flow chart
Expand All @@ -25,7 +25,7 @@ Coming soon.

:::info
- Ensure that Kubernetes Version > 1.16.
- Ensure that you have sufficient AWS access to attach or detach an ebs volume for the instance.
- Ensure that you have sufficient AWS access to attach or detach an EBS volume for the instance.
- Ensure to create a Kubernetes secret having the AWS access configuration(key) in the `CHAOS_NAMESPACE`. A sample secret file looks like:
```yaml
apiVersion: v1
Expand All @@ -40,7 +40,7 @@ stringData:
aws_access_key_id = XXXXXXXXXXXXXXXXXXX
aws_secret_access_key = XXXXXXXXXXXXXXX
```
- If you change the secret key name (from `cloud_config.yml`) please also update the `AWS_SHARED_CREDENTIALS_FILE` ENV value on `experiment.yaml`with the same name.
- If you change the secret key name (from `cloud_config.yml`) please also update the `AWS_SHARED_CREDENTIALS_FILE` ENV value in the ChaosExperiment CR with the same name.
:::

## Default Validations
Expand All @@ -49,7 +49,7 @@ stringData:
- EBS volume is attached to the instance.
:::

## Experiment tunables
## Fault Tunables

<details>
<summary>Check the Fault Tunables</summary>
Expand All @@ -62,7 +62,7 @@ stringData:
</tr>
<tr>
<td> EBS_VOLUME_ID </td>
<td> Comma separated list of volume IDs subjected to ebs detach chaos</td>
<td> Comma separated list of volume IDs subjected to EBS detach chaos</td>
<td> Eg. ebs-vol-1,ebs-vol-2 </td>
</tr>
<tr>
Expand Down Expand Up @@ -105,17 +105,17 @@ stringData:

### Common and AWS specific tunables

Refer the [common attributes](../common-tunables-for-all-experiments) and [AWS specific tunable](./aws-experiments-tunables) to tune the common tunables for all faults and aws specific tunables.
Refer the [common attributes](../common-tunables-for-all-faults) and [AWS specific tunable](./aws-fault-tunables) to tune the common tunables for all faults and aws specific tunables.

### Detach Volumes By ID

It contains comma separated list of volume IDs subjected to ebs detach chaos. It can be tuned via `EBS_VOLUME_ID` ENV.
It contains comma separated list of volume IDs subjected to EBS detach chaos. It can be tuned via `EBS_VOLUME_ID` ENV.

Use the following example to tune this:

[embedmd]:# (./static/manifests/ebs-loss-by-id/ebs-volume-id.yaml yaml)
```yaml
# contains ebs volume id
# contains EBS volume ID
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
Expand All @@ -128,10 +128,10 @@ spec:
spec:
components:
env:
# id of the ebs volume
# ID of the EBS volume
- name: EBS_VOLUME_ID
value: 'ebs-vol-1'
# region for the ebs volume
# region for the EBS volume
- name: REGION
value: 'us-east-1'
- name: TOTAL_CHAOS_DURATION
Expand Down
34 changes: 17 additions & 17 deletions docs/chaos-engineering/chaos-faults/aws/ebs-loss-by-tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ title: EBS Loss By Tag
---

## Introduction
- It causes chaos to disrupt state of ebs volume by detaching it from the node/ec2 instance for a certain chaos duration using volume tags.
- In case of EBS persistent volumes, the volumes can get self-attached and experiment skips the re-attachment step.
- It causes chaos to disrupt state of EBS volume by detaching it from the node/EC2 instance for a certain chaos duration using volume tags.
- In case of EBS persistent volumes, the volumes can get self-attached and the re-attachment step is skipped.
Tests deployment sanity (replica availability & uninterrupted service) and recovery workflows of the application pod.

:::tip Fault execution flow chart
Expand All @@ -26,7 +26,7 @@ Coming soon.
:::info

- Ensure that Kubernetes Version > 1.16.
- Ensure that you have sufficient AWS access to attach or detach an ebs volume for the instance.
- Ensure that you have sufficient AWS access to attach or detach an EBS volume for the instance.
- Ensure to create a Kubernetes secret having the AWS access configuration(key) in the `CHAOS_NAMESPACE`. A sample secret file looks like:
```yaml
apiVersion: v1
Expand All @@ -41,7 +41,7 @@ stringData:
aws_access_key_id = XXXXXXXXXXXXXXXXXXX
aws_secret_access_key = XXXXXXXXXXXXXXX
```
- If you change the secret key name (from `cloud_config.yml`) please also update the `AWS_SHARED_CREDENTIALS_FILE` ENV value on `experiment.yaml`with the same name.
- If you change the secret key name (from `cloud_config.yml`) please also update the `AWS_SHARED_CREDENTIALS_FILE` ENV value in the ChaosExperiment CR with the same name.
:::

## Default Validations
Expand All @@ -52,7 +52,7 @@ stringData:

:::

## Experiment tunables
## Fault Tunables

<details>
<summary>Check the Fault Tunables</summary>
Expand All @@ -66,7 +66,7 @@ stringData:
<tr>
<td> EBS_VOLUME_TAG </td>
<td> Provide the common tag for target volumes. It'll be in form of <code>key:value</code> (Ex: 'team:devops')</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> REGION </td>
Expand All @@ -83,7 +83,7 @@ stringData:
</tr>
<tr>
<td> VOLUME_AFFECTED_PERC </td>
<td> The Percentage of total ebs volumes to target </td>
<td> The Percentage of total EBS volumes to target </td>
<td> Defaults to 0 (corresponds to 1 volume), provide numeric value only </td>
</tr>
<tr>
Expand Down Expand Up @@ -113,17 +113,17 @@ stringData:

### Common and AWS specific tunables

Refer the [common attributes](../common-tunables-for-all-experiments) and [AWS specific tunable](./aws-experiments-tunables) to tune the common tunables for all faults and aws specific tunables.
Refer the [common attributes](../common-tunables-for-all-faults) and [AWS specific tunable](./aws-fault-tunables) to tune the common tunables for all faults and aws specific tunables.

### Target single volume

It will detach a random single ebs volume with the given `EBS_VOLUME_TAG` tag and `REGION` region.
It will detach a random single EBS volume with the given `EBS_VOLUME_TAG` tag and `REGION` region.

Use the following example to tune this:

[embedmd]:# (./static/manifests/ebs-loss-by-tag/ebs-volume-tag.yaml yaml)
```yaml
# contains the tags for the ebs volumes
# contains the tags for the EBS volumes
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
Expand All @@ -136,10 +136,10 @@ spec:
spec:
components:
env:
# tag of the ebs volume
# tag of the EBS volume
- name: EBS_VOLUME_TAG
value: 'key:value'
# region for the ebs volume
# region for the EBS volume
- name: REGION
value: 'us-east-1'
- name: TOTAL_CHAOS_DURATION
Expand All @@ -148,13 +148,13 @@ spec:

### Target Percent of volumes

It will detach the `VOLUME_AFFECTED_PERC` percentage of ebs volumes with the given `EBS_VOLUME_TAG` tag and `REGION` region.
It will detach the `VOLUME_AFFECTED_PERC` percentage of EBS volumes with the given `EBS_VOLUME_TAG` tag and `REGION` region.

Use the following example to tune this:

[embedmd]:# (./static/manifests/ebs-loss-by-tag/volume-affected-percentage.yaml yaml)
```yaml
# target percentage of the ebs volumes with the provided tag
# target percentage of the EBS volumes with the provided tag
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
Expand All @@ -167,13 +167,13 @@ spec:
spec:
components:
env:
# percentage of ebs volumes filter by tag
# percentage of EBS volumes filter by tag
- name: VOLUME_AFFECTED_PERC
value: '100'
# tag of the ebs volume
# tag of the EBS volume
- name: EBS_VOLUME_TAG
value: 'key:value'
# region for the ebs volume
# region for the EBS volume
- name: REGION
value: 'us-east-1'
- name: TOTAL_CHAOS_DURATION
Expand Down
Loading

0 comments on commit 9e1787f

Please sign in to comment.