forked from docc-lab/train-ticket-k8s-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-train-ticket.sh
executable file
·60 lines (43 loc) · 1.76 KB
/
setup-train-ticket.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
#!/bin/bash
set -x
. "`dirname $0`/setup-lib.sh"
if [ -f $OURDIR/train-ticket-done ]; then
exit 0
fi
logtstart "train-ticket"
# Variables
REPO_URL="https://github.com/docc-lab/train-ticket.git"
EBS_URL="https://openebs.github.io/charts"
GEN_URL="https://github.com/docc-lab/train-ticket-auto-query.git"
echo "setup trainticket in k8s"
# setup dependencies, including local PVC with helm
sudo helm repo add openebs $EBS_URL
sudo helm repo update
sudo helm install openebs --namespace openebs openebs/openebs --create-namespace
# Clone the repository
cd /local
git clone -b cacti-exp $REPO_URL
# Setup kubernetes cluster
kubectl label nodes node-1 skywalking=true # Setup dedicated node for skywalking
kubectl taint nodes node-1 dedicated=skywalking:NoSchedule
cd /local/train-ticket/
sudo make deploy DeployArgs="--with-tracing"
# Replace buggy travel seervice with fixed image
kubectl set image "deployment/ts-travel-service" "ts-travel-service=docclabgroup/ts-travel-service:cacti-exp1.0"
kubectl set image "deployment/ts-order-service" "ts-order-service=docclabgroup/ts-order-service:cacti-exp1.0"
kubectl set image "deployment/ts-gateway-service" "ts-gateway-service=docclabgroup/ts-gateway-service:cacti-exp1.0"
kubectl set image "deployment/ts-cancel-service" "ts-cancel-service=docclabgroup/ts-cancel-service:exp-dev0.1"
kubectl set image "deployment/ts-basic-service" "ts-basic-service=docclabgroup/ts-basic-service:exp-dev0.2"
# Setup concurrent load generator
cd /local
git clone $GEN_URL
sudo apt install -y golang-go
cd /local/train-ticket-auto-query/tt-concurrent-load-generator
go mod tidy
go build
# Install maven for building train-ticket
sudo apt install -y maven
echo "train-ticket-k8s setup complete"
logtend "train-ticket"
touch $OURDIR/train-ticket-done
exit 0