forked from realopslabs/kubeledger
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-debug.sh
More file actions
executable file
·31 lines (27 loc) · 899 Bytes
/
run-debug.sh
File metadata and controls
executable file
·31 lines (27 loc) · 899 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
#!/bin/bash
set -u
set -e
if [ $# -ne 1 ]; then
echo -e "usage: \n\t`basename $0` <cluster_name>\n"
exit 1
fi
CLUSTER_NAME=$1
KOA_K8S_API_ENDPOINT=$(kubectl config view -o jsonpath="{.clusters[?(@.name==\"$CLUSTER_NAME\")].cluster.server}")
if [ "$KOA_K8S_API_ENDPOINT" == "" ]; then
echo "cannot find KOA_K8S_API_ENDPOINT"
exit 1
fi
KOA_K8S_AUTH_TOKEN=$(kubectl get secrets -o jsonpath="{.items[?(@.metadata.annotations['kubernetes\.io/service-account\.name']=='kube-opex-analytics')].data.token}"|base64 -d)
if [ "$KOA_K8S_AUTH_TOKEN" == "" ]; then
echo "cannot find KOA_K8S_AUTH_TOKEN"
exit 1
fi
export KOA_K8S_API_ENDPOINT
export KOA_K8S_AUTH_TOKEN=
export KOA_ENABLE_DEBUG=true
export KOA_K8S_API_VERIFY_SSL=false
export KOA_BILLING_HOURLY_RATE=9.92
export KOA_BILLING_CURRENCY_SYMBOL='$'
export KOA_COST_MODEL='CHARGE_BACK'
fuser -k 5483/tcp || true
./entrypoint.sh