From 0b481e8412efa1b8e4a36025d13adfc76d19ce6b Mon Sep 17 00:00:00 2001 From: Kelly Campbell Date: Sat, 26 Jan 2019 20:13:30 -0500 Subject: [PATCH] Shorten health check timeout for AWS NLB with externalTrafficPolicy: Local This is a fix for issue #73362 --- .../k8s.io/legacy-cloud-providers/aws/aws_loadbalancer.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/staging/src/k8s.io/legacy-cloud-providers/aws/aws_loadbalancer.go b/staging/src/k8s.io/legacy-cloud-providers/aws/aws_loadbalancer.go index 06374699ec9..9021b64e138 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/aws/aws_loadbalancer.go +++ b/staging/src/k8s.io/legacy-cloud-providers/aws/aws_loadbalancer.go @@ -550,6 +550,11 @@ func (c *Cloud) ensureTargetGroup(targetGroup *elbv2.TargetGroup, serviceName ty // Account for externalTrafficPolicy = "Local" if mapping.HealthCheckPort != mapping.TrafficPort { input.HealthCheckPort = aws.String(strconv.Itoa(int(mapping.HealthCheckPort))) + // Local traffic should have more aggressive health checking by default. + // Min allowed by NLB is 10 seconds, and 2 threshold count + input.HealthCheckIntervalSeconds = aws.Int64(10) + input.HealthyThresholdCount = aws.Int64(2) + input.UnhealthyThresholdCount = aws.Int64(2) } result, err := c.elbv2.CreateTargetGroup(input)