forked from PinSpace-Org/GistPin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-chaos-experiment.sh
More file actions
executable file
路31 lines (27 loc) 路 946 Bytes
/
Copy pathrun-chaos-experiment.sh
File metadata and controls
executable file
路31 lines (27 loc) 路 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
# Run a chaos engineering experiment
set -euo pipefail
EXPERIMENT="${1:-pod-failure}"
NAMESPACE="${NAMESPACE:-gistpin}"
DURATION="${DURATION:-60}"
echo "==> Starting chaos experiment: $EXPERIMENT (namespace=$NAMESPACE, duration=${DURATION}s)"
case "$EXPERIMENT" in
pod-failure)
bash "$(dirname "$0")/chaos-tests/pod-failure.sh" "$NAMESPACE" "$DURATION"
;;
network-latency)
bash "$(dirname "$0")/chaos-tests/network-latency.sh" "$NAMESPACE" "$DURATION"
;;
resource-exhaustion)
bash "$(dirname "$0")/chaos-tests/resource-exhaustion.sh" "$NAMESPACE" "$DURATION"
;;
failover)
bash "$(dirname "$0")/chaos-tests/failover.sh" "$NAMESPACE" "$DURATION"
;;
*)
echo "Unknown experiment: $EXPERIMENT"
echo "Available: pod-failure, network-latency, resource-exhaustion, failover"
exit 1
;;
esac
echo "==> Experiment '$EXPERIMENT' complete. Check logs for recovery validation."