Add annotation to make the idle timeout be over 1 hour rather than 1 minute

- Note that 4000 seconds is the maximum value that AWS allows.
This commit is contained in:
Margo Crawford 2021-03-29 13:40:22 -07:00
parent f00a02dcca
commit 3742719427
2 changed files with 4 additions and 0 deletions

View File

@ -441,6 +441,9 @@ func (c *impersonatorConfigController) ensureLoadBalancerIsStarted(ctx context.C
Name: c.generatedLoadBalancerServiceName, Name: c.generatedLoadBalancerServiceName,
Namespace: c.namespace, Namespace: c.namespace,
Labels: c.labels, Labels: c.labels,
Annotations: map[string]string{
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout": "4000", // AWS' default is to time out after 60 seconds idle. Prevent that.
},
}, },
} }
plog.Info("creating load balancer for impersonation proxy", plog.Info("creating load balancer for impersonation proxy",

View File

@ -882,6 +882,7 @@ func TestImpersonatorConfigControllerSync(t *testing.T) {
r.Equal(corev1.ServiceTypeLoadBalancer, createdLoadBalancerService.Spec.Type) r.Equal(corev1.ServiceTypeLoadBalancer, createdLoadBalancerService.Spec.Type)
r.Equal("app-name", createdLoadBalancerService.Spec.Selector["app"]) r.Equal("app-name", createdLoadBalancerService.Spec.Selector["app"])
r.Equal(labels, createdLoadBalancerService.Labels) r.Equal(labels, createdLoadBalancerService.Labels)
r.Equal(map[string]string{"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout": "4000"}, createdLoadBalancerService.Annotations)
} }
var requireLoadBalancerWasDeleted = func(action coretesting.Action) { var requireLoadBalancerWasDeleted = func(action coretesting.Action) {