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
60bde9fb
Commit
60bde9fb
authored
Jan 07, 2018
by
m1093782566
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix nodeport localhost martian source error
parent
cfc1d473
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
proxier.go
pkg/proxy/iptables/proxier.go
+8
-1
No files found.
pkg/proxy/iptables/proxier.go
View file @
60bde9fb
...
@@ -1172,6 +1172,7 @@ func (proxier *Proxier) syncProxyRules() {
...
@@ -1172,6 +1172,7 @@ func (proxier *Proxier) syncProxyRules() {
// Build rules for each service.
// Build rules for each service.
var
svcNameString
string
var
svcNameString
string
for
svcName
,
svcInfo
:=
range
proxier
.
serviceMap
{
for
svcName
,
svcInfo
:=
range
proxier
.
serviceMap
{
isIPv6
:=
utilproxy
.
IsIPv6
(
svcInfo
.
clusterIP
)
protocol
:=
strings
.
ToLower
(
string
(
svcInfo
.
protocol
))
protocol
:=
strings
.
ToLower
(
string
(
svcInfo
.
protocol
))
svcNameString
=
svcInfo
.
serviceNameString
svcNameString
=
svcInfo
.
serviceNameString
...
@@ -1384,7 +1385,6 @@ func (proxier *Proxier) syncProxyRules() {
...
@@ -1384,7 +1385,6 @@ func (proxier *Proxier) syncProxyRules() {
// This is very low impact. The NodePort range is intentionally obscure, and unlikely to actually collide with real Services.
// This is very low impact. The NodePort range is intentionally obscure, and unlikely to actually collide with real Services.
// This only affects UDP connections, which are not common.
// This only affects UDP connections, which are not common.
// See issue: https://github.com/kubernetes/kubernetes/issues/49881
// See issue: https://github.com/kubernetes/kubernetes/issues/49881
isIPv6
:=
utilproxy
.
IsIPv6
(
svcInfo
.
clusterIP
)
err
:=
utilproxy
.
ClearUDPConntrackForPort
(
proxier
.
exec
,
lp
.
Port
,
isIPv6
)
err
:=
utilproxy
.
ClearUDPConntrackForPort
(
proxier
.
exec
,
lp
.
Port
,
isIPv6
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"Failed to clear udp conntrack for port %d, error: %v"
,
lp
.
Port
,
err
)
glog
.
Errorf
(
"Failed to clear udp conntrack for port %d, error: %v"
,
lp
.
Port
,
err
)
...
@@ -1407,6 +1407,13 @@ func (proxier *Proxier) syncProxyRules() {
...
@@ -1407,6 +1407,13 @@ func (proxier *Proxier) syncProxyRules() {
}
else
{
}
else
{
// TODO: Make all nodePorts jump to the firewall chain.
// TODO: Make all nodePorts jump to the firewall chain.
// Currently we only create it for loadbalancers (#33586).
// Currently we only create it for loadbalancers (#33586).
// Fix localhost martian source error
loopback
:=
"127.0.0.0/8"
if
isIPv6
{
loopback
=
"::1/128"
}
writeLine
(
proxier
.
natRules
,
append
(
args
,
"-s"
,
loopback
,
"-j"
,
string
(
KubeMarkMasqChain
))
...
)
writeLine
(
proxier
.
natRules
,
append
(
args
,
"-j"
,
string
(
svcXlbChain
))
...
)
writeLine
(
proxier
.
natRules
,
append
(
args
,
"-j"
,
string
(
svcXlbChain
))
...
)
}
}
...
...
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