Skip to main content

Pod autoscaler

Pod autoscaler is a Kubernetes pod-level chaos fault that determines whether nodes can accomodate multiple replicas of a given application pod.

  • It examines the node auto-scaling feature by determining whether the pods were successfully rescheduled within a specified time frame if the existing nodes are running at the specified limits.

Pod Autoscaler

Usage

View fault usage
This fault determines how an application accomodates multiple replicas of a given application pod at unexpected point in time.

Prerequisites

  • Kubernetes > 1.16.

Default validations

The application pods should be in running state before and after chaos injection.

Fault tunables

Fault tunables

Optional fields

Variables Description Notes
REPLICA_COUNT Number of replicas to which you wish to scale. nil

Optional fields

Variables Description Notes
TOTAL_CHAOS_DURATION Duration that you specify, through which chaos is injected into the target resource (in seconds). Defaults to 60s.
RAMP_TIME Period to wait before and after injecting chaos (in seconds). For example, 30s.

Fault examples

Common and pod-specific tunables

Refer to the common attributes and pod-specific tunables to tune the common tunables for all fault and pod specific tunables.

Replica counts

It defines the number of replicas that are required to be present in the target application during chaos. You can tune it using the REPLICA_COUNT environment variable.

Use the following example to tune it:

# provide the number of replicas
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: litmus-admin
experiments:
- name: pod-autoscaler
spec:
components:
env:
# number of replica, needs to scale
- name: REPLICA_COUNT
value: "3"
- name: TOTAL_CHAOS_DURATION
VALUE: "60"