ECS instance stop induces stress on an AWS ECS cluster. It derives the instance under chaos from the ECS cluster.
- It causes EC2 instance to stop and get deleted from the ECS cluster for a specific duration.
View fault usage
- Kubernetes >= 1.17
- Adequate AWS access to stop and start an EC2 instance.
- Create a Kubernetes secret that has the AWS access configuration(key) in the
CHAOS_NAMESPACE. Below is a sample secret file:
# Add the cloud AWS credentials respectively
aws_access_key_id = XXXXXXXXXXXXXXXXXXX
aws_secret_access_key = XXXXXXXXXXXXXXX
- If you change the secret key name (from
cloud_config.yml), ensure that you update the
AWS_SHARED_CREDENTIALS_FILEenvironment variable in the chaos experiment with the new name.
Here is an example AWS policy to execute the fault.
View policy for the fault
Refer to the superset permission/policy to execute all AWS faults.
The ECS container instance should be in a healthy state.
|CLUSTER_NAME||Name of the target ECS cluster||For example, cluster-1|
|REGION||The region name of the target ECS cluster||For example, us-east-1|
|TOTAL_CHAOS_DURATION||Duration that you specify, through which chaos is injected into the target resource (in seconds).||Defaults to 30s.|
|CHAOS_INTERVAL||The interval (in sec) between successive instance termination.||Defaults to 30s|
|AWS_SHARED_CREDENTIALS_FILE||Provide the path for aws secret credentials|| Defaults to |
|EC2_INSTANCE_ID||Provide the target instance ID from ECS cluster||If not provided will select randomly|
|SEQUENCE||It defines sequence of chaos execution for multiple instance||Defaults to parallel. Supports serial sequence as well.|
|RAMP_TIME||Period to wait before and after injecting chaos (in seconds).||For example, 30|
Common and AWS-specific tunables
ECS Instance Stop
It stops the instance of an ECS cluster for a certain chaos duration. We can provide the EC2 instance ID using
EC2_INSTANCE_ID ENVs as well. If not provided it will select randomly.
Use the following example to tune it:
# stops the agent of an ECS cluster
- name: ecs-instance-stop
# provide the name of ECS cluster
- name: CLUSTER_NAME
- name: EC2_INSTANCE_ID
- name: TOTAL_CHAOS_DURATION