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
efd39683
Commit
efd39683
authored
Oct 06, 2015
by
Jeff Grafton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a timeout for GCE cluster initialization
parent
123a5bd4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
util.sh
cluster/gce/util.sh
+11
-4
No files found.
cluster/gce/util.sh
View file @
efd39683
...
@@ -39,6 +39,8 @@ KUBE_SKIP_UPDATE=${KUBE_SKIP_UPDATE-"n"}
...
@@ -39,6 +39,8 @@ KUBE_SKIP_UPDATE=${KUBE_SKIP_UPDATE-"n"}
# multiple versions of the server are being used in the same project
# multiple versions of the server are being used in the same project
# simultaneously (e.g. on Jenkins).
# simultaneously (e.g. on Jenkins).
KUBE_GCS_STAGING_PATH_SUFFIX
=
${
KUBE_GCS_STAGING_PATH_SUFFIX
-
""
}
KUBE_GCS_STAGING_PATH_SUFFIX
=
${
KUBE_GCS_STAGING_PATH_SUFFIX
-
""
}
# How long (in seconds) to wait for cluster initialization.
KUBE_CLUSTER_INITIALIZATION_TIMEOUT
=
${
KUBE_CLUSTER_INITIALIZATION_TIMEOUT
:-
300
}
# VERSION_REGEX matches things like "v0.13.1"
# VERSION_REGEX matches things like "v0.13.1"
readonly
KUBE_VERSION_REGEX
=
"^v(0|[1-9][0-9]*)
\\
.(0|[1-9][0-9]*)
\\
.(0|[1-9][0-9]*)$"
readonly
KUBE_VERSION_REGEX
=
"^v(0|[1-9][0-9]*)
\\
.(0|[1-9][0-9]*)
\\
.(0|[1-9][0-9]*)$"
...
@@ -721,11 +723,10 @@ function kube-up {
...
@@ -721,11 +723,10 @@ function kube-up {
--min-num-replicas
"
${
AUTOSCALER_MIN_NODES
}
"
--max-num-replicas
"
${
AUTOSCALER_MAX_NODES
}
"
${
METRICS
}
||
true
--min-num-replicas
"
${
AUTOSCALER_MIN_NODES
}
"
--max-num-replicas
"
${
AUTOSCALER_MAX_NODES
}
"
${
METRICS
}
||
true
fi
fi
echo
"Waiting for cluster initialization."
echo
"Waiting
up to
${
KUBE_CLUSTER_INITIALIZATION_TIMEOUT
}
seconds
for cluster initialization."
echo
echo
echo
" This will continually check to see if the API for kubernetes is reachable."
echo
" This will continually check to see if the API for kubernetes is reachable."
echo
" This might loop forever if there was some uncaught error during start"
echo
" This may time out if there was some uncaught error during start up."
echo
" up."
echo
echo
# curl in mavericks is borked.
# curl in mavericks is borked.
...
@@ -736,12 +737,18 @@ function kube-up {
...
@@ -736,12 +737,18 @@ function kube-up {
fi
fi
fi
fi
local
start_time
=
$(
date
+%s
)
until
curl
--cacert
"
${
CERT_DIR
}
/pki/ca.crt"
\
until
curl
--cacert
"
${
CERT_DIR
}
/pki/ca.crt"
\
-H
"Authorization: Bearer
${
KUBE_BEARER_TOKEN
}
"
\
-H
"Authorization: Bearer
${
KUBE_BEARER_TOKEN
}
"
\
${
secure
}
\
${
secure
}
\
--max-time
5
--fail
--output
/dev/null
--silent
\
--max-time
5
--fail
--output
/dev/null
--silent
\
"https://
${
KUBE_MASTER_IP
}
/api/v1/pods"
;
do
"https://
${
KUBE_MASTER_IP
}
/api/v1/pods"
;
do
local
elapsed
=
$(($(
date
+%s
)
-
${
start_time
}))
if
[[
${
elapsed
}
-gt
${
KUBE_CLUSTER_INITIALIZATION_TIMEOUT
}
]]
;
then
echo
-e
"
${
color_red
}
Cluster failed to initialize within"
\
"
${
KUBE_CLUSTER_INITIALIZATION_TIMEOUT
}
seconds.
${
color_norm
}
"
exit
2
fi
printf
"."
printf
"."
sleep
2
sleep
2
done
done
...
...
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