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
cf42e01b
Commit
cf42e01b
authored
Dec 08, 2018
by
Laurent Bernaille
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply graceful termination when deleting a service
parent
5ffe0549
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
proxier.go
pkg/proxy/ipvs/proxier.go
+11
-6
No files found.
pkg/proxy/ipvs/proxier.go
View file @
cf42e01b
...
...
@@ -1605,7 +1605,7 @@ func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNode
klog
.
V
(
5
)
.
Infof
(
"Using graceful delete to delete: %v"
,
uniqueRS
)
err
=
proxier
.
gracefuldeleteManager
.
GracefulDeleteRS
(
appliedVirtualServer
,
delDest
)
if
err
!=
nil
{
klog
.
Errorf
(
"Failed to delete destination: %v, error: %v"
,
delDest
,
err
)
klog
.
Errorf
(
"Failed to delete destination: %v, error: %v"
,
uniqueRS
,
err
)
continue
}
}
...
...
@@ -1617,17 +1617,22 @@ func (proxier *Proxier) cleanLegacyService(activeServices map[string]bool, curre
svc
:=
currentServices
[
cs
]
if
_
,
ok
:=
activeServices
[
cs
];
!
ok
{
// This service was not processed in the latest sync loop so before deleting it,
// make sure it does not fall within an excluded CIDR range.
okayToDelete
:=
true
rsList
,
_
:=
proxier
.
ipvs
.
GetRealServers
(
svc
)
// If we still have real servers graceful termination is not done
if
len
(
rsList
)
>
0
{
okayToDelete
=
false
}
// Applying graceful termination to all real servers
for
_
,
rs
:=
range
rsList
{
uniqueRS
:=
GetUniqueRSName
(
svc
,
rs
)
// if there are in terminating real server in this service, then handle it later
if
proxier
.
gracefuldeleteManager
.
InTerminationList
(
uniqueRS
)
{
okayToDelete
=
false
break
klog
.
V
(
5
)
.
Infof
(
"Using graceful delete to delete: %v"
,
uniqueRS
)
if
err
:=
proxier
.
gracefuldeleteManager
.
GracefulDeleteRS
(
svc
,
rs
);
err
!=
nil
{
klog
.
Errorf
(
"Failed to delete destination: %v, error: %v"
,
uniqueRS
,
err
)
}
}
// make sure it does not fall within an excluded CIDR range.
for
_
,
excludedCIDR
:=
range
proxier
.
excludeCIDRs
{
// Any validation of this CIDR already should have occurred.
_
,
n
,
_
:=
net
.
ParseCIDR
(
excludedCIDR
)
...
...
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