Skip to main content

ELB AZ down

ELB AZ down takes down the AZ (availability zones) on a target ELB for a specific duration.

  • It restricts access to certain availability zones for a specific duration.
  • It tests the application sanity, availability, and recovery workflows of the application pod attached to the load balancer.

ELB AZ Down

Uses

View the uses of the fault
This fault breaks the connectivity of an ELB with the given zones and impacts their delivery. Detaching the AZ from the load balancer disrupts an application's performance.

Prerequisites

  • Kubernetes > 1.17
  • AWS access to attach or detach an AZ from ELB.
  • Minimum number of AZ is attached to the ELB, else the fault fails to detach the given AZ.
  • Kubernetes secret that has the AWS access configuration(key) in the CHAOS_NAMESPACE. A sample secret file looks like:
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
  • If you change the secret key name (from cloud_config.yml), update the AWS_SHARED_CREDENTIALS_FILE environment variable value on fault.yamlwith the same name.

Permissions required

Here is an example AWS policy to execute the fault.

View policy for the fault
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeInstanceStatus",
"ec2:DescribeInstances",
"ec2:DescribeSubnets",
"elasticloadbalancing:DetachLoadBalancerFromSubnets",
"elasticloadbalancing:AttachLoadBalancerToSubnets",
"elasticloadbalancing:DescribeLoadBalancers"
],
"Resource": "*"
}
]
}

Refer to the superset permission/policy to execute all AWS faults.

Default validations

The ELB is attached to the given availability zones.

Fault tunables

Fault tunables

Mandatory fields

Variables Description Notes
LOAD_BALANCER_NAME Provide the name of load balancer whose AZ has to be detached For example, elb-name
ZONES Provide the target zones that have to be detached from ELB For example, us-east-1a
REGION The region name for the target volumes For example, us-east-1

Optional fields

Variables Description Notes
TOTAL_CHAOS_DURATION The time duration for chaos insertion (in seconds) Defaults to 30s
CHAOS_INTERVAL The time duration between the attachment and detachment of the volumes (sec) Defaults to 30s
SEQUENCE It defines sequence of chaos execution for multiple volumes Default value: parallel. Supported: serial, parallel
RAMP_TIME Period to wait before and after injection of chaos in sec For example, 30

Fault examples

Common and AWS-specific tunables

Refer to the common attributes and AWS-specific tunables to tune the common tunables for all faults and aws specific tunables.

Target zones

It contains comma-separated list of target zones. You can tune it using the ZONES environment variable.

Use the following example to tune it:

# contains elb az down for given zones
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
chaosServiceAccount: litmus-admin
experiments:
- name: elb-az-down
spec:
components:
env:
# load balancer name for chaos
- name: LOAD_BALANCER_NAME
value: 'tes-elb'
# target zones for the chaos
- name: ZONES
value: 'us-east-1a,us-east-1b'
# region for chaos
- name: REGION
value: 'us-east-1'