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
cb5b9edf
Unverified
Commit
cb5b9edf
authored
Nov 18, 2020
by
Chris Kim
Committed by
GitHub
Nov 18, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2536 from Oats87/issues/k3s/2517-2518
Enhance install.sh to help with k3s upgrade and uninstall scenarios
parents
316ff1f3
25d2ce43
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
8 deletions
+25
-8
install.sh
install.sh
+25
-8
No files found.
install.sh
View file @
cb5b9edf
...
...
@@ -432,15 +432,26 @@ setup_binary() {
# --- setup selinux policy ---
setup_selinux
()
{
case
${
INSTALL_K3S_CHANNEL
}
in
*
testing
)
rpm_channel
=
testing
;;
*
latest
)
rpm_channel
=
latest
;;
*
)
rpm_channel
=
stable
;;
esac
rpm_site
=
"rpm.rancher.io"
if
[
"
${
INSTALL_K3S_CHANNEL
}
"
=
"testing"
]
;
then
rpm_site
=
"rpm-
${
INSTALL_K3S_CHANNEL
}
.rancher.io"
if
[
"
${
rpm_channel
}
"
=
"testing"
]
;
then
rpm_site
=
"rpm-
testing
.rancher.io"
fi
policy_hint
=
"please install:
yum install -y container-selinux selinux-policy-base
yum install -y https://
${
rpm_site
}
/k3s/
${
INSTALL_K3S_CHANNEL
}
/common/centos/7/noarch/k3s-selinux-0.2-1.el7_8.noarch.rpm
yum install -y https://
${
rpm_site
}
/k3s/
${
rpm_channel
}
/common/centos/7/noarch/k3s-selinux-0.2-1.el7_8.noarch.rpm
"
policy_error
=
fatal
if
[
"
$INSTALL_K3S_SELINUX_WARN
"
=
true
]
;
then
...
...
@@ -450,7 +461,7 @@ setup_selinux() {
if
[
"
$INSTALL_K3S_SKIP_SELINUX_RPM
"
=
true
]
||
can_skip_download
;
then
info
"Skipping installation of SELinux RPM"
else
install_selinux_rpm
${
rpm_site
}
install_selinux_rpm
${
rpm_site
}
${
rpm_channel
}
fi
if
!
$SUDO
chcon
-u
system_u
-r
object_r
-t
container_runtime_exec_t
${
BIN_DIR
}
/k3s
>
/dev/null 2>&1
;
then
...
...
@@ -483,10 +494,11 @@ install_selinux_rpm() {
;;
esac
fi
$SUDO
tee
/etc/yum.repos.d/rancher-k3s-common-
${
INSTALL_K3S_CHANNEL
}
.repo
>
/dev/null
<<
EOF
[rancher-k3s-common-
${
INSTALL_K3S_CHANNEL
}
]
name=Rancher K3s Common (
${
INSTALL_K3S_CHANNEL
}
)
baseurl=https://
${
1
}
/k3s/
${
INSTALL_K3S_CHANNEL
}
/common/centos/
${
maj_ver
}
/noarch
$SUDO
rm
-f
/etc/yum.repos.d/rancher-k3s-common
*
.repo
$SUDO
tee
/etc/yum.repos.d/rancher-k3s-common.repo
>
/dev/null
<<
EOF
[rancher-k3s-common-
${
2
}
]
name=Rancher K3s Common (
${
2
}
)
baseurl=https://
${
1
}
/k3s/
${
2
}
/common/centos/
${
maj_ver
}
/noarch
enabled=1
gpgcheck=1
gpgkey=https://
${
1
}
/public.key
...
...
@@ -661,6 +673,11 @@ rm -rf /var/lib/rancher/k3s
rm -rf /var/lib/kubelet
rm -f
${
BIN_DIR
}
/k3s
rm -f
${
KILLALL_K3S_SH
}
if type yum >/dev/null 2>&1; then
yum remove -y k3s-selinux
rm -f /etc/yum.repos.d/rancher-k3s-common*.repo
fi
EOF
$SUDO
chmod
755
${
UNINSTALL_K3S_SH
}
$SUDO
chown
root:root
${
UNINSTALL_K3S_SH
}
...
...
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