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
059d6057
Unverified
Commit
059d6057
authored
Feb 19, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Feb 19, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #73323 from prameshj/clear-externalip-conntrack
Clear conntrack entries for externalIP and LoadBalancer IP
parents
7b203c68
24d3ab83
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
0 deletions
+42
-0
proxier.go
pkg/proxy/iptables/proxier.go
+12
-0
proxier.go
pkg/proxy/ipvs/proxier.go
+12
-0
service.go
pkg/proxy/service.go
+14
-0
types.go
pkg/proxy/types.go
+4
-0
No files found.
pkg/proxy/iptables/proxier.go
View file @
059d6057
...
@@ -613,6 +613,18 @@ func (proxier *Proxier) deleteEndpointConnections(connectionMap []proxy.ServiceE
...
@@ -613,6 +613,18 @@ func (proxier *Proxier) deleteEndpointConnections(connectionMap []proxy.ServiceE
if
err
!=
nil
{
if
err
!=
nil
{
klog
.
Errorf
(
"Failed to delete %s endpoint connections, error: %v"
,
epSvcPair
.
ServicePortName
.
String
(),
err
)
klog
.
Errorf
(
"Failed to delete %s endpoint connections, error: %v"
,
epSvcPair
.
ServicePortName
.
String
(),
err
)
}
}
for
_
,
extIP
:=
range
svcInfo
.
ExternalIPStrings
()
{
err
:=
conntrack
.
ClearEntriesForNAT
(
proxier
.
exec
,
extIP
,
endpointIP
,
v1
.
ProtocolUDP
)
if
err
!=
nil
{
klog
.
Errorf
(
"Failed to delete %s endpoint connections for externalIP %s, error: %v"
,
epSvcPair
.
ServicePortName
.
String
(),
extIP
,
err
)
}
}
for
_
,
lbIP
:=
range
svcInfo
.
LoadBalancerIPStrings
()
{
err
:=
conntrack
.
ClearEntriesForNAT
(
proxier
.
exec
,
lbIP
,
endpointIP
,
v1
.
ProtocolUDP
)
if
err
!=
nil
{
klog
.
Errorf
(
"Failed to delete %s endpoint connections for LoabBalancerIP %s, error: %v"
,
epSvcPair
.
ServicePortName
.
String
(),
lbIP
,
err
)
}
}
}
}
}
}
}
}
...
...
pkg/proxy/ipvs/proxier.go
View file @
059d6057
...
@@ -1499,6 +1499,18 @@ func (proxier *Proxier) deleteEndpointConnections(connectionMap []proxy.ServiceE
...
@@ -1499,6 +1499,18 @@ func (proxier *Proxier) deleteEndpointConnections(connectionMap []proxy.ServiceE
if
err
!=
nil
{
if
err
!=
nil
{
klog
.
Errorf
(
"Failed to delete %s endpoint connections, error: %v"
,
epSvcPair
.
ServicePortName
.
String
(),
err
)
klog
.
Errorf
(
"Failed to delete %s endpoint connections, error: %v"
,
epSvcPair
.
ServicePortName
.
String
(),
err
)
}
}
for
_
,
extIP
:=
range
svcInfo
.
ExternalIPStrings
()
{
err
:=
conntrack
.
ClearEntriesForNAT
(
proxier
.
exec
,
extIP
,
endpointIP
,
v1
.
ProtocolUDP
)
if
err
!=
nil
{
klog
.
Errorf
(
"Failed to delete %s endpoint connections for externalIP %s, error: %v"
,
epSvcPair
.
ServicePortName
.
String
(),
extIP
,
err
)
}
}
for
_
,
lbIP
:=
range
svcInfo
.
LoadBalancerIPStrings
()
{
err
:=
conntrack
.
ClearEntriesForNAT
(
proxier
.
exec
,
lbIP
,
endpointIP
,
v1
.
ProtocolUDP
)
if
err
!=
nil
{
klog
.
Errorf
(
"Failed to delete %s endpoint connections for LoabBalancerIP %s, error: %v"
,
epSvcPair
.
ServicePortName
.
String
(),
lbIP
,
err
)
}
}
}
}
}
}
}
}
...
...
pkg/proxy/service.go
View file @
059d6057
...
@@ -79,6 +79,20 @@ func (info *BaseServiceInfo) GetNodePort() int {
...
@@ -79,6 +79,20 @@ func (info *BaseServiceInfo) GetNodePort() int {
return
info
.
NodePort
return
info
.
NodePort
}
}
// ExternalIPStrings is part of ServicePort interface.
func
(
info
*
BaseServiceInfo
)
ExternalIPStrings
()
[]
string
{
return
info
.
ExternalIPs
}
// LoadBalancerIPStrings is part of ServicePort interface.
func
(
info
*
BaseServiceInfo
)
LoadBalancerIPStrings
()
[]
string
{
var
ips
[]
string
for
_
,
ing
:=
range
info
.
LoadBalancerStatus
.
Ingress
{
ips
=
append
(
ips
,
ing
.
IP
)
}
return
ips
}
func
(
sct
*
ServiceChangeTracker
)
newBaseServiceInfo
(
port
*
v1
.
ServicePort
,
service
*
v1
.
Service
)
*
BaseServiceInfo
{
func
(
sct
*
ServiceChangeTracker
)
newBaseServiceInfo
(
port
*
v1
.
ServicePort
,
service
*
v1
.
Service
)
*
BaseServiceInfo
{
onlyNodeLocalEndpoints
:=
false
onlyNodeLocalEndpoints
:=
false
if
apiservice
.
RequestsOnlyLocalTraffic
(
service
)
{
if
apiservice
.
RequestsOnlyLocalTraffic
(
service
)
{
...
...
pkg/proxy/types.go
View file @
059d6057
...
@@ -50,6 +50,10 @@ type ServicePort interface {
...
@@ -50,6 +50,10 @@ type ServicePort interface {
String
()
string
String
()
string
// ClusterIPString returns service cluster IP in string format.
// ClusterIPString returns service cluster IP in string format.
ClusterIPString
()
string
ClusterIPString
()
string
// ExternalIPStrings returns service ExternalIPs as a string array.
ExternalIPStrings
()
[]
string
// LoadBalancerIPStrings returns service LoadBalancerIPs as a string array.
LoadBalancerIPStrings
()
[]
string
// GetProtocol returns service protocol.
// GetProtocol returns service protocol.
GetProtocol
()
v1
.
Protocol
GetProtocol
()
v1
.
Protocol
// GetHealthCheckNodePort returns service health check node port if present. If return 0, it means not present.
// GetHealthCheckNodePort returns service health check node port if present. If return 0, it means not present.
...
...
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