mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Merge pull request #72106 from DataDog/lbernail/improve-svc-deletion
kube-proxy/IPVS Improve service deletion
This commit is contained in:
commit
64bf2ac5f2
@ -168,6 +168,7 @@ func (m *GracefulTerminationManager) deleteRsFunc(rsToDelete *listItem) (bool, e
|
|||||||
// For UDP, ActiveConn is always 0
|
// For UDP, ActiveConn is always 0
|
||||||
// For TCP, InactiveConn are connections not in ESTABLISHED state
|
// For TCP, InactiveConn are connections not in ESTABLISHED state
|
||||||
if rs.ActiveConn+rs.InactiveConn != 0 {
|
if rs.ActiveConn+rs.InactiveConn != 0 {
|
||||||
|
klog.Infof("Not deleting, RS %v: %v ActiveConn, %v InactiveConn", rsToDelete.String(), rs.ActiveConn, rs.InactiveConn)
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
klog.Infof("Deleting rs: %s", rsToDelete.String())
|
klog.Infof("Deleting rs: %s", rsToDelete.String())
|
||||||
|
@ -1643,6 +1643,10 @@ func (proxier *Proxier) cleanLegacyService(activeServices map[string]bool, curre
|
|||||||
// Applying graceful termination to all real servers
|
// Applying graceful termination to all real servers
|
||||||
for _, rs := range rsList {
|
for _, rs := range rsList {
|
||||||
uniqueRS := GetUniqueRSName(svc, rs)
|
uniqueRS := GetUniqueRSName(svc, rs)
|
||||||
|
// If RS is already in the graceful termination list, no need to add it again
|
||||||
|
if proxier.gracefuldeleteManager.InTerminationList(uniqueRS) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
klog.V(5).Infof("Using graceful delete to delete: %v", uniqueRS)
|
klog.V(5).Infof("Using graceful delete to delete: %v", uniqueRS)
|
||||||
if err := proxier.gracefuldeleteManager.GracefulDeleteRS(svc, rs); err != nil {
|
if err := proxier.gracefuldeleteManager.GracefulDeleteRS(svc, rs); err != nil {
|
||||||
klog.Errorf("Failed to delete destination: %v, error: %v", uniqueRS, err)
|
klog.Errorf("Failed to delete destination: %v, error: %v", uniqueRS, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user