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.
This commit is contained in:
Oleksii Kliukin 2017-04-27 15:59:38 +02:00 committed by Murat Kabilov
parent 2370659c69
commit 49cb395aed
2 changed files with 15 additions and 12 deletions

View File

@ -262,6 +262,7 @@ func (c *Cluster) genService(allowedSourceRanges []string) *v1.Service {
Labels: c.labelsSet(), Labels: c.labelsSet(),
Annotations: map[string]string{ Annotations: map[string]string{
constants.ZalandoDnsNameAnnotation: c.dnsName(), constants.ZalandoDnsNameAnnotation: c.dnsName(),
constants.ElbTimeoutAnnotationName: constants.ElbTimeoutAnnotationValue,
}, },
}, },
Spec: v1.ServiceSpec{ Spec: v1.ServiceSpec{

View File

@ -2,16 +2,18 @@ package constants
const ( const (
//Constants //Constants
TPRName = "postgresql" TPRName = "postgresql"
TPRVendor = "acid.zalan.do" TPRVendor = "acid.zalan.do"
TPRDescription = "Managed PostgreSQL clusters" TPRDescription = "Managed PostgreSQL clusters"
TPRApiVersion = "v1" TPRApiVersion = "v1"
DataVolumeName = "pgdata" DataVolumeName = "pgdata"
PasswordLength = 64 PasswordLength = 64
UserSecretTemplate = "%s.%s.credentials.%s.%s" // Username, ClusterName, TPRName, TPRVendor UserSecretTemplate = "%s.%s.credentials.%s.%s" // Username, ClusterName, TPRName, TPRVendor
ZalandoDnsNameAnnotation = "zalando.org/dnsname" ZalandoDnsNameAnnotation = "zalando.org/dnsname"
KubeIAmAnnotation = "iam.amazonaws.com/role" ElbTimeoutAnnotationName = "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout"
ResourceName = TPRName + "s" ElbTimeoutAnnotationValue = "3600"
PodRoleMaster = "master" KubeIAmAnnotation = "iam.amazonaws.com/role"
PodRoleReplica = "replica" ResourceName = TPRName + "s"
PodRoleMaster = "master"
PodRoleReplica = "replica"
) )