mirror of https://github.com/k3s-io/k3s
Disable graceful termination for udp
parent
801f4e7003
commit
a7a3c7d912
|
@ -17,10 +17,10 @@ limitations under the License.
|
||||||
package ipvs
|
package ipvs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"fmt"
|
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
"k8s.io/klog"
|
"k8s.io/klog"
|
||||||
utilipvs "k8s.io/kubernetes/pkg/util/ipvs"
|
utilipvs "k8s.io/kubernetes/pkg/util/ipvs"
|
||||||
|
@ -164,10 +164,10 @@ func (m *GracefulTerminationManager) deleteRsFunc(rsToDelete *listItem) (bool, e
|
||||||
}
|
}
|
||||||
for _, rs := range rss {
|
for _, rs := range rss {
|
||||||
if rsToDelete.RealServer.Equal(rs) {
|
if rsToDelete.RealServer.Equal(rs) {
|
||||||
// Delete RS with no connections
|
// For UDP traffic, no graceful termination, we immediately delete the RS
|
||||||
// For UDP, ActiveConn is always 0
|
// (existing connections will be deleted on the next packet because sysctlExpireNoDestConn=1)
|
||||||
// For TCP, InactiveConn are connections not in ESTABLISHED state
|
// For other protocols, don't delete until all connections have expired)
|
||||||
if rs.ActiveConn+rs.InactiveConn != 0 {
|
if rsToDelete.VirtualServer.Protocol != "udp" && rs.ActiveConn+rs.InactiveConn != 0 {
|
||||||
klog.Infof("Not deleting, RS %v: %v ActiveConn, %v InactiveConn", rsToDelete.String(), rs.ActiveConn, rs.InactiveConn)
|
klog.Infof("Not deleting, RS %v: %v ActiveConn, %v InactiveConn", rsToDelete.String(), rs.ActiveConn, rs.InactiveConn)
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue