Created
July 3, 2024 10:48
-
-
Save Lillecarl/57e6f6fafb169647f28036ab42d625c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
set -x | |
if [[ "$1" =~ dev|all ]] || [[ -z "$1" ]]; then | |
echo Forwarding dev | |
kubectl relay --context aks-dataplatform-dev-001 -n development service/kronosdb-rw 5401:5432 & | |
kubectl relay --context aks-dataplatform-dev-001 -n development service/galacticdb-rw 5411:5432 & | |
kubectl relay --context aks-dataplatform-dev-001 -n observability service/grafanadb-rw 5421:5432 & | |
kubectl relay --context aks-dataplatform-dev-001 -n development service/keycloakdb-rw 5441:5432 & | |
kubectl relay --context aks-dataplatform-dev-001 -n observability deployment/prometheus-server 9091:9090 & | |
fi | |
if [[ "$1" =~ test|stag|all ]]; then | |
echo Forwarding test | |
kubectl relay --context aks-dataplatform-test-001 -n staging service/kronosdb-rw 5402:5432 & | |
kubectl relay --context aks-dataplatform-test-001 -n staging service/galacticdb-rw 5412:5432 & | |
kubectl relay --context aks-dataplatform-test-001 -n observability service/grafanadb-rw 5422:5432 & | |
kubectl relay --context aks-dataplatform-test-001 -n staging service/keycloakdb-rw 5442:5432 & | |
kubectl relay --context aks-dataplatform-test-001 -n observability deployment/prometheus-server 9092:9090 & | |
fi | |
if [[ "$1" =~ prod|all ]]; then | |
echo Forwarding prod | |
kubectl relay --context aks-dataplatform-prod-001 -n production service/kronosdb-rw 5403:5432 & | |
kubectl relay --context aks-dataplatform-prod-001 -n production service/galacticdb-rw 5413:5432 & | |
kubectl relay --context aks-dataplatform-prod-001 -n observability service/grafanadb-rw 5423:5432 & | |
kubectl relay --context aks-dataplatform-prod-001 -n production service/keycloakdb-rw 5443:5432 & | |
kubectl relay --context aks-dataplatform-prod-001 -n observability deployment/prometheus-server 9093:9090 & | |
fi | |
echo "Forwarding databases, waiting for all jobs to finish..." | |
# shellcheck disable=SC2046 | |
wait $(jobs -p) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment