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
9cdfdba1
Unverified
Commit
9cdfdba1
authored
Dec 28, 2018
by
Kubernetes Prow Robot
Committed by
GitHub
Dec 28, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #71924 from yujuhong/node-binaries
GCE: enable downloading and staging of the node binaries
parents
cd067917
62db510f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
4 deletions
+57
-4
util.sh
cluster/gce/util.sh
+25
-4
get-kube-binaries.sh
cluster/get-kube-binaries.sh
+15
-0
get-kube.sh
cluster/get-kube.sh
+17
-0
No files found.
cluster/gce/util.sh
View file @
9cdfdba1
...
@@ -248,16 +248,21 @@ function set-preferred-region() {
...
@@ -248,16 +248,21 @@ function set-preferred-region() {
# Assumed vars:
# Assumed vars:
# PROJECT
# PROJECT
# SERVER_BINARY_TAR
# SERVER_BINARY_TAR
# NODE_BINARY_TAR (optional)
# KUBE_MANIFESTS_TAR
# KUBE_MANIFESTS_TAR
# ZONE
# ZONE
# Vars set:
# Vars set:
# SERVER_BINARY_TAR_URL
# SERVER_BINARY_TAR_URL
# SERVER_BINARY_TAR_HASH
# SERVER_BINARY_TAR_HASH
# NODE_BINARY_TAR_URL
# NODE_BINARY_TAR_HASH
# KUBE_MANIFESTS_TAR_URL
# KUBE_MANIFESTS_TAR_URL
# KUBE_MANIFESTS_TAR_HASH
# KUBE_MANIFESTS_TAR_HASH
function
upload-
server-
tars
()
{
function
upload-tars
()
{
SERVER_BINARY_TAR_URL
=
SERVER_BINARY_TAR_URL
=
SERVER_BINARY_TAR_HASH
=
SERVER_BINARY_TAR_HASH
=
NODE_BINARY_TAR_URL
=
NODE_BINARY_TAR_HASH
=
KUBE_MANIFESTS_TAR_URL
=
KUBE_MANIFESTS_TAR_URL
=
KUBE_MANIFESTS_TAR_HASH
=
KUBE_MANIFESTS_TAR_HASH
=
...
@@ -279,11 +284,16 @@ function upload-server-tars() {
...
@@ -279,11 +284,16 @@ function upload-server-tars() {
fi
fi
SERVER_BINARY_TAR_HASH
=
$(
sha1sum-file
"
${
SERVER_BINARY_TAR
}
"
)
SERVER_BINARY_TAR_HASH
=
$(
sha1sum-file
"
${
SERVER_BINARY_TAR
}
"
)
if
[[
-n
"
${
NODE_BINARY_TAR
:-}
"
]]
;
then
NODE_BINARY_TAR_HASH
=
$(
sha1sum-file
"
${
NODE_BINARY_TAR
}
"
)
fi
if
[[
-n
"
${
KUBE_MANIFESTS_TAR
:-}
"
]]
;
then
if
[[
-n
"
${
KUBE_MANIFESTS_TAR
:-}
"
]]
;
then
KUBE_MANIFESTS_TAR_HASH
=
$(
sha1sum-file
"
${
KUBE_MANIFESTS_TAR
}
"
)
KUBE_MANIFESTS_TAR_HASH
=
$(
sha1sum-file
"
${
KUBE_MANIFESTS_TAR
}
"
)
fi
fi
local
server_binary_tar_urls
=()
local
server_binary_tar_urls
=()
local
node_binary_tar_urls
=()
local
kube_manifest_tar_urls
=()
local
kube_manifest_tar_urls
=()
for
region
in
"
${
PREFERRED_REGION
[@]
}
"
;
do
for
region
in
"
${
PREFERRED_REGION
[@]
}
"
;
do
...
@@ -301,12 +311,20 @@ function upload-server-tars() {
...
@@ -301,12 +311,20 @@ function upload-server-tars() {
local
staging_path
=
"
${
staging_bucket
}
/
${
INSTANCE_PREFIX
}
-devel"
local
staging_path
=
"
${
staging_bucket
}
/
${
INSTANCE_PREFIX
}
-devel"
echo
"+++ Staging
server
tars to Google Storage:
${
staging_path
}
"
echo
"+++ Staging tars to Google Storage:
${
staging_path
}
"
local
server_binary_gs_url
=
"
${
staging_path
}
/
${
SERVER_BINARY_TAR
##*/
}
"
local
server_binary_gs_url
=
"
${
staging_path
}
/
${
SERVER_BINARY_TAR
##*/
}
"
copy-to-staging
"
${
staging_path
}
"
"
${
server_binary_gs_url
}
"
"
${
SERVER_BINARY_TAR
}
"
"
${
SERVER_BINARY_TAR_HASH
}
"
copy-to-staging
"
${
staging_path
}
"
"
${
server_binary_gs_url
}
"
"
${
SERVER_BINARY_TAR
}
"
"
${
SERVER_BINARY_TAR_HASH
}
"
if
[[
-n
"
${
NODE_BINARY_TAR
:-}
"
]]
;
then
local
node_binary_gs_url
=
"
${
staging_path
}
/
${
NODE_BINARY_TAR
##*/
}
"
copy-to-staging
"
${
staging_path
}
"
"
${
node_binary_gs_url
}
"
"
${
NODE_BINARY_TAR
}
"
"
${
NODE_BINARY_TAR_HASH
}
"
fi
# Convert from gs:// URL to an https:// URL
# Convert from gs:// URL to an https:// URL
server_binary_tar_urls+
=(
"
${
server_binary_gs_url
/gs
:
\/\//https
://storage.googleapis.com/
}
"
)
server_binary_tar_urls+
=(
"
${
server_binary_gs_url
/gs
:
\/\//https
://storage.googleapis.com/
}
"
)
if
[[
-n
"
${
NODE_BINARY_TAR
:-}
"
]]
;
then
node_binary_tar_urls+
=(
"
${
node_binary_gs_url
/gs
:
\/\//https
://storage.googleapis.com/
}
"
)
fi
if
[[
-n
"
${
KUBE_MANIFESTS_TAR
:-}
"
]]
;
then
if
[[
-n
"
${
KUBE_MANIFESTS_TAR
:-}
"
]]
;
then
local
kube_manifests_gs_url
=
"
${
staging_path
}
/
${
KUBE_MANIFESTS_TAR
##*/
}
"
local
kube_manifests_gs_url
=
"
${
staging_path
}
/
${
KUBE_MANIFESTS_TAR
##*/
}
"
copy-to-staging
"
${
staging_path
}
"
"
${
kube_manifests_gs_url
}
"
"
${
KUBE_MANIFESTS_TAR
}
"
"
${
KUBE_MANIFESTS_TAR_HASH
}
"
copy-to-staging
"
${
staging_path
}
"
"
${
kube_manifests_gs_url
}
"
"
${
KUBE_MANIFESTS_TAR
}
"
"
${
KUBE_MANIFESTS_TAR_HASH
}
"
...
@@ -316,6 +334,9 @@ function upload-server-tars() {
...
@@ -316,6 +334,9 @@ function upload-server-tars() {
done
done
SERVER_BINARY_TAR_URL
=
$(
join_csv
"
${
server_binary_tar_urls
[@]
}
"
)
SERVER_BINARY_TAR_URL
=
$(
join_csv
"
${
server_binary_tar_urls
[@]
}
"
)
if
[[
-n
"
${
NODE_BINARY_TAR
:-}
"
]]
;
then
NODE_BINARY_TAR_URL
=
$(
join_csv
"
${
node_binary_tar_urls
[@]
}
"
)
fi
if
[[
-n
"
${
KUBE_MANIFESTS_TAR
:-}
"
]]
;
then
if
[[
-n
"
${
KUBE_MANIFESTS_TAR
:-}
"
]]
;
then
KUBE_MANIFESTS_TAR_URL
=
$(
join_csv
"
${
kube_manifests_tar_urls
[@]
}
"
)
KUBE_MANIFESTS_TAR_URL
=
$(
join_csv
"
${
kube_manifests_tar_urls
[@]
}
"
)
fi
fi
...
@@ -436,7 +457,7 @@ function tars_from_version() {
...
@@ -436,7 +457,7 @@ function tars_from_version() {
if
[[
-z
"
${
KUBE_VERSION
-
}
"
]]
;
then
if
[[
-z
"
${
KUBE_VERSION
-
}
"
]]
;
then
find-release-tars
find-release-tars
upload-
server-
tars
upload-tars
elif
[[
${
KUBE_VERSION
}
=
~
${
KUBE_RELEASE_VERSION_REGEX
}
]]
;
then
elif
[[
${
KUBE_VERSION
}
=
~
${
KUBE_RELEASE_VERSION_REGEX
}
]]
;
then
SERVER_BINARY_TAR_URL
=
"https://storage.googleapis.com/kubernetes-release/release/
${
KUBE_VERSION
}
/kubernetes-server-linux-amd64.tar.gz"
SERVER_BINARY_TAR_URL
=
"https://storage.googleapis.com/kubernetes-release/release/
${
KUBE_VERSION
}
/kubernetes-server-linux-amd64.tar.gz"
# TODO: Clean this up.
# TODO: Clean this up.
...
@@ -1756,7 +1777,7 @@ function kube-up() {
...
@@ -1756,7 +1777,7 @@ function kube-up() {
# Make sure we have the tar files staged on Google Storage
# Make sure we have the tar files staged on Google Storage
find-release-tars
find-release-tars
upload-
server-
tars
upload-tars
# ensure that environmental variables specifying number of migs to create
# ensure that environmental variables specifying number of migs to create
set_num_migs
set_num_migs
...
...
cluster/get-kube-binaries.sh
View file @
9cdfdba1
...
@@ -161,6 +161,11 @@ DOWNLOAD_URL_PREFIX="${KUBERNETES_RELEASE_URL}/${KUBE_VERSION}"
...
@@ -161,6 +161,11 @@ DOWNLOAD_URL_PREFIX="${KUBERNETES_RELEASE_URL}/${KUBE_VERSION}"
SERVER_PLATFORM
=
"linux"
SERVER_PLATFORM
=
"linux"
SERVER_ARCH
=
"
${
KUBERNETES_SERVER_ARCH
:-
amd64
}
"
SERVER_ARCH
=
"
${
KUBERNETES_SERVER_ARCH
:-
amd64
}
"
SERVER_TAR
=
"kubernetes-server-
${
SERVER_PLATFORM
}
-
${
SERVER_ARCH
}
.tar.gz"
SERVER_TAR
=
"kubernetes-server-
${
SERVER_PLATFORM
}
-
${
SERVER_ARCH
}
.tar.gz"
if
[[
-n
"
${
KUBERNETES_NODE_PLATFORM
-
}
"
||
-n
"
${
KUBERNETES_NODE_ARCH
-
}
"
]]
;
then
NODE_PLATFORM
=
"
${
KUBERNETES_NODE_PLATFORM
:
${
SERVER_PLATFORM
}}
"
NODE_ARCH
=
"
${
KUBERNETES_NODE_ARCH
:
${
SERVER_ARCH
}}
"
NODE_TAR
=
"kubernetes-node-
${
NODE_PLATFORM
}
-
${
NODE_ARCH
}
.tar.gz"
fi
detect_client_info
detect_client_info
CLIENT_TAR
=
"kubernetes-client-
${
CLIENT_PLATFORM
}
-
${
CLIENT_ARCH
}
.tar.gz"
CLIENT_TAR
=
"kubernetes-client-
${
CLIENT_PLATFORM
}
-
${
CLIENT_ARCH
}
.tar.gz"
...
@@ -186,6 +191,12 @@ if [[ ! -x "${KUBE_ROOT}/platforms/${CLIENT_PLATFORM}/${CLIENT_ARCH}/kubectl" ]]
...
@@ -186,6 +191,12 @@ if [[ ! -x "${KUBE_ROOT}/platforms/${CLIENT_PLATFORM}/${CLIENT_ARCH}/kubectl" ]]
echo
"Will download and extract
${
CLIENT_TAR
}
from
${
DOWNLOAD_URL_PREFIX
}
"
echo
"Will download and extract
${
CLIENT_TAR
}
from
${
DOWNLOAD_URL_PREFIX
}
"
fi
fi
DOWNLOAD_NODE_TAR
=
false
if
[[
-n
"
${
NODE_TAR
:-}
"
]]
;
then
DOWNLOAD_NODE_TAR
=
true
echo
"Will download and extract
${
NODE_TAR
}
from
${
DOWNLOAD_URL_PREFIX
}
"
fi
TESTS_TAR
=
"kubernetes-test.tar.gz"
TESTS_TAR
=
"kubernetes-test.tar.gz"
DOWNLOAD_TESTS_TAR
=
false
DOWNLOAD_TESTS_TAR
=
false
if
[[
-n
"
${
KUBERNETES_DOWNLOAD_TESTS
-
}
"
]]
;
then
if
[[
-n
"
${
KUBERNETES_DOWNLOAD_TESTS
-
}
"
]]
;
then
...
@@ -213,6 +224,10 @@ if "${DOWNLOAD_SERVER_TAR}"; then
...
@@ -213,6 +224,10 @@ if "${DOWNLOAD_SERVER_TAR}"; then
download_tarball
"
${
KUBE_ROOT
}
/server"
"
${
SERVER_TAR
}
"
download_tarball
"
${
KUBE_ROOT
}
/server"
"
${
SERVER_TAR
}
"
fi
fi
if
"
${
DOWNLOAD_NODE_TAR
}
"
;
then
download_tarball
"
${
KUBE_ROOT
}
/node"
"
${
NODE_TAR
}
"
fi
if
"
${
DOWNLOAD_CLIENT_TAR
}
"
;
then
if
"
${
DOWNLOAD_CLIENT_TAR
}
"
;
then
download_tarball
"
${
KUBE_ROOT
}
/client"
"
${
CLIENT_TAR
}
"
download_tarball
"
${
KUBE_ROOT
}
/client"
"
${
CLIENT_TAR
}
"
extract_arch_tarball
"
${
KUBE_ROOT
}
/client/
${
CLIENT_TAR
}
"
"
${
CLIENT_PLATFORM
}
"
"
${
CLIENT_ARCH
}
"
extract_arch_tarball
"
${
KUBE_ROOT
}
/client/
${
CLIENT_TAR
}
"
"
${
CLIENT_PLATFORM
}
"
"
${
CLIENT_ARCH
}
"
...
...
cluster/get-kube.sh
View file @
9cdfdba1
...
@@ -37,6 +37,23 @@
...
@@ -37,6 +37,23 @@
# * arm
# * arm
# * arm64
# * arm64
#
#
# Set KUBERNETES_NODE_PLATFORM to choose the platform for which to download
# the node binaries. If none of KUBERNETES_NODE_PLATFORM and
# KUBERNETES_NODE_ARCH is set, no node binaries will be downloaded. If only
# one of the two is set, the other will be defaulted to the
# KUBERNETES_SERVER_PLATFORM/ARCH.
# * linux
# * windows
#
# Set KUBERNETES_NODE_ARCH to choose the node architecture to download the
# node binaries. If none of KUBERNETES_NODE_PLATFORM and
# KUBERNETES_NODE_ARCH is set, no node binaries will be downloaded. If only
# one of the two is set, the other will be defaulted to the
# KUBERNETES_SERVER_PLATFORM/ARCH.
# * amd64 [default]
# * arm
# * arm64
#
# Set KUBERNETES_SKIP_DOWNLOAD to skip downloading a release.
# Set KUBERNETES_SKIP_DOWNLOAD to skip downloading a release.
# Set KUBERNETES_SKIP_CONFIRM to skip the installation confirmation prompt.
# Set KUBERNETES_SKIP_CONFIRM to skip the installation confirmation prompt.
# Set KUBERNETES_SKIP_CREATE_CLUSTER to skip starting a cluster.
# Set KUBERNETES_SKIP_CREATE_CLUSTER to skip starting a cluster.
...
...
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