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
8006a39c
Commit
8006a39c
authored
Aug 12, 2015
by
BenTheElder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #12596
Fix for
https://github.com/kubernetes/kubernetes/issues/12596
Disconnect the pure-iptables proxy’s services chain when starting the userspace proxy.
parent
098dc407
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
proxier.go
pkg/proxy/userspace/proxier.go
+15
-0
No files found.
pkg/proxy/userspace/proxier.go
View file @
8006a39c
...
@@ -131,6 +131,8 @@ func createProxier(loadBalancer LoadBalancer, listenIP net.IP, iptables iptables
...
@@ -131,6 +131,8 @@ func createProxier(loadBalancer LoadBalancer, listenIP net.IP, iptables iptables
if
proxyPorts
==
nil
{
if
proxyPorts
==
nil
{
proxyPorts
=
newPortAllocator
(
util
.
PortRange
{})
proxyPorts
=
newPortAllocator
(
util
.
PortRange
{})
}
}
glog
.
V
(
2
)
.
Info
(
"Tearing down pure-iptables proxy rules. Errors here are acceptable."
)
tearDownIptablesProxierRules
(
iptables
)
// Set up the iptables foundations we need.
// Set up the iptables foundations we need.
if
err
:=
iptablesInit
(
iptables
);
err
!=
nil
{
if
err
:=
iptablesInit
(
iptables
);
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to initialize iptables: %v"
,
err
)
return
nil
,
fmt
.
Errorf
(
"failed to initialize iptables: %v"
,
err
)
...
@@ -151,6 +153,19 @@ func createProxier(loadBalancer LoadBalancer, listenIP net.IP, iptables iptables
...
@@ -151,6 +153,19 @@ func createProxier(loadBalancer LoadBalancer, listenIP net.IP, iptables iptables
},
nil
},
nil
}
}
// remove the iptables rules from the pure iptables Proxier
func
tearDownIptablesProxierRules
(
ipt
iptables
.
Interface
)
{
//TODO: actually tear down all rules and chains.
//NOTE: this needs to be kept in sync with the proxy/iptables Proxier's rules.
args
:=
[]
string
{
"-j"
,
"KUBE-SERVICES"
}
if
err
:=
ipt
.
DeleteRule
(
iptables
.
TableNAT
,
iptables
.
ChainOutput
,
args
...
);
err
!=
nil
{
glog
.
Errorf
(
"Error removing pure-iptables proxy rule: %v"
,
err
)
}
if
err
:=
ipt
.
DeleteRule
(
iptables
.
TableNAT
,
iptables
.
ChainPrerouting
,
args
...
);
err
!=
nil
{
glog
.
Errorf
(
"Error removing pure-iptables proxy rule: %v"
,
err
)
}
}
// The periodic interval for checking the state of things.
// The periodic interval for checking the state of things.
const
syncInterval
=
5
*
time
.
Second
const
syncInterval
=
5
*
time
.
Second
...
...
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