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
c14dac9a
Unverified
Commit
c14dac9a
authored
Apr 14, 2020
by
Erik Wilson
Committed by
GitHub
Apr 14, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1580 from erikwilson/use-channel-server-install-script
Use channel server for install script
parents
5c3d7508
dddbd163
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
install.sh
install.sh
+19
-6
No files found.
install.sh
View file @
c14dac9a
...
@@ -33,8 +33,8 @@ set -e
...
@@ -33,8 +33,8 @@ set -e
# If set to true will not start k3s service.
# If set to true will not start k3s service.
#
#
# - INSTALL_K3S_VERSION
# - INSTALL_K3S_VERSION
# Version of k3s to download from github. Will attempt to download the
# Version of k3s to download from github. Will attempt to download
from
the
#
latest version
if not specified.
#
stable channel
if not specified.
#
#
# - INSTALL_K3S_COMMIT
# - INSTALL_K3S_COMMIT
# Commit of k3s to download from temporary cloud storage.
# Commit of k3s to download from temporary cloud storage.
...
@@ -75,6 +75,14 @@ set -e
...
@@ -75,6 +75,14 @@ set -e
#
#
# - INSTALL_K3S_SELINUX_WARN
# - INSTALL_K3S_SELINUX_WARN
# If set to true will continue if k3s-selinux policy is not found.
# If set to true will continue if k3s-selinux policy is not found.
#
# - INSTALL_K3S_CHANNEL_URL
# Channel URL for fetching k3s download URL.
# Defaults to 'https://update.k3s.io/v1-release/channels'.
#
# - INSTALL_K3S_CHANNEL
# Channel to use for fetching k3s download URL.
# Defaults to 'stable'.
GITHUB_URL
=
https://github.com/rancher/k3s/releases
GITHUB_URL
=
https://github.com/rancher/k3s/releases
STORAGE_URL
=
https://storage.googleapis.com/k3s-ci-builds
STORAGE_URL
=
https://storage.googleapis.com/k3s-ci-builds
...
@@ -229,6 +237,10 @@ setup_env() {
...
@@ -229,6 +237,10 @@ setup_env() {
if
[
"
${
INSTALL_K3S_BIN_DIR_READ_ONLY
}
"
=
true
]
;
then
if
[
"
${
INSTALL_K3S_BIN_DIR_READ_ONLY
}
"
=
true
]
;
then
INSTALL_K3S_SKIP_DOWNLOAD
=
true
INSTALL_K3S_SKIP_DOWNLOAD
=
true
fi
fi
# --- setup channel values
INSTALL_K3S_CHANNEL_URL
=
${
INSTALL_K3S_CHANNEL_URL
:-
'https://update.k3s.io/v1-release/channels'
}
INSTALL_K3S_CHANNEL
=
${
INSTALL_K3S_CHANNEL
:-
'stable'
}
}
}
# --- check if skip download environment variable set ---
# --- check if skip download environment variable set ---
...
@@ -301,20 +313,21 @@ setup_tmp() {
...
@@ -301,20 +313,21 @@ setup_tmp() {
trap
cleanup INT EXIT
trap
cleanup INT EXIT
}
}
# --- use desired k3s version if defined or find
latest
---
# --- use desired k3s version if defined or find
version from channel
---
get_release_version
()
{
get_release_version
()
{
if
[
-n
"
${
INSTALL_K3S_COMMIT
}
"
]
;
then
if
[
-n
"
${
INSTALL_K3S_COMMIT
}
"
]
;
then
VERSION_K3S
=
"commit
${
INSTALL_K3S_COMMIT
}
"
VERSION_K3S
=
"commit
${
INSTALL_K3S_COMMIT
}
"
elif
[
-n
"
${
INSTALL_K3S_VERSION
}
"
]
;
then
elif
[
-n
"
${
INSTALL_K3S_VERSION
}
"
]
;
then
VERSION_K3S
=
${
INSTALL_K3S_VERSION
}
VERSION_K3S
=
${
INSTALL_K3S_VERSION
}
else
else
info
"Finding latest release"
info
"Finding release for channel
${
INSTALL_K3S_CHANNEL
}
"
version_url
=
"
${
INSTALL_K3S_CHANNEL_URL
}
/
${
INSTALL_K3S_CHANNEL
}
"
case
$DOWNLOADER
in
case
$DOWNLOADER
in
curl
)
curl
)
VERSION_K3S
=
$(
curl
-w
'%{url_effective}'
-
I
-L
-s
-S
${
GITHUB_URL
}
/latest
-o
/dev/null |
sed
-e
's|.*/||'
)
VERSION_K3S
=
$(
curl
-w
'%{url_effective}'
-
L
-s
-S
${
version_url
}
-o
/dev/null |
sed
-e
's|.*/||'
)
;;
;;
wget
)
wget
)
VERSION_K3S
=
$(
wget
-SqO
/dev/null
${
GITHUB_URL
}
/latest
2>&1 |
grep
-i
Location |
sed
-e
's|.*/||'
)
VERSION_K3S
=
$(
wget
-SqO
/dev/null
${
version_url
}
2>&1 |
grep
-i
Location |
sed
-e
's|.*/||'
)
;;
;;
*
)
*
)
fatal
"Incorrect downloader executable '
$DOWNLOADER
'"
fatal
"Incorrect downloader executable '
$DOWNLOADER
'"
...
...
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