-
Notifications
You must be signed in to change notification settings - Fork 176
Expand file tree
/
Copy pathlaunch_central.sh
More file actions
executable file
·26 lines (19 loc) · 1.02 KB
/
launch_central.sh
File metadata and controls
executable file
·26 lines (19 loc) · 1.02 KB
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
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
local_port=${1:-8000}
export STORAGE=pvc
export STORAGE_SIZE=100
# This is GKE specific so we may need to be careful in the future
if kubectl version -o json | jq .serverVersion.gitVersion | grep "gke" > /dev/null; then
echo "Setting storage class to faster"
export STORAGE_CLASS=faster
fi
# Launch Central
$DIR/../../deploy/k8s/central.sh
kubectl -n stackrox set env deploy/central MUTEX_WATCHDOG_TIMEOUT_SECS=0 ROX_SCALE_TEST=true
if [[ $(kubectl get nodes -o json | jq '.items | length') == 1 ]]; then
exit 0
fi
kubectl -n stackrox patch deploy/central -p '{"spec":{"template":{"spec":{"containers":[{"name":"central","resources":{"requests":{"memory":"16Gi","cpu":"8"},"limits":{"memory":"16Gi","cpu":"8"}}}]}}}}'
kubectl -n stackrox patch deploy/central-db -p '{"spec":{"template":{"spec":{"containers":[{"name":"central-db","resources":{"requests":{"memory":"32Gi","cpu":"16"},"limits":{"memory":"32Gi","cpu":"16"}}}]}}}}'
$DIR/port-forward.sh "${local_port}"