Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
913e6ce3
Commit
913e6ce3
authored
Jan 29, 2016
by
David Oppenheimer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Kubemark scripts retry failed gcloud commands"
parent
ac373b6e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
25 deletions
+5
-25
common.sh
test/kubemark/common.sh
+0
-20
start-kubemark.sh
test/kubemark/start-kubemark.sh
+5
-5
No files found.
test/kubemark/common.sh
View file @
913e6ce3
...
@@ -16,7 +16,6 @@
...
@@ -16,7 +16,6 @@
source
"
${
KUBE_ROOT
}
/cluster/kubemark/config-default.sh"
source
"
${
KUBE_ROOT
}
/cluster/kubemark/config-default.sh"
source
"
${
KUBE_ROOT
}
/cluster/kubemark/util.sh"
source
"
${
KUBE_ROOT
}
/cluster/kubemark/util.sh"
source
"
${
KUBE_ROOT
}
/cluster/kube-env.sh"
detect-project &> /dev/null
detect-project &> /dev/null
export
PROJECT
export
PROJECT
...
@@ -24,22 +23,3 @@ export PROJECT
...
@@ -24,22 +23,3 @@ export PROJECT
MASTER_NAME
=
"
${
INSTANCE_PREFIX
}
-kubemark-master"
MASTER_NAME
=
"
${
INSTANCE_PREFIX
}
-kubemark-master"
MASTER_TAG
=
"kubemark-master"
MASTER_TAG
=
"kubemark-master"
EVENT_STORE_NAME
=
"
${
INSTANCE_PREFIX
}
-event-store"
EVENT_STORE_NAME
=
"
${
INSTANCE_PREFIX
}
-event-store"
RETRIES
=
3
# Runs gcloud compute command with the given parameters. Up to $RETRIES will be made
# to execute the command.
# arguments:
# $@: all stuff that goes after 'gcloud compute '
function
run-gcloud-compute-with-retries
{
for
attempt
in
$(
seq
1
${
RETRIES
})
;
do
if
!
gcloud compute
$@
;
then
echo
-e
"
${
color_yellow
}
Attempt
${
attempt
}
failed to
$@
. Retrying.
${
color_norm
}
"
>
& 2
sleep
$((
$attempt
*
5
))
else
return
fi
done
echo
-e
"
${
color_red
}
Failed to
$@
.
${
color_norm
}
"
>
& 2
exit
1
}
test/kubemark/start-kubemark.sh
View file @
913e6ce3
...
@@ -46,12 +46,12 @@ cd $CURR_DIR
...
@@ -46,12 +46,12 @@ cd $CURR_DIR
GCLOUD_COMMON_ARGS
=
"--project
${
PROJECT
}
--zone
${
ZONE
}
"
GCLOUD_COMMON_ARGS
=
"--project
${
PROJECT
}
--zone
${
ZONE
}
"
run-gcloud-compute-with-retries
disks create
"
${
MASTER_NAME
}
-pd"
\
gcloud compute
disks create
"
${
MASTER_NAME
}
-pd"
\
${
GCLOUD_COMMON_ARGS
}
\
${
GCLOUD_COMMON_ARGS
}
\
--type
"
${
MASTER_DISK_TYPE
}
"
\
--type
"
${
MASTER_DISK_TYPE
}
"
\
--size
"
${
MASTER_DISK_SIZE
}
"
--size
"
${
MASTER_DISK_SIZE
}
"
run-gcloud-compute-with-retries
instances create
"
${
MASTER_NAME
}
"
\
gcloud compute
instances create
"
${
MASTER_NAME
}
"
\
${
GCLOUD_COMMON_ARGS
}
\
${
GCLOUD_COMMON_ARGS
}
\
--machine-type
"
${
MASTER_SIZE
}
"
\
--machine-type
"
${
MASTER_SIZE
}
"
\
--image-project
=
"
${
MASTER_IMAGE_PROJECT
}
"
\
--image-project
=
"
${
MASTER_IMAGE_PROJECT
}
"
\
...
@@ -61,7 +61,7 @@ run-gcloud-compute-with-retries instances create "${MASTER_NAME}" \
...
@@ -61,7 +61,7 @@ run-gcloud-compute-with-retries instances create "${MASTER_NAME}" \
--scopes
"storage-ro,compute-rw,logging-write"
\
--scopes
"storage-ro,compute-rw,logging-write"
\
--disk
"name=
${
MASTER_NAME
}
-pd,device-name=master-pd,mode=rw,boot=no,auto-delete=no"
--disk
"name=
${
MASTER_NAME
}
-pd,device-name=master-pd,mode=rw,boot=no,auto-delete=no"
run-gcloud-compute-with-retries
firewall-rules create
"
${
INSTANCE_PREFIX
}
-kubemark-master-https"
\
gcloud compute
firewall-rules create
"
${
INSTANCE_PREFIX
}
-kubemark-master-https"
\
--project
"
${
PROJECT
}
"
\
--project
"
${
PROJECT
}
"
\
--network
"
${
NETWORK
}
"
\
--network
"
${
NETWORK
}
"
\
--source-ranges
"0.0.0.0/0"
\
--source-ranges
"0.0.0.0/0"
\
...
@@ -73,12 +73,12 @@ MASTER_IP=$(gcloud compute instances describe ${MASTER_NAME} \
...
@@ -73,12 +73,12 @@ MASTER_IP=$(gcloud compute instances describe ${MASTER_NAME} \
if
[
"
${
SEPARATE_EVENT_MACHINE
:-
false
}
"
==
"true"
]
;
then
if
[
"
${
SEPARATE_EVENT_MACHINE
:-
false
}
"
==
"true"
]
;
then
EVENT_STORE_NAME
=
"
${
INSTANCE_PREFIX
}
-event-store"
EVENT_STORE_NAME
=
"
${
INSTANCE_PREFIX
}
-event-store"
run-gcloud-compute-with-retries
disks create
"
${
EVENT_STORE_NAME
}
-pd"
\
gcloud compute
disks create
"
${
EVENT_STORE_NAME
}
-pd"
\
${
GCLOUD_COMMON_ARGS
}
\
${
GCLOUD_COMMON_ARGS
}
\
--type
"
${
MASTER_DISK_TYPE
}
"
\
--type
"
${
MASTER_DISK_TYPE
}
"
\
--size
"
${
MASTER_DISK_SIZE
}
"
--size
"
${
MASTER_DISK_SIZE
}
"
run-gcloud-compute-with-retries
instances create
"
${
EVENT_STORE_NAME
}
"
\
gcloud compute
instances create
"
${
EVENT_STORE_NAME
}
"
\
${
GCLOUD_COMMON_ARGS
}
\
${
GCLOUD_COMMON_ARGS
}
\
--machine-type
"
${
MASTER_SIZE
}
"
\
--machine-type
"
${
MASTER_SIZE
}
"
\
--image-project
=
"
${
MASTER_IMAGE_PROJECT
}
"
\
--image-project
=
"
${
MASTER_IMAGE_PROJECT
}
"
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment