From 49cb395aed83ab81ec2a2a3a133b9a77a0d02c56 Mon Sep 17 00:00:00 2001 From: Oleksii Kliukin Date: Thu, 27 Apr 2017 15:59:38 +0200 Subject: [PATCH] Set ELB timeout annotation for the service. (#114) By default the ELB terminates the idle connection after 60 seconds. Increase this interval to a more reasonable one of 1 h. --- pkg/cluster/k8sres.go | 1 + pkg/util/constants/constants.go | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/pkg/cluster/k8sres.go b/pkg/cluster/k8sres.go index f4e65455b..43ddbe61d 100644 --- a/pkg/cluster/k8sres.go +++ b/pkg/cluster/k8sres.go @@ -262,6 +262,7 @@ func (c *Cluster) genService(allowedSourceRanges []string) *v1.Service { Labels: c.labelsSet(), Annotations: map[string]string{ constants.ZalandoDnsNameAnnotation: c.dnsName(), + constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue, }, }, Spec: v1.ServiceSpec{ diff --git a/pkg/util/constants/constants.go b/pkg/util/constants/constants.go index c9c193b7a..ac18bf8e5 100644 --- a/pkg/util/constants/constants.go +++ b/pkg/util/constants/constants.go @@ -2,16 +2,18 @@ package constants const ( //Constants - TPRName = "postgresql" - TPRVendor = "acid.zalan.do" - TPRDescription = "Managed PostgreSQL clusters" - TPRApiVersion = "v1" - DataVolumeName = "pgdata" - PasswordLength = 64 - UserSecretTemplate = "%s.%s.credentials.%s.%s" // Username, ClusterName, TPRName, TPRVendor - ZalandoDnsNameAnnotation = "zalando.org/dnsname" - KubeIAmAnnotation = "iam.amazonaws.com/role" - ResourceName = TPRName + "s" - PodRoleMaster = "master" - PodRoleReplica = "replica" + TPRName = "postgresql" + TPRVendor = "acid.zalan.do" + TPRDescription = "Managed PostgreSQL clusters" + TPRApiVersion = "v1" + DataVolumeName = "pgdata" + PasswordLength = 64 + UserSecretTemplate = "%s.%s.credentials.%s.%s" // Username, ClusterName, TPRName, TPRVendor + ZalandoDnsNameAnnotation = "zalando.org/dnsname" + ElbTimeoutAnnotationName = "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout" + ElbTimeoutAnnotationValue = "3600" + KubeIAmAnnotation = "iam.amazonaws.com/role" + ResourceName = TPRName + "s" + PodRoleMaster = "master" + PodRoleReplica = "replica" )