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
21340c50
Commit
21340c50
authored
Apr 03, 2019
by
Vallery Lancey
Committed by
Vallery Lancey
Apr 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed cleanup for non-current kube-proxy modes in newProxyServer()
parent
e1696382
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
31 deletions
+1
-31
server_others.go
cmd/kube-proxy/app/server_others.go
+1
-29
server_windows.go
cmd/kube-proxy/app/server_windows.go
+0
-2
No files found.
cmd/kube-proxy/app/server_others.go
View file @
21340c50
...
@@ -53,13 +53,12 @@ import (
...
@@ -53,13 +53,12 @@ import (
// NewProxyServer returns a new ProxyServer.
// NewProxyServer returns a new ProxyServer.
func
NewProxyServer
(
o
*
Options
)
(
*
ProxyServer
,
error
)
{
func
NewProxyServer
(
o
*
Options
)
(
*
ProxyServer
,
error
)
{
return
newProxyServer
(
o
.
config
,
o
.
CleanupAndExit
,
o
.
CleanupIPVS
,
o
.
scheme
,
o
.
master
)
return
newProxyServer
(
o
.
config
,
o
.
CleanupAndExit
,
o
.
scheme
,
o
.
master
)
}
}
func
newProxyServer
(
func
newProxyServer
(
config
*
proxyconfigapi
.
KubeProxyConfiguration
,
config
*
proxyconfigapi
.
KubeProxyConfiguration
,
cleanupAndExit
bool
,
cleanupAndExit
bool
,
cleanupIPVS
bool
,
scheme
*
runtime
.
Scheme
,
scheme
*
runtime
.
Scheme
,
master
string
)
(
*
ProxyServer
,
error
)
{
master
string
)
(
*
ProxyServer
,
error
)
{
...
@@ -174,17 +173,6 @@ func newProxyServer(
...
@@ -174,17 +173,6 @@ func newProxyServer(
proxier
=
proxierIPTables
proxier
=
proxierIPTables
serviceEventHandler
=
proxierIPTables
serviceEventHandler
=
proxierIPTables
endpointsEventHandler
=
proxierIPTables
endpointsEventHandler
=
proxierIPTables
// No turning back. Remove artifacts that might still exist from the userspace Proxier.
klog
.
V
(
0
)
.
Info
(
"Tearing down inactive rules."
)
// TODO this has side effects that should only happen when Run() is invoked.
userspace
.
CleanupLeftovers
(
iptInterface
)
// IPVS Proxier will generate some iptables rules, need to clean them before switching to other proxy mode.
// Besides, ipvs proxier will create some ipvs rules as well. Because there is no way to tell if a given
// ipvs rule is created by IPVS proxier or not. Users should explicitly specify `--clean-ipvs=true` to flush
// all ipvs rules when kube-proxy start up. Users do this operation should be with caution.
if
canUseIPVS
{
ipvs
.
CleanupLeftovers
(
ipvsInterface
,
iptInterface
,
ipsetInterface
,
cleanupIPVS
)
}
}
else
if
proxyMode
==
proxyModeIPVS
{
}
else
if
proxyMode
==
proxyModeIPVS
{
klog
.
V
(
0
)
.
Info
(
"Using ipvs Proxier."
)
klog
.
V
(
0
)
.
Info
(
"Using ipvs Proxier."
)
proxierIPVS
,
err
:=
ipvs
.
NewProxier
(
proxierIPVS
,
err
:=
ipvs
.
NewProxier
(
...
@@ -213,10 +201,6 @@ func newProxyServer(
...
@@ -213,10 +201,6 @@ func newProxyServer(
proxier
=
proxierIPVS
proxier
=
proxierIPVS
serviceEventHandler
=
proxierIPVS
serviceEventHandler
=
proxierIPVS
endpointsEventHandler
=
proxierIPVS
endpointsEventHandler
=
proxierIPVS
klog
.
V
(
0
)
.
Info
(
"Tearing down inactive rules."
)
// TODO this has side effects that should only happen when Run() is invoked.
userspace
.
CleanupLeftovers
(
iptInterface
)
iptables
.
CleanupLeftovers
(
iptInterface
)
}
else
{
}
else
{
klog
.
V
(
0
)
.
Info
(
"Using userspace Proxier."
)
klog
.
V
(
0
)
.
Info
(
"Using userspace Proxier."
)
// This is a proxy.LoadBalancer which NewProxier needs but has methods we don't need for
// This is a proxy.LoadBalancer which NewProxier needs but has methods we don't need for
...
@@ -242,18 +226,6 @@ func newProxyServer(
...
@@ -242,18 +226,6 @@ func newProxyServer(
}
}
serviceEventHandler
=
proxierUserspace
serviceEventHandler
=
proxierUserspace
proxier
=
proxierUserspace
proxier
=
proxierUserspace
// Remove artifacts from the iptables and ipvs Proxier, if not on Windows.
klog
.
V
(
0
)
.
Info
(
"Tearing down inactive rules."
)
// TODO this has side effects that should only happen when Run() is invoked.
iptables
.
CleanupLeftovers
(
iptInterface
)
// IPVS Proxier will generate some iptables rules, need to clean them before switching to other proxy mode.
// Besides, ipvs proxier will create some ipvs rules as well. Because there is no way to tell if a given
// ipvs rule is created by IPVS proxier or not. Users should explicitly specify `--clean-ipvs=true` to flush
// all ipvs rules when kube-proxy start up. Users do this operation should be with caution.
if
canUseIPVS
{
ipvs
.
CleanupLeftovers
(
ipvsInterface
,
iptInterface
,
ipsetInterface
,
cleanupIPVS
)
}
}
}
iptInterface
.
AddReloadFunc
(
proxier
.
Sync
)
iptInterface
.
AddReloadFunc
(
proxier
.
Sync
)
...
...
cmd/kube-proxy/app/server_windows.go
View file @
21340c50
...
@@ -144,8 +144,6 @@ func newProxyServer(config *proxyconfigapi.KubeProxyConfiguration, cleanupAndExi
...
@@ -144,8 +144,6 @@ func newProxyServer(config *proxyconfigapi.KubeProxyConfiguration, cleanupAndExi
}
}
proxier
=
proxierUserspace
proxier
=
proxierUserspace
serviceEventHandler
=
proxierUserspace
serviceEventHandler
=
proxierUserspace
klog
.
V
(
0
)
.
Info
(
"Tearing down pure-winkernel proxy rules."
)
winkernel
.
CleanupLeftovers
()
}
}
return
&
ProxyServer
{
return
&
ProxyServer
{
...
...
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