-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscale.sh
More file actions
executable file
·22 lines (18 loc) · 758 Bytes
/
Copy pathscale.sh
File metadata and controls
executable file
·22 lines (18 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash
# Scales deployments and adds annotations so they appear in Gremlin automagically
scale=2
if ! [ -z "$1" ]; then
scale=$1
fi
echo "Scaling to $scale replicas"
deploys=(balancereader contacts frontend ledgerwriter transactionhistory userservice)
for deploy in "${deploys[@]}"
do
# Annotate for auto-discovery in Gremlin
kubectl annotate --overwrite deploy/$deploy gremlin.com/service-id=$deploy -n bank-of-anthos
# Scale up
kubectl scale --replicas=$scale deploy/$deploy -n bank-of-anthos
done
# Annotate StatefulSets
kubectl annotate --overwrite statefulset/accounts-db gremlin.com/service-id="accounts-db" -n bank-of-anthos
kubectl annotate --overwrite statefulset/ledger-db gremlin.com/service-id="ledger-db" -n bank-of-anthos