Skip to content
Snippets Groups Projects
Commit afd5b9f3 authored by Dmytro Bogatov's avatar Dmytro Bogatov :two_hearts:
Browse files

Upgrade cluster.

parent e8797434
No related branches found
No related tags found
No related merge requests found
Pipeline #53500 passed
...@@ -23,7 +23,7 @@ get_gcp_k8s_version () { ...@@ -23,7 +23,7 @@ get_gcp_k8s_version () {
local REGEX='[0-9]\.([0-9]+).*' local REGEX='[0-9]\.([0-9]+).*'
VERSION=$1 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[]' \ | jq -r '.channels[1].validVersions[]' \
| while read version | while read version
do do
...@@ -55,8 +55,11 @@ CERTDIRPATH=$1 ...@@ -55,8 +55,11 @@ CERTDIRPATH=$1
PROJECT=$2 PROJECT=$2
STATUSSITECONFIG=$CERTDIRPATH/appsettings.production.yml STATUSSITECONFIG=$CERTDIRPATH/appsettings.production.yml
TIMESTAMP=$(date +%s) # TIMESTAMP=$(date +%s)
TIMESTAMP="1691077967"
VERSION="23" VERSION="23"
REGION="us-east1"
ZONE="b"
APIKEY=$(cat $STATUSSITECONFIG | grep "ApiKey:" | cut -d'"' -f 2) APIKEY=$(cat $STATUSSITECONFIG | grep "ApiKey:" | cut -d'"' -f 2)
SERVICEACC="admin-acc-$TIMESTAMP" SERVICEACC="admin-acc-$TIMESTAMP"
...@@ -76,7 +79,7 @@ echo "Enabling K8S API, may take a while..." ...@@ -76,7 +79,7 @@ echo "Enabling K8S API, may take a while..."
gcloud services enable container.googleapis.com --project "$PROJECT" gcloud services enable container.googleapis.com --project "$PROJECT"
gcloud beta container --project "$PROJECT" clusters create "websites-$TIMESTAMP" \ gcloud beta container --project "$PROJECT" clusters create "websites-$TIMESTAMP" \
--zone "us-central1-a" \ --zone $REGION-$ZONE \
--no-enable-basic-auth \ --no-enable-basic-auth \
--cluster-version "$k8s_version" \ --cluster-version "$k8s_version" \
--release-channel "None" \ --release-channel "None" \
...@@ -92,7 +95,7 @@ gcloud beta container --project "$PROJECT" clusters create "websites-$TIMESTAMP" ...@@ -92,7 +95,7 @@ gcloud beta container --project "$PROJECT" clusters create "websites-$TIMESTAMP"
--monitoring=SYSTEM \ --monitoring=SYSTEM \
--enable-ip-alias \ --enable-ip-alias \
--network "projects/$PROJECT/global/networks/default" \ --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 \ --no-enable-intra-node-visibility \
--addons HorizontalPodAutoscaling,HttpLoadBalancing,GcePersistentDiskCsiDriver \ --addons HorizontalPodAutoscaling,HttpLoadBalancing,GcePersistentDiskCsiDriver \
--no-enable-autoupgrade \ --no-enable-autoupgrade \
...@@ -100,7 +103,7 @@ gcloud beta container --project "$PROJECT" clusters create "websites-$TIMESTAMP" ...@@ -100,7 +103,7 @@ gcloud beta container --project "$PROJECT" clusters create "websites-$TIMESTAMP"
# clear other clusters from config # clear other clusters from config
rm ~/.kube/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 services enable cloudresourcemanager.googleapis.com --project "$PROJECT"
gcloud beta iam service-accounts create $SERVICEACC --project "$PROJECT" gcloud beta iam service-accounts create $SERVICEACC --project "$PROJECT"
... ...
......
...@@ -7,7 +7,7 @@ set -e ...@@ -7,7 +7,7 @@ set -e
source sources/data.sh source sources/data.sh
source .secret.sh source .secret.sh
VALUES=( "34.30.186.254" ) VALUES=( "34.138.245.221" )
echo "Values are ${VALUES[*]}" echo "Values are ${VALUES[*]}"
# #
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment