diff --git a/infra/script.sh b/infra/script.sh index 7e03594880842ecdcc5c1adea48e8bc3a5812563..28dfffa66cfcbe39a5920351757d4d9e2821e98a 100755 --- a/infra/script.sh +++ b/infra/script.sh @@ -23,7 +23,7 @@ get_gcp_k8s_version () { local REGEX='[0-9]\.([0-9]+).*' VERSION=$1 - gcloud container get-server-config --zone=us-central1-f --format=json \ + gcloud container get-server-config --zone=$REGION-$ZONE --format=json \ | jq -r '.channels[1].validVersions[]' \ | while read version do @@ -55,8 +55,11 @@ CERTDIRPATH=$1 PROJECT=$2 STATUSSITECONFIG=$CERTDIRPATH/appsettings.production.yml -TIMESTAMP=$(date +%s) +# TIMESTAMP=$(date +%s) +TIMESTAMP="1691077967" VERSION="23" +REGION="us-east1" +ZONE="b" APIKEY=$(cat $STATUSSITECONFIG | grep "ApiKey:" | cut -d'"' -f 2) SERVICEACC="admin-acc-$TIMESTAMP" @@ -76,7 +79,7 @@ echo "Enabling K8S API, may take a while..." gcloud services enable container.googleapis.com --project "$PROJECT" gcloud beta container --project "$PROJECT" clusters create "websites-$TIMESTAMP" \ - --zone "us-central1-a" \ + --zone $REGION-$ZONE \ --no-enable-basic-auth \ --cluster-version "$k8s_version" \ --release-channel "None" \ @@ -92,7 +95,7 @@ gcloud beta container --project "$PROJECT" clusters create "websites-$TIMESTAMP" --monitoring=SYSTEM \ --enable-ip-alias \ --network "projects/$PROJECT/global/networks/default" \ - --subnetwork "projects/$PROJECT/regions/us-central1/subnetworks/default" \ + --subnetwork "projects/$PROJECT/regions/$REGION/subnetworks/default" \ --no-enable-intra-node-visibility \ --addons HorizontalPodAutoscaling,HttpLoadBalancing,GcePersistentDiskCsiDriver \ --no-enable-autoupgrade \ @@ -100,7 +103,7 @@ gcloud beta container --project "$PROJECT" clusters create "websites-$TIMESTAMP" # clear other clusters from config rm ~/.kube/config -gcloud container clusters get-credentials "websites-$TIMESTAMP" --zone us-central1-a --project "$PROJECT" +gcloud container clusters get-credentials "websites-$TIMESTAMP" --zone $REGION-$ZONE --project "$PROJECT" gcloud services enable cloudresourcemanager.googleapis.com --project "$PROJECT" gcloud beta iam service-accounts create $SERVICEACC --project "$PROJECT" diff --git a/infra/set-dns.sh b/infra/set-dns.sh index 056106db2f7d990181acdfec053539ddbaeea96f..ac01a09c49ecca60651c0a14c2a3a4fa8b65337e 100755 --- a/infra/set-dns.sh +++ b/infra/set-dns.sh @@ -7,7 +7,7 @@ set -e source sources/data.sh source .secret.sh -VALUES=( "34.30.186.254" ) +VALUES=( "34.138.245.221" ) echo "Values are ${VALUES[*]}" #