Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Setup-Manager
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dmytro Bogatov
Setup-Manager
Commits
fd540aa0
Commit
fd540aa0
authored
Feb 3, 2023
by
Dmytro Bogatov
Browse files
Options
Downloads
Patches
Plain Diff
Upgrade cluster.
parent
cf642886
No related branches found
No related tags found
No related merge requests found
Pipeline
#48917
passed
May 5, 2023
Stage: deploy
Changes
2
Pipelines
109
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
infra/script.sh
+27
-2
27 additions, 2 deletions
infra/script.sh
infra/set-dns.sh
+1
-1
1 addition, 1 deletion
infra/set-dns.sh
with
28 additions
and
3 deletions
infra/script.sh
+
27
−
2
View file @
fd540aa0
...
@@ -19,6 +19,28 @@ usage () {
...
@@ -19,6 +19,28 @@ usage () {
exit
1
;
exit
1
;
}
}
get_gcp_k8s_version
()
{
local
REGEX
=
'[0-9]\.([0-9]+).*'
VERSION
=
$1
gcloud container get-server-config
--zone
=
us-central1-f
--format
=
json
\
| jq
-r
'.channels[1].validVersions[]'
\
|
while
read
version
do
if
[[
$version
=
~
$REGEX
]]
then
major
=
${
BASH_REMATCH
[1]
}
if
[[
$major
==
$VERSION
]]
then
echo
"
$version
"
fi
else
echo
"Match failed for:
$version
"
exit
1
fi
done
}
if
!
[
$#
-eq
2
]
if
!
[
$#
-eq
2
]
then
then
usage
usage
...
@@ -34,7 +56,7 @@ PROJECT=$2
...
@@ -34,7 +56,7 @@ PROJECT=$2
STATUSSITECONFIG
=
$CERTDIRPATH
/appsettings.production.yml
STATUSSITECONFIG
=
$CERTDIRPATH
/appsettings.production.yml
TIMESTAMP
=
$(
date
+%s
)
TIMESTAMP
=
$(
date
+%s
)
VERSION
=
"
1.23.8-gke.1900
"
VERSION
=
"
23
"
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
"
...
@@ -47,12 +69,15 @@ docker login -u $EMAIL -p "$DOCKERPASS" registry.dbogatov.org
...
@@ -47,12 +69,15 @@ docker login -u $EMAIL -p "$DOCKERPASS" registry.dbogatov.org
# PROVISION
# PROVISION
k8s_version
=
$(
get_gcp_k8s_version
$VERSION
)
echo
"Will deploy K8S
$k8s_version
"
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
"us-central1-a"
\
--no-enable-basic-auth
\
--no-enable-basic-auth
\
--cluster-version
"
$
VERSION
"
\
--cluster-version
"
$
k8s_version
"
\
--release-channel
"None"
\
--release-channel
"None"
\
--machine-type
"n1-standard-1"
\
--machine-type
"n1-standard-1"
\
--image-type
"COS_CONTAINERD"
\
--image-type
"COS_CONTAINERD"
\
...
...
This diff is collapsed.
Click to expand it.
infra/set-dns.sh
+
1
−
1
View file @
fd540aa0
...
@@ -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.28.237
.7
8
"
)
VALUES
=(
"
104.198.35
.7
2
"
)
echo
"Values are
${
VALUES
[*]
}
"
echo
"Values are
${
VALUES
[*]
}
"
#
#
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment