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
53514dcc
Commit
53514dcc
authored
Aug 13, 2015
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12597 from BenTheElder/userspace_iptables_cleanup
Fix #12596
parents
4516eeba
8006a39c
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 @
53514dcc
...
...
@@ -131,6 +131,8 @@ func createProxier(loadBalancer LoadBalancer, listenIP net.IP, iptables iptables
if
proxyPorts
==
nil
{
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.
if
err
:=
iptablesInit
(
iptables
);
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to initialize iptables: %v"
,
err
)
...
...
@@ -151,6 +153,19 @@ func createProxier(loadBalancer LoadBalancer, listenIP net.IP, iptables iptables
},
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.
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