mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
Merge pull request #89854 from SataQiu/fix-session-affinity-test-20200404
Increase the session affinity timeout to ensure that the test passes
This commit is contained in:
commit
7f7378eddf
@ -3227,6 +3227,18 @@ func execAffinityTestForSessionAffinityTimeout(f *framework.Framework, cs client
|
||||
serviceType := svc.Spec.Type
|
||||
// set an affinity timeout equal to the number of connection requests
|
||||
svcSessionAffinityTimeout := int32(AffinityConfirmCount)
|
||||
if proxyMode, err := proxyMode(f); err == nil {
|
||||
if proxyMode == "ipvs" {
|
||||
// session affinity timeout must be greater than 120 in ipvs mode,
|
||||
// because IPVS module has a hardcoded TIME_WAIT timeout of 120s,
|
||||
// and that value can't be sysctl'ed now.
|
||||
// Ref: https://github.com/torvalds/linux/blob/master/net/netfilter/ipvs/ip_vs_proto_tcp.c
|
||||
// TODO: remove this to speed up testing when IPVS does really respect session affinity timeout
|
||||
svcSessionAffinityTimeout = int32(125)
|
||||
}
|
||||
} else {
|
||||
framework.Logf("Couldn't detect KubeProxy mode - test failure may be expected: %v", err)
|
||||
}
|
||||
svc.Spec.SessionAffinity = v1.ServiceAffinityClientIP
|
||||
svc.Spec.SessionAffinityConfig = &v1.SessionAffinityConfig{
|
||||
ClientIP: &v1.ClientIPConfig{TimeoutSeconds: &svcSessionAffinityTimeout},
|
||||
|
Loading…
Reference in New Issue
Block a user