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
dd4f3431
Unverified
Commit
dd4f3431
authored
Jul 23, 2019
by
Erik Wilson
Committed by
GitHub
Jul 23, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #657 from erikwilson/install-symlink-update
Install script symlink update
parents
8014e1a5
c443101b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
16 deletions
+24
-16
install.sh
install.sh
+24
-16
No files found.
install.sh
View file @
dd4f3431
...
...
@@ -22,6 +22,10 @@ set -e
# - INSTALL_K3S_SKIP_DOWNLOAD
# If set to true will not download k3s hash or binary.
#
# - INSTALL_K3S_SYMLINK
# If set to 'skip' will not create symlinks, 'force' will overwrite,
# default will symlink if command does not exist in path.
#
# - INSTALL_K3S_SKIP_START
# If set to true will not start k3s service.
#
...
...
@@ -369,18 +373,23 @@ download_and_verify() {
# --- add additional utility links ---
create_symlinks
()
{
[
"
${
INSTALL_K3S_BIN_DIR_READ_ONLY
}
"
=
"true"
]
&&
return
if
[
!
-e
${
BIN_DIR
}
/kubectl
]
;
then
info
"Creating
${
BIN_DIR
}
/kubectl symlink to k3s"
$SUDO
ln
-s
k3s
${
BIN_DIR
}
/kubectl
fi
if
[
!
-e
${
BIN_DIR
}
/crictl
]
;
then
info
"Creating
${
BIN_DIR
}
/crictl symlink to k3s"
$SUDO
ln
-s
k3s
${
BIN_DIR
}
/crictl
fi
[
"
${
INSTALL_K3S_SYMLINK
}
"
=
"skip"
]
&&
return
for
cmd
in
kubectl crictl ctr
;
do
if
[
!
-e
${
BIN_DIR
}
/
${
cmd
}
]
||
[
"
${
INSTALL_K3S_SYMLINK
}
"
=
"force"
]
;
then
which_cmd
=
$(
which
${
cmd
}
||
true
)
if
[
-z
"
${
which_cmd
}
"
]
||
[
"
${
INSTALL_K3S_SYMLINK
}
"
=
"force"
]
;
then
info
"Creating
${
BIN_DIR
}
/
${
cmd
}
symlink to k3s"
$SUDO
ln
-sf
k3s
${
BIN_DIR
}
/
${
cmd
}
else
info
"Skipping
${
BIN_DIR
}
/
${
cmd
}
symlink to k3s, command exists in PATH at
${
which_cmd
}
"
fi
else
info
"Skipping
${
BIN_DIR
}
/
${
cmd
}
symlink to k3s, already exists"
fi
done
}
# --- create killall script ---
create_killall
()
{
[
"
${
INSTALL_K3S_BIN_DIR_READ_ONLY
}
"
=
"true"
]
&&
return
...
...
@@ -470,12 +479,11 @@ if (ls ${SYSTEMD_DIR}/k3s*.service || ls /etc/init.d/k3s*) >/dev/null 2>&1; then
exit
fi
if [ -L
${
BIN_DIR
}
/kubectl ]; then
rm -f
${
BIN_DIR
}
/kubectl
fi
if [ -L
${
BIN_DIR
}
/crictl ]; then
rm -f
${
BIN_DIR
}
/crictl
fi
for cmd in kubectl crictl ctr; do
if [ -L
${
BIN_DIR
}
/\
$cmd
]; then
rm -f
${
BIN_DIR
}
/\
$cmd
fi
done
rm -rf /etc/rancher/k3s
rm -rf /var/lib/rancher/k3s
...
...
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