Merge pull request #533 from vmware-tanzu/eks-load-balancer-annotation

Add annotation to make the idle timeout be over 1 hour rather than 1 minute
This commit is contained in:
Margo Crawford 2021-03-30 11:12:54 -07:00 committed by GitHub
commit 608be8332e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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) {