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
cbee65a6
Commit
cbee65a6
authored
Dec 13, 2016
by
Jeff Grafton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automatically download missing kube binaries in kube-up/kube-down.
parent
64165483
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
5 deletions
+42
-5
common.sh
cluster/common.sh
+34
-1
get-kube-binaries.sh
cluster/get-kube-binaries.sh
+4
-4
kube-down.sh
cluster/kube-down.sh
+1
-0
kube-push.sh
cluster/kube-push.sh
+1
-0
kube-up.sh
cluster/kube-up.sh
+2
-0
No files found.
cluster/common.sh
View file @
cbee65a6
...
...
@@ -20,7 +20,7 @@ set -o errexit
set
-o
nounset
set
-o
pipefail
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
KUBE_ROOT
=
$(
cd
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
&&
pwd
)
DEFAULT_KUBECONFIG
=
"
${
HOME
}
/.kube/config"
...
...
@@ -1008,3 +1008,36 @@ if missing:
'
"""
${
version
}
"""
fi
}
# Check whether required client and server binaries exist, prompting to download
# if missing.
# If KUBERNETES_SKIP_CONFIRM is set to y, we'll automatically download binaries
# without prompting.
function
verify-kube-binaries
()
{
local
missing_binaries
=
false
if
!
"
${
KUBE_ROOT
}
/cluster/kubectl.sh"
version
--client
>
&/dev/null
;
then
echo
"!!! kubectl appears to be broken or missing"
missing_binaries
=
true
fi
if
!
$(
find-release-tars
)
;
then
missing_binaries
=
true
fi
if
!
"
${
missing_binaries
}
"
;
then
return
fi
get_binaries_script
=
"
${
KUBE_ROOT
}
/cluster/get-kube-binaries.sh"
local
resp
=
"y"
if
[[
!
"
${
KUBERNETES_SKIP_CONFIRM
:-
n
}
"
=
~ ^[yY]
$
]]
;
then
echo
"Required binaries appear to be missing. Do you wish to download them? [Y/n]"
read
resp
fi
if
[[
"
${
resp
}
"
=
~ ^[nN]
$
]]
;
then
echo
"You must download binaries to continue. You can use "
echo
"
${
get_binaries_script
}
"
echo
"to do this for your automatically."
exit
1
fi
"
${
get_binaries_script
}
"
}
cluster/get-kube-binaries.sh
View file @
cbee65a6
...
...
@@ -46,7 +46,7 @@ KUBERNETES_RELEASE_URL="${KUBERNETES_RELEASE_URL:-https://storage.googleapis.com
function
detect_kube_release
()
{
if
[[
!
-e
"
${
KUBE_ROOT
}
/version"
]]
;
then
echo
"Can't determine Kubernetes release."
>
&2
echo
"
This script
should only be run from a prebuilt Kubernetes release."
>
&2
echo
"
${
BASH_SOURCE
}
should only be run from a prebuilt Kubernetes release."
>
&2
echo
"Did you mean to use get-kube.sh instead?"
>
&2
exit
1
fi
...
...
@@ -162,8 +162,8 @@ detect_client_info
CLIENT_TAR
=
"kubernetes-client-
${
CLIENT_PLATFORM
}
-
${
CLIENT_ARCH
}
.tar.gz"
echo
"Kubernetes release:
${
KUBERNETES_RELEASE
}
"
echo
"Server:
${
SERVER_PLATFORM
}
/
${
SERVER_ARCH
}
"
echo
"Client:
${
CLIENT_PLATFORM
}
/
${
CLIENT_ARCH
}
"
echo
"Server:
${
SERVER_PLATFORM
}
/
${
SERVER_ARCH
}
(to override, set KUBERNETES_SERVER_ARCH)
"
echo
"Client:
${
CLIENT_PLATFORM
}
/
${
CLIENT_ARCH
}
(autodetected)
"
echo
# TODO: remove this check and default to true when we stop shipping server
...
...
@@ -201,7 +201,7 @@ if [[ -z "${KUBERNETES_SKIP_CONFIRM-}" ]]; then
read
confirm
if
[[
"
${
confirm
}
"
=
~ ^[nN]
$
]]
;
then
echo
"Aborting."
exit
0
exit
1
fi
fi
...
...
cluster/kube-down.sh
View file @
cbee65a6
...
...
@@ -31,6 +31,7 @@ source "${KUBE_ROOT}/cluster/kube-util.sh"
echo
"Bringing down cluster using provider:
$KUBERNETES_PROVIDER
"
verify-prereqs
verify-kube-binaries
kube-down
echo
"Done"
cluster/kube-push.sh
View file @
cbee65a6
...
...
@@ -69,6 +69,7 @@ if [[ "${push_to_master}" == "true" ]] && [[ "${push_to_node}" == "true" ]]; the
fi
verify-prereqs
verify-kube-binaries
KUBE_VERSION
=
${
1
-
}
if
[[
"
${
push_to_master
}
"
==
"false"
]]
&&
[[
"
${
push_to_node
}
"
==
"false"
]]
;
then
...
...
cluster/kube-up.sh
View file @
cbee65a6
...
...
@@ -41,6 +41,8 @@ fi
echo
"... calling verify-prereqs"
>
&2
verify-prereqs
echo
"... calling verify-kube-binaries"
>
&2
verify-kube-binaries
if
[[
"
${
KUBE_STAGE_IMAGES
:-}
"
==
"true"
]]
;
then
echo
"... staging images"
>
&2
...
...
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