-
Notifications
You must be signed in to change notification settings - Fork 0
/
experiment_runner_internal.sh
executable file
·108 lines (105 loc) · 4.2 KB
/
experiment_runner_internal.sh
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/usr/bin/env bash
echo "------------------------------------------------------------------------"
echo "------------------------------------------------------------------------"
echo "------------------------------------------------------------------------"
echo "Webapp type is $1"
echo "Scaling metric is $2 - from cpu/rps"
echo "Workload type $3 - from zigzag,ladder,spiky"
echo "Initial num instances is $4"
echo "starting"
kubectl get hpa
kubectl get deployments
kubectl delete hpa hpa-$1
kubectl delete -n default deployment autoscaler-$1
kubectl describe cronjob gatling-$1-cron
echo "------------------------------------------------------------------------"
echo "------------------------------------------------------------------------"
echo "------------------------------------------------------------------------"
echo "Starting the workloads with no auto-scaling"
date
kubectl get deployment $1
kubectl scale -n default deployment $1 --replicas=$4
sleep 90s
kubectl get deployment $1
# log the gatling simulation
cat platform/kubernetes/gatling/configmap-gatling-custom-simulation-def.yaml
## sleep 479 minutes - in seconds
echo ""
date
echo "sleeping..."
sleep 29480
date
echo "------------------------------------------------------------------------"
echo "------------------------------------------------------------------------"
echo "------------------------------------------------------------------------"
echo "Starting workloads against the Kubescale hybrid autoscaler"
# clean up the old deployments
kubectl delete hpa hpa-$1
kubectl delete -n default deployment autoscaler-$1
kubectl get hpa
kubectl get deployments
cat platform/kubernetes/autoscaler-experiment-configs/kubescale-proactive/$2/configmap-autoscaler-proactive-$2-$3-$1.yaml
kubectl apply -f platform/kubernetes/autoscaler-experiment-configs/kubescale-proactive/$2/configmap-autoscaler-proactive-$2-$3-$1.yaml
# start the auto-scaler
kubectl apply -f deployment-autoscaler-$1.yaml
## sleep 209 minutes - in seconds
echo ""
date
echo "sleeping..."
sleep 12540
echo "done with sleeping"
date
kubectl delete -n default deployment autoscaler-$1
kubectl delete hpa hpa-$1
sleep 15
kubectl get hpa
kubectl get deployments
echo "------------------------------------------------------------------------"
echo "------------------------------------------------------------------------"
echo "------------------------------------------------------------------------"
echo "------------------------------------------------------------------------"
echo "------------------------------------------------------------------------"
echo "Starting workloads against the reactive component of Kubescale autoscaler"
# log the auto-scaler configiguration
cat platform/kubernetes/autoscaler-experiment-configs/kubescale-reactive/$2/configmap-autoscaler-reactive-$2-$3-$1.yaml
kubectl apply -f platform/kubernetes/autoscaler-experiment-configs/kubescale-reactive/$2/configmap-autoscaler-reactive-$2-$3-$1.yaml
# start the reactive auto-scaler
kubectl apply -f deployment-autoscaler-$1.yaml
kubectl rollout -n default restart deployment autoscaler-$1
## sleep 209 minutes - in seconds
echo ""
date
echo "sleeping..."
sleep 12540
echo "done with sleeping"
date
kubectl delete deployment autoscaler-$1
kubectl delete hpa hpa-$1
kubectl delete -n default deployment autoscaler-$1
kubectl delete hpa hpa-$1
sleep 15
kubectl get hpa
kubectl get deployments
echo "------------------------------------------------------------------------"
echo "------------------------------------------------------------------------"
echo "------------------------------------------------------------------------"
echo "------------------------------------------------------------------------"
echo "------------------------------------------------------------------------"
echo "Starting workloads against the Kubernetes Horizontal Pod autoscaler (HPA)"
# log the HPA auto-scaler configiguration
cat hpa/hpa-$2-$3-$1.yaml
# start the HPA auto-scaler
kubectl apply -f platform/kubernetes/horizontal-pod-autoscaler/hpa-$2-$3-$1.yaml
## sleep 209 minutes - in seconds
echo ""
date
echo "sleeping..."
sleep 12540
echo "done with sleeping"
kubectl delete hpa hpa-$1
sleep 15
kubectl delete hpa hpa-$1
kubectl get hpa
kubectl get deployments
date
echo "ended"