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
bbafb86e
Commit
bbafb86e
authored
Nov 07, 2023
by
Brad Davidson
Committed by
Brad Davidson
Nov 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use iptables-save/iptables-restore if it will corrupt rules
Signed-off-by:
Brad Davidson
<
brad.davidson@rancher.com
>
parent
9e13aad4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
9 deletions
+19
-9
install.sh
install.sh
+18
-8
install.sh.sha256sum
install.sh.sha256sum
+1
-1
No files found.
install.sh
View file @
bbafb86e
...
@@ -999,6 +999,19 @@ openrc_start() {
...
@@ -999,6 +999,19 @@ openrc_start() {
$SUDO
${
FILE_K3S_SERVICE
}
restart
$SUDO
${
FILE_K3S_SERVICE
}
restart
}
}
has_working_xtables
()
{
if
command
-v
"
$1
-save"
1> /dev/null
&&
command
-v
"
$1
-restore"
1> /dev/null
;
then
if
$SUDO
$1
-save
2>/dev/null |
grep
-q
'^-A CNI-HOSTPORT-MASQ -j MASQUERADE$'
;
then
warn
"Host
$1
-save/
$1
-restore tools are incompatible with existing rules"
else
return
0
fi
else
info
"Host
$1
-save/
$1
-restore tools not found"
fi
return
1
}
# --- startup systemd or openrc service ---
# --- startup systemd or openrc service ---
service_enable_and_start
()
{
service_enable_and_start
()
{
if
[
-f
"/proc/cgroups"
]
&&
[
"
$(
grep
memory /proc/cgroups |
while
read
-r
n n n enabled
;
do
echo
$enabled
;
done)
"
-eq
0
]
;
if
[
-f
"/proc/cgroups"
]
&&
[
"
$(
grep
memory /proc/cgroups |
while
read
-r
n n n enabled
;
do
echo
$enabled
;
done)
"
-eq
0
]
;
...
@@ -1019,14 +1032,11 @@ service_enable_and_start() {
...
@@ -1019,14 +1032,11 @@ service_enable_and_start() {
return
return
fi
fi
if
command
-v
iptables-save 1> /dev/null
&&
command
-v
iptables-restore 1> /dev/null
for
XTABLES
in
iptables ip6tables
;
do
then
if
has_working_xtables
${
XTABLES
}
;
then
$SUDO
iptables-save |
grep
-v
KUBE- |
grep
-iv
flannel |
$SUDO
iptables-restore
$SUDO
${
XTABLES
}
-save
2>/dev/null |
grep
-v
KUBE- |
grep
-iv
flannel |
$SUDO
${
XTABLES
}
-restore
fi
fi
if
command
-v
ip6tables-save 1> /dev/null
&&
command
-v
ip6tables-restore 1> /dev/null
done
then
$SUDO
ip6tables-save |
grep
-v
KUBE- |
grep
-iv
flannel |
$SUDO
ip6tables-restore
fi
[
"
${
HAS_SYSTEMD
}
"
=
true
]
&&
systemd_start
[
"
${
HAS_SYSTEMD
}
"
=
true
]
&&
systemd_start
[
"
${
HAS_OPENRC
}
"
=
true
]
&&
openrc_start
[
"
${
HAS_OPENRC
}
"
=
true
]
&&
openrc_start
...
...
install.sh.sha256sum
View file @
bbafb86e
ff8b7b4028299c878180c1288efa73205c54c7c3fbc2d313fcc666374526d221
install.sh
8c71108b5602b40ab6a9e60fe66403302b458046cb8afd1980d3c183d25278ac
install.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