...
1#!/usr/bin/env bash
2
3export CLUSTER_NAME=o11y-logtest
4export CLUSTER_PROJECT_ID=ret-edge-o11y-sandbox
5export CLUSTER_PROVIDER=generic
6export CLUSTER_UUID=33c03ca7-23ef-4429-a3f3-ceb3acf56983
7export CLUSTER_LOCATION=us-east1-b
8# ret-edge-pz32l4f02ads5zi6ux91w == dev1-engineering2
9export GCP_PROJECT_ID=ret-edge-pz32l4f02ads5zi6ux91w
10export FOREMAN_GCP_PROJECT_ID=ret-edge-dev1-foreman
11export GCP_REGION=us-east1
12export GCP_ZONE=b
13
14export RED='\033[0;31m'
15export GREEN='\033[0;32m'
16export MAG='\033[0;35m'
17export NC='\033[0m' #no color
18
19echo -e "${MAG}Setting kube context to $CLUSTER_NAME${NC}"
20gcloud container clusters get-credentials "$CLUSTER_NAME" --zone "$CLUSTER_LOCATION" --project "$CLUSTER_PROJECT_ID"
21
22CURRENT_CONTEXT=$(kubectl config current-context)
23export CURRENT_CONTEXT
24
25verify_environment() {
26 echo -e "Verifying env...."
27 echo -e "\nAre you sure you want to run this command on cluster ${RED}$CURRENT_CONTEXT${NC}? [Y/n] \c"
28 read -r ANSWER
29 if [[ ! "$ANSWER" =~ ^([yY][eE][sS]|[yY])$ ]]; then
30 echo -e "quitting..."
31 exit 1
32 fi
33}
View as plain text