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
e6add207
Commit
e6add207
authored
Jun 15, 2017
by
Minhan Xia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
append KUBE-HOSTPORTS to system chains instead of prepend
parent
695d4385
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
hostport.go
pkg/kubelet/network/hostport/hostport.go
+4
-1
No files found.
pkg/kubelet/network/hostport/hostport.go
View file @
e6add207
...
@@ -184,7 +184,10 @@ func ensureKubeHostportChains(iptables utiliptables.Interface, natInterfaceName
...
@@ -184,7 +184,10 @@ func ensureKubeHostportChains(iptables utiliptables.Interface, natInterfaceName
"-m"
,
"addrtype"
,
"--dst-type"
,
"LOCAL"
,
"-m"
,
"addrtype"
,
"--dst-type"
,
"LOCAL"
,
"-j"
,
string
(
kubeHostportsChain
)}
"-j"
,
string
(
kubeHostportsChain
)}
for
_
,
tc
:=
range
tableChainsNeedJumpServices
{
for
_
,
tc
:=
range
tableChainsNeedJumpServices
{
if
_
,
err
:=
iptables
.
EnsureRule
(
utiliptables
.
Prepend
,
tc
.
table
,
tc
.
chain
,
args
...
);
err
!=
nil
{
// KUBE-HOSTPORTS chain needs to be appended to the system chains.
// This ensures KUBE-SERVICES chain gets processed first.
// Since rules in KUBE-HOSTPORTS chain matches broader cases, allow the more specific rules to be processed first.
if
_
,
err
:=
iptables
.
EnsureRule
(
utiliptables
.
Append
,
tc
.
table
,
tc
.
chain
,
args
...
);
err
!=
nil
{
return
fmt
.
Errorf
(
"Failed to ensure that %s chain %s jumps to %s: %v"
,
tc
.
table
,
tc
.
chain
,
kubeHostportsChain
,
err
)
return
fmt
.
Errorf
(
"Failed to ensure that %s chain %s jumps to %s: %v"
,
tc
.
table
,
tc
.
chain
,
kubeHostportsChain
,
err
)
}
}
}
}
...
...
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