-
Notifications
You must be signed in to change notification settings - Fork 9
/
neon-proxy.sh
executable file
·475 lines (417 loc) · 16.8 KB
/
neon-proxy.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
#!/bin/bash
OPERATOR_KEYS=()
DB_MIGRATION="false"
envs=("devnet","testnet","mainnet")
vault_types=("dev","standalone","ha")
VAR_FILE="config.ini"
[ "$(which kubectl)" ] || {
echo "ERROR: Kubectl not installed"
exit 1
}
[ "$(which helm)" ] || {
echo "ERROR: Helm not installed"
exit 1
}
[ "$(which jq)" ] || {
echo "ERROR: jq not installed"
exit 1
}
HELP="\nUsage: $0 [OPTION]...\n
-f, Variabels file \n
-i, Init setup \n
-r, Read-only mode\n
-S, SOLANA_URL\n
-p, Set postgres admin password (can be used only with -i option) \n
-v, Set vault root token (experemental) \n
-m, Use this option to set migrations\n
-k, Set keys directory \n
-y, Assume \"yes\" as answer, run non-interactively \n
"
## Get options
while getopts ":f:k:n:p:v:S:s:yhmird" opt; do
case $opt in
f) VAR_FILE=${OPTARG} ;;
k) CLI_KEY_DIR=${OPTARG} ;;
n) CLI_NAMESPACE=${OPTARG}`` ;;
p) CLI_POSTGRES_PASSWORD=${OPTARG} ;;
v) CLI_VAULT_ROOT_TOKEN=${OPTARG} ;;
S) CLI_SOLANA_URL=${OPTARG} ;;
y) FORCE_APPLY=1 ;;
m) DB_MIGRATION="true" ;;
i) FIRST_RUN="true";DB_MIGRATION="true" ;;
r) CLI_READONLY="true" ;;
d) DESTROY="true" ;;
h) echo -e $HELP;exit 0 ;;
*) echo "Invalid option -$OPTARG" >&2
exit 1
;;
esac
case $OPTARG in
-*) echo "Option $opt needs a valid argument"
echo -e $HELP
exit 1
;;
esac
done
[ $VAR_FILE ] || {
echo "ERROR: Please specify parameters file. Use -f key "
echo -e $HELP
exit 1
}
[ -f $VAR_FILE ] || {
echo "ERROR: ${VAR_FILE} does not exist."
exit 1
}
## Read *.ini file
source $VAR_FILE
PROXY_ENV=$(grep -Po 'PRX_\K.*' $VAR_FILE)
INDEXER_ENV=$(grep -Po 'IDX_\K.*' $VAR_FILE)
# Set values from a command line
[ ! $CLI_NAMESPACE ] || NAMESPACE=$CLI_NAMESPACE
[ ! $CLI_POSTGRES_PASSWORD ] || POSTGRES_ADMIN_PASSWD=$CLI_POSTGRES_PASSWORD
[ ! $CLI_VAULT_ROOT_TOKEN ] || VAULT_ROOT_TOKEN=$CLI_VAULT_ROOT_TOKEN
[ ! $CLI_SOLANA_URL ] || SOLANA_URL=$CLI_SOLANA_URL
[ ! $CLI_KEY_DIR ] || KEY_DIR=$CLI_KEY_DIR
[ ! $CLI_READONLY ] || PRX_ENABLE_SEND_TX_API="NO"
[ $VAULT_NAMESPACE ] || VAULT_NAMESPACE=$NAMESPACE
[ $MONITORING_NAMESPACE ] || MONITORING_NAMESPACE=$NAMESPACE
[ ! $DESTROY ] || {
read -p "Uninstall neon-proxy? [yes/no]: " -n 4 -r
[[ $REPLY != "yes" ]] || {
kubectl delete -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
kubectl delete ns $NAMESPACE
[[ $VAULT_ENABLED != "true" ]] || [[ "$VAULT_NAMESPACE" == "$NAMESPACE" ]] || kubectl delete ns $VAULT_NAMESPACE
[[ $MONITORING_ENABLED != "true" ]] || [[ "$MONITORING_NAMESPACE" == "$NAMESPACE" ]] || kubectl delete ns $MONITORING_NAMESPACE
kubectl delete MutatingWebhookConfiguration vault-agent-injector-cfg
}
exit 0
}
## Check variables
[ $FIRST_RUN ] || kubectl get ns $NAMESPACE > /dev/null || {
echo "Please run with -i opton"
echo -e $HELP
exit 1
}
[ ! -z "$SOLANA_URL" ] || {
echo "ERROR: SOLANA_URL cannot be empty! Use -S key to set SOLANA url"
echo -e $HELP
exit 1
}
[ ! -z "$SOLANA_URL" ] || {
echo "ERROR: SOLANA_URL cannot be empty! Use -S key to set SOLANA url"
echo -e $HELP
exit 1
}
## Check for operator keys
[[ $PRX_ENABLE_SEND_TX_API == "NO" ]] || [ "$(ls $KEY_DIR/$KEY_MASK 2>/dev/null)" ] || {
echo "ERROR: Keypairs not found in $KEY_DIR/"
echo "$KEY_DIR/KEY_MASK"
echo "Listing keys:"
ls $KEY_DIR/$KEY_MASK
exit 1
}
## Read key files to variable $OPERATOR_KEYS
[[ $PRX_ENABLE_SEND_TX_API == "NO" ]] || {
for k in $(awk '{print}' $KEY_DIR/$KEY_MASK );do OPERATOR_KEYS+=($k);done
}
[ $POSTGRES_HOST ] && [ $POSTGRES_DB ] && [ $POSTGRES_USER ] || {
echo -e "ERROR: Postgres credentials not specified. Check $VAR_FILE\n
POSTGRES_HOST=$POSTGRES_HOST
POSTGRES_DB=$POSTGRES_DB
POSTGRES_USER=$POSTGRES_USER\n"
exit 1
}
[[ $vault_types[*] =~ $VAULT_TYPE ]] || {
echo -e "ERROR: Unsupported vault type \"$VAULT_TYPE\".\nCheck $VAR_FILE ( VAULT_TYPE=...) "
echo -e $HELP
exit 1
}
function installVault() {
VAULT_CONFIG='ui = true
listener "tcp" {
tls_disable = 1
address = "[::]:8200"
cluster_address = "[::]:8201"
}
storage "postgresql" {
connection_url = "postgres://'${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}'/vault?sslmode='${POSTGRES_SSL}'"
ha_enabled = true
}'
echo "Instlling vault in $VAULT_TYPE mode"
if [[ $VAULT_TYPE = "dev" ]]
then
VAULT_ROOT_TOKEN="$VAULT_DEV_TOKEN"
helm upgrade --install --atomic vault hashicorp/vault -f vault/values.yaml \
--namespace=$VAULT_NAMESPACE --create-namespace --history-max 3 \
--set server.dev.devRootToken=$VAULT_ROOT_TOKEN \
--set server.dev.enabled=true
kubectl wait --for=condition=ready pod vault-0 -n ${VAULT_NAMESPACE}
elif [[ $VAULT_TYPE = "standalone" ]]
then
helm upgrade --install --atomic vault hashicorp/vault -f vault/values.yaml \
--namespace=$VAULT_NAMESPACE --create-namespace --history-max 3 \
--set server.dev.enabled=false \
--set server.standalone.enabled=true \
--set server.ha.enabled=false \
--set server.standalone.config="$VAULT_CONFIG" 1>/dev/null
sleep 20
kubectl -n ${VAULT_NAMESPACE} exec vault-0 -- vault operator init -key-shares=${VAULT_KEY_SHARED} -key-threshold=${VAULT_KEY_THRESHOLD} -format=json > $VAULT_KEYS_FILE
VAULT_UNSEAL_KEY="$(cat $VAULT_KEYS_FILE | jq -r '.unseal_keys_b64[]')"
VAULT_ROOT_TOKEN="$(cat $VAULT_KEYS_FILE | jq -r '.root_token')"
kubectl -n ${VAULT_NAMESPACE} exec vault-0 -- /bin/sh -c "vault operator unseal ${VAULT_UNSEAL_KEY}" 1>/dev/null
elif [[ $VAULT_TYPE = "ha" ]]
then
helm upgrade --install --atomic vault hashicorp/vault -f vault/values.yaml \
--namespace=$VAULT_NAMESPACE --create-namespace --history-max 3 \
--set server.dev.enabled=false \
--set server.standalone.enabled=false \
--set server.ha.enabled=true \
--set server.ha.config="$VAULT_CONFIG" 1>/dev/null
sleep 20
for i in $(seq 0 $((VAULT_HA_REPLICAS-1)))
do
kubectl -n ${VAULT_NAMESPACE} exec vault-$i -- /bin/sh -c "vault operator unseal ${VAULT_UNSEAL_KEY}" 1>/dev/null
done
kubectl -n ${VAULT_NAMESPACE} exec vault-0 -- vault operator init -key-shares=${VAULT_KEY_SHARED} -key-threshold=${VAULT_KEY_THRESHOLD} -format=json > $VAULT_KEYS_FILE
VAULT_UNSEAL_KEY="$(cat $VAULT_KEYS_FILE | jq -r '.unseal_keys_b64[]')"
VAULT_ROOT_TOKEN="$(cat $VAULT_KEYS_FILE | jq -r '.root_token')"
fi
}
## Get ready for start and show values
echo -e "You can run this script with -h option\n
------------- Values -------------
Namespase: $NAMESPACE
Keys directory: ${KEY_DIR} -- (found ${#OPERATOR_KEYS[@]} keys)
Proxy replicas: $PROXY_COUNT
Keys per proxy: $KEYS_PER_PROXY
Solana URL: $SOLANA_URL
------------- Modules -------------
POSTGRES_ENABLED=$POSTGRES_ENABLED
VAULT_ENABLED=$VAULT_ENABLED
NEON_PROXY_ENABLED=$NEON_PROXY_ENABLED
INGRESS_ENABLED=$INGRESS_ENABLED
\n"
## Simple check for keys and proxies values
[[ $PRX_ENABLE_SEND_TX_API == "NO" ]] || {
k=${#OPERATOR_KEYS[@]}
p=$PROXY_COUNT
kp=$(( k / p ))
[ $kp -gt 0 ] || {
echo "ERROR: The number of proxies cannot be more than the adjusted keys"
exit 1
}
}
## Ask user if they are satisfied with the launch options
[ $FORCE_APPLY ] || {
read -p "Continue? [y/N]" -n 1 -r
[[ $REPLY =~ ^[Yy]$ ]] || exit 0
}
# ## RUN
[[ $INGRESS_ENABLED != "true" ]] || helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
[[ $VAULT_ENABLED != "true" ]] || helm repo add hashicorp https://helm.releases.hashicorp.com ## Vault repo
[[ $PROMETHEUS_ENABLED != "true" ]] || helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
[[ $GRAFANA_ENABLED != "true" && $LOKI_ENABLED != "true" ]] || helm repo add grafana https://grafana.github.io/helm-charts
helm repo update
# ## 0. Create namespace
kubectl create namespace $NAMESPACE 2>/dev/null
# 1. Ingress-Nginx
[[ $INGRESS_ENABLED != "true" ]] || {
echo "Installing ingress-nginx..."
helm upgrade --install ingress-nginx ingress-nginx/ingress-nginx \
--namespace ingress-nginx --create-namespace \
--history-max 3 \
--set controller.service.type=$INGRESS_SERVICE_TYPE \
--set controller.service.nodePorts.http=32080 \
--set controller.service.nodePorts.https=32443 1>/dev/null
}
## 2. Postgres
[[ $POSTGRES_PASSWORD ]] || {
POSTGRES_PASSWORD=$(kubectl get secret postgres-secret --template={{.data.POSTGRES_PASSWORD}} -n $NAMESPACE 2>/dev/null | base64 --decode )
}
[[ $POSTGRES_PASSWORD ]] || {
POSTGRES_PASSWORD=$(date +%s | sha256sum | base64 | head -c 32 ; echo)
}
[[ $POSTGRES_ADMIN_PASSWD ]] || {
POSTGRES_ADMIN_USER=$POSTGRES_USER
POSTGRES_ADMIN_PASSWD=$POSTGRES_PASSWORD
}
echo "Installing Postgres..."
helm upgrade --install --atomic postgres postgres/ \
--namespace=$NAMESPACE \
--wait-for-jobs \
--history-max 3 \
--set postgres.enabled=$POSTGRES_ENABLED \
--set POSTGRES_ADMIN_USER=$POSTGRES_ADMIN_USER \
--set POSTGRES_ADMIN_PASSWD=$POSTGRES_ADMIN_PASSWD \
--set postgres.host=$POSTGRES_HOST \
--set postgres.dbName=$POSTGRES_DB \
--set postgres.user=$POSTGRES_USER \
--set postgres.password=$POSTGRES_PASSWORD \
--set service.port=$POSTGRES_PORT \
--set postgres.ssl=$POSTGRES_SSL \
--set postgres.maxConnections=1000 \
--set persistence.storageClass=$POSTGRES_STORAGE_CLASS \
--set persistence.size=$POSTGRES_STORAGE_SIZE \
--set migrate.enabled=$DB_MIGRATION 1>/dev/null
[[ $POSTGRES_ENABLED == "false" ]] || kubectl -n ${NAMESPACE} wait --for=condition=ready pod postgres-0 || {
echo "ERROR: Postgres installation failed"
exit 1
}
# ## 2. Vault
echo "Setup secrets..."
[[ ! $FIRST_RUN ]] || [[ $VAULT_ENABLED != "true" ]] || {
[[ ! -f "$VAULT_KEYS_FILE" ]] || {
echo "Found $VAULT_KEYS_FILE -- Backuping..."
cp $VAULT_KEYS_FILE ${VAULT_KEYS_FILE}_bkp
}
[[ $(kubectl -n ${VAULT_NAMESPACE} get po vault-0 2>/dev/null) ]] || {
echo "Run Vault installation"
installVault
}
}
echo "Check vault token"
[[ $VAULT_TYPE != "dev" ]] || VAULT_ROOT_TOKEN=$VAULT_DEV_TOKEN
[[ $VAULT_TYPE == "dev" ]] || {
[[ $VAULT_ROOT_TOKEN ]] || [[ ! -f "$VAULT_KEYS_FILE" ]] || VAULT_ROOT_TOKEN="$(cat $VAULT_KEYS_FILE | jq -r '.root_token')"
[[ $VAULT_UNSEAL_KEY ]] || [[ ! -f "$VAULT_KEYS_FILE" ]] || {
VAULT_UNSEAL_KEY="$(cat $VAULT_KEYS_FILE | jq -r '.unseal_keys_b64[]')"
[[ $VAULT_UNSEAL_KEY ]] || echo -e "\n###################\nWARNING: VAULT_UNSEAL_KEY no foud! Please make sure Vault is available\n###################\n"
kubectl -n ${VAULT_NAMESPACE} exec vault-0 -- /bin/sh -c "vault operator unseal ${VAULT_UNSEAL_KEY}"
}
[[ $VAULT_ROOT_TOKEN ]] || {
echo "ERROR: No VAULT_ROOT_TOKEN found"
exit 1
}
}
kubectl -n ${VAULT_NAMESPACE} wait --for=condition=ready pod vault-0 || {
echo "ERROR: Vault installation failed"
exit 1
}
kubectl -n ${VAULT_NAMESPACE} exec vault-0 -- /bin/sh -c "vault login $VAULT_ROOT_TOKEN" 1>/dev/null
[[ ! $FIRST_RUN ]] || {
echo "Setup vault"
kubectl -n ${VAULT_NAMESPACE} exec vault-0 -- /bin/sh -c "export NAMESPACE=$NAMESPACE && `cat vault/vault.sh`" 1>/dev/null
kubectl -n ${VAULT_NAMESPACE} exec vault-0 -- /bin/sh -c "vault write auth/kubernetes/role/${NAMESPACE} bound_service_account_names=neon-proxy-sa bound_service_account_namespaces=${NAMESPACE} policies=neon-proxy ttl=24h" 1>/dev/null
}
if [[ $PRX_ENABLE_SEND_TX_API == "YES" ]]
then
echo "Read operator keys"
id=0
for((i=0; i < ${#OPERATOR_KEYS[@]}; i+=$KEYS_PER_PROXY))
do
echo "Add keys for neon-proxy-${id}"
part=( "${OPERATOR_KEYS[@]:i:KEYS_PER_PROXY}" )
[ $id != 0 ] || kubectl -n ${VAULT_NAMESPACE} exec vault-0 -- /bin/sh -c "vault kv put neon-proxy/proxy neon-proxy-${id}=\"${part[*]}\"" 1>/dev/null
kubectl -n ${VAULT_NAMESPACE} exec vault-0 -- /bin/sh -c "vault kv patch neon-proxy/proxy neon-proxy-${id}=\"${part[*]}\"" 1>/dev/null
id=$((id+1))
done
fi
echo "Setup proxy env variables"
kubectl -n ${VAULT_NAMESPACE} exec vault-0 -- /bin/sh -c "echo '$PROXY_ENV' | xargs vault kv put neon-proxy/proxy_env" 1>/dev/null
echo "Setup indexer env variables"
kubectl -n ${VAULT_NAMESPACE} exec vault-0 -- /bin/sh -c "echo '$INDEXER_ENV' | xargs vault kv put neon-proxy/indexer_env" 1>/dev/null
## 3. Proxy
#[[ $NEON_PROXY_ENABLED != "true" ]] || {
# echo "Installing neon-proxy..."
# helm upgrade --install --atomic neon-proxy neon-proxy/ \
# --namespace=$NAMESPACE \
# --force \
# --history-max 3 \
# --set ingress.host=$PROXY_HOST \
# --set ingress.className=$INGRESS_CLASS \
# --set solanaUrl=$SOLANA_URL \
# --set proxyCount=$PROXY_COUNT \
# --set keysPerProxy=$KEYS_PER_PROXY \
# --set image.tag=$PROXY_VER \
# --set resources.requests.cpu=$PROXY_MIN_CPU \
# --set resources.requests.memory=$PROXY_MIN_MEM \
# --set resources.limits.cpu=$PROXY_MAX_CPU \
# --set resources.limits.memory=$PROXY_MAX_MEM \
# --set onePod.enabled=$ONE_PROXY_PER_NODE \
# --set-file indexer.indexerKey=$KEY_DIR/$INDEXER_KEY_FILE \
# --set ENABLE_SEND_TX_API=$PRX_ENABLE_SEND_TX_API \
# --set gas_indexer_erc20_wrapper_whitelist=ANY \
# --set gas_start_slot=LATEST \
## 3. Proxy
[[ $NEON_PROXY_ENABLED != "true" ]] || {
echo "Installing neon-proxy..."
helm upgrade --install --atomic neon-proxy neon-proxy/ \
--namespace=$NAMESPACE \
--force \
--history-max 3 \
--set solanaUrl=$SOLANA_URL \
--set ppsolanaUrl=$PP_SOLANA_URL \
--set evm_loader=$EVM_LOADER \
--set proxyCount=$PROXY_COUNT \
--set keysPerProxy=$KEYS_PER_PROXY \
--set image.tag=$PROXY_VER \
--set resources.requests.cpu=$PROXY_MIN_CPU \
--set resources.requests.memory=$PROXY_MIN_MEM \
--set resources.limits.cpu=$PROXY_MAX_CPU \
--set resources.limits.memory=$PROXY_MAX_MEM \
--set onePod.enabled=$ONE_PROXY_PER_NODE \
--set-file indexer.indexerKey=$KEY_DIR/$INDEXER_KEY_FILE \
--set ENABLE_SEND_TX_API=$PRX_ENABLE_SEND_TX_API \
--set gas_indexer_erc20_wrapper_whitelist=ANY \
--set gas_start_slot=CONTINUE \
--wait --timeout=1h \
kubectl -n ${NAMESPACE} wait --for=condition=ready pod neon-proxy-0 --timeout=1m || {
echo "ERROR: Proxy installation failed"
exit 1
}
[[ $TRACER_ENABLED != "true" ]] || {
echo "Installing Trace-api..."
kubectl apply -f tracer/tracer.yaml
}
}
## 4. Monitoring
[[ $MONITORING_ENABLED != "true" ]] || {
[[ $PROMETHEUS_ENABLED != "true" ]] || {
echo "Installing prometheus"
helm upgrade --install kube-state-metrics prometheus-community/kube-state-metrics --namespace=$MONITORING_NAMESPACE 1>/dev/null
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml 1>/dev/null
helm upgrade --install prometheus prometheus-community/prometheus \
-f monitoring/prometheus/values.yaml \
--namespace=$MONITORING_NAMESPACE \
--history-max 3 \
--set server.persistentVolume.storageClass=$PROMETHEUS_STORAGE_CLASS \
--set server.persistentVolume.size=$PROMETHEUS_STORAGE_SIZE \
--set alertmanager.persistence.storageClass=$PROMETHEUS_STORAGE_CLASS \
--set alertmanager.persistence.size=$PROMETHEUS_STORAGE_SIZE \
--set server.ingress.host=$PROXY_HOST \
--set server.ingress.className=$INGRESS_CLASS \
--set server.ingress.path=$PROMETHEUS_INGRESS_PATH \
--set-file extraScrapeConfigs=monitoring/prometheus/extraScrapeConfigs.yaml 1>/dev/null
}
[[ $LOKI_ENABLED != "true" ]] || {
echo "Installing Loki..."
helm upgrade --install loki grafana/loki-stack \
-f monitoring/loki/values.yaml \
--namespace=$MONITORING_NAMESPACE \
--history-max 3 1>/dev/null
}
[[ $GRAFANA_ENABLED != "true" ]] || {
echo "Installing Grafana..."
helm upgrade --install grafana grafana/grafana \
-f monitoring/grafana/values.yaml \
--namespace=$MONITORING_NAMESPACE \
--history-max 3 \
--set persistence.storageClassName=$GRAFANA_STORAGE_CLASS \
--set persistence.size=$GRAFANA_STORAGE_SIZE \
--set adminUser=$GRAFANA_ADMIN_USER \
--set ingress.enabled=$GRAFANA_INGRESS_ENABLED \
--set ingress.host=$PROXY_HOST \
--set ingress.className=$INGRESS_CLASS \
--set ingress.path=$GRAFANA_INGRESS_PATH \
--set adminPassword=$GRAFANA_ADMIN_PASSWD 1>/dev/null
}
}
[ $VAULT_TYPE == "dev" ] || [ ! $FIRST_RUN ] || echo -e "\n###################\nWARNING: Please copy and keep $VAULT_KEYS_FILE in safe place!\n###################\n"
kubectl apply -f tracer/0-proxy-service.yaml
kubectl apply -f tracer/0-tracer-db-deployment.yaml
kubectl apply -f tracer/0-tracer-db-service.yaml
kubectl apply -f tracer/1-neon-tracer-service.yaml
kubectl apply -f tracer/2-neon-rpc-deployment.yaml
kubectl apply -f tracer/2-neon-rpc-service.yaml
###CREATING CRON TO CHECK VERSION AND UPGRADE/ROLLOUT
#kubectl apply -f neon-proxy/update/cron.yaml