#!/bin/bash
# usage: ./start_port_forward.sh <cluster> <port>

# args
CLUSTER=$1
PORT=$2

# environment variables
export KUBECONFIG=$(eval "echo \$KUBECONFIG_IKS_${CLUSTER^^}")
export AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
export AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
export AWS_DEFAULT_REGION="us-east-1"

# start port forwarding in the background
KUBECONFIG=$(eval "echo \$KUBECONFIG_IKS_${CLUSTER^^}") kubectl port-forward svc/prometheus-operator-kube-p-prometheus -n monitoring ${PORT}:9090 
