Skip to content

Commit e6b91b7

Browse files
committed
Do not set aws-load-balancer-connection-idle-timeout by default
1 parent d495825 commit e6b91b7

File tree

5 files changed

+14
-39
lines changed

5 files changed

+14
-39
lines changed

docs/administrator.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -887,15 +887,13 @@ cluster manifest. In the case any of these variables are omitted from the
887887
manifest, the operator configuration settings `enable_master_load_balancer` and
888888
`enable_replica_load_balancer` apply. Note that the operator settings affect
889889
all Postgresql services running in all namespaces watched by the operator.
890-
If load balancing is enabled two default annotations will be applied to its
891-
services:
890+
If load balancing is enabled the following default annotation will be applied to
891+
its services:
892892

893893
- `external-dns.alpha.kubernetes.io/hostname` with the value defined by the
894894
operator configs `master_dns_name_format` and `replica_dns_name_format`.
895895
This value can't be overwritten. If any changing in its value is needed, it
896896
MUST be done changing the DNS format operator config parameters; and
897-
- `service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout` with
898-
a default value of "3600".
899897

900898
There are multiple options to specify service annotations that will be merged
901899
with each other and override in the following order (where latter take

e2e/tests/test_e2e.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -724,14 +724,12 @@ def test_enable_disable_connection_pooler(self):
724724

725725
master_annotations = {
726726
"external-dns.alpha.kubernetes.io/hostname": "acid-minimal-cluster-pooler.default.db.example.com",
727-
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout": "3600",
728727
}
729728
self.eventuallyTrue(lambda: k8s.check_service_annotations(
730729
master_pooler_label+","+pooler_label, master_annotations), "Wrong annotations")
731730

732731
replica_annotations = {
733732
"external-dns.alpha.kubernetes.io/hostname": "acid-minimal-cluster-pooler-repl.default.db.example.com",
734-
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout": "3600",
735733
}
736734
self.eventuallyTrue(lambda: k8s.check_service_annotations(
737735
replica_pooler_label+","+pooler_label, replica_annotations), "Wrong annotations")

pkg/cluster/cluster_test.go

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,7 @@ func TestServiceAnnotations(t *testing.T) {
680680
operatorAnnotations: make(map[string]string),
681681
serviceAnnotations: make(map[string]string),
682682
expect: map[string]string{
683-
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg.test.db.example.com,test-stg.acid.db.example.com",
684-
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout": "3600",
683+
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg.test.db.example.com,test-stg.acid.db.example.com",
685684
},
686685
},
687686
{
@@ -702,8 +701,7 @@ func TestServiceAnnotations(t *testing.T) {
702701
operatorAnnotations: make(map[string]string),
703702
serviceAnnotations: make(map[string]string),
704703
expect: map[string]string{
705-
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg.test.db.example.com,test-stg.acid.db.example.com",
706-
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout": "3600",
704+
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg.test.db.example.com,test-stg.acid.db.example.com",
707705
},
708706
},
709707
{
@@ -714,8 +712,7 @@ func TestServiceAnnotations(t *testing.T) {
714712
operatorAnnotations: make(map[string]string),
715713
serviceAnnotations: map[string]string{"foo": "bar"},
716714
expect: map[string]string{
717-
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg.test.db.example.com,test-stg.acid.db.example.com",
718-
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout": "3600",
715+
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg.test.db.example.com,test-stg.acid.db.example.com",
719716
"foo": "bar",
720717
},
721718
},
@@ -737,8 +734,7 @@ func TestServiceAnnotations(t *testing.T) {
737734
operatorAnnotations: map[string]string{"foo": "bar"},
738735
serviceAnnotations: make(map[string]string),
739736
expect: map[string]string{
740-
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg.test.db.example.com,test-stg.acid.db.example.com",
741-
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout": "3600",
737+
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg.test.db.example.com,test-stg.acid.db.example.com",
742738
"foo": "bar",
743739
},
744740
},
@@ -780,8 +776,7 @@ func TestServiceAnnotations(t *testing.T) {
780776
"external-dns.alpha.kubernetes.io/hostname": "wrong.external-dns-name.example.com",
781777
},
782778
expect: map[string]string{
783-
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg.test.db.example.com,test-stg.acid.db.example.com",
784-
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout": "3600",
779+
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg.test.db.example.com,test-stg.acid.db.example.com",
785780
},
786781
},
787782
{
@@ -792,8 +787,7 @@ func TestServiceAnnotations(t *testing.T) {
792787
serviceAnnotations: make(map[string]string),
793788
operatorAnnotations: make(map[string]string),
794789
expect: map[string]string{
795-
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg.test.db.example.com,test-stg.acid.db.example.com",
796-
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout": "3600",
790+
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg.test.db.example.com,test-stg.acid.db.example.com",
797791
},
798792
},
799793
{
@@ -835,8 +829,7 @@ func TestServiceAnnotations(t *testing.T) {
835829
operatorAnnotations: make(map[string]string),
836830
serviceAnnotations: make(map[string]string),
837831
expect: map[string]string{
838-
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg-repl.test.db.example.com,test-stg-repl.acid.db.example.com",
839-
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout": "3600",
832+
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg-repl.test.db.example.com,test-stg-repl.acid.db.example.com",
840833
},
841834
},
842835
{
@@ -857,8 +850,7 @@ func TestServiceAnnotations(t *testing.T) {
857850
operatorAnnotations: make(map[string]string),
858851
serviceAnnotations: make(map[string]string),
859852
expect: map[string]string{
860-
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg-repl.test.db.example.com,test-stg-repl.acid.db.example.com",
861-
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout": "3600",
853+
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg-repl.test.db.example.com,test-stg-repl.acid.db.example.com",
862854
},
863855
},
864856
{
@@ -869,8 +861,7 @@ func TestServiceAnnotations(t *testing.T) {
869861
operatorAnnotations: make(map[string]string),
870862
serviceAnnotations: map[string]string{"foo": "bar"},
871863
expect: map[string]string{
872-
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg-repl.test.db.example.com,test-stg-repl.acid.db.example.com",
873-
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout": "3600",
864+
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg-repl.test.db.example.com,test-stg-repl.acid.db.example.com",
874865
"foo": "bar",
875866
},
876867
},
@@ -892,8 +883,7 @@ func TestServiceAnnotations(t *testing.T) {
892883
operatorAnnotations: map[string]string{"foo": "bar"},
893884
serviceAnnotations: make(map[string]string),
894885
expect: map[string]string{
895-
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg-repl.test.db.example.com,test-stg-repl.acid.db.example.com",
896-
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout": "3600",
886+
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg-repl.test.db.example.com,test-stg-repl.acid.db.example.com",
897887
"foo": "bar",
898888
},
899889
},
@@ -935,8 +925,7 @@ func TestServiceAnnotations(t *testing.T) {
935925
"external-dns.alpha.kubernetes.io/hostname": "wrong.external-dns-name.example.com",
936926
},
937927
expect: map[string]string{
938-
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg-repl.test.db.example.com,test-stg-repl.acid.db.example.com",
939-
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout": "3600",
928+
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg-repl.test.db.example.com,test-stg-repl.acid.db.example.com",
940929
},
941930
},
942931
{
@@ -947,8 +936,7 @@ func TestServiceAnnotations(t *testing.T) {
947936
serviceAnnotations: make(map[string]string),
948937
operatorAnnotations: make(map[string]string),
949938
expect: map[string]string{
950-
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg-repl.test.db.example.com,test-stg-repl.acid.db.example.com",
951-
"service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout": "3600",
939+
"external-dns.alpha.kubernetes.io/hostname": "acid-test-stg-repl.test.db.example.com,test-stg-repl.acid.db.example.com",
952940
},
953941
},
954942
{

pkg/cluster/connection_pooler.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,10 +533,6 @@ func (c *Cluster) generatePoolerServiceAnnotations(role PostgresRole, spec *acid
533533
annotations := c.getCustomServiceAnnotations(role, spec)
534534

535535
if c.shouldCreateLoadBalancerForPoolerService(role, spec) {
536-
// set ELB Timeout annotation with default value
537-
if _, ok := annotations[constants.ElbTimeoutAnnotationName]; !ok {
538-
annotations[constants.ElbTimeoutAnnotationName] = constants.ElbTimeoutAnnotationValue
539-
}
540536
// -repl suffix will be added by replicaDNSName
541537
clusterNameWithPoolerSuffix := c.connectionPoolerName(Master)
542538
if role == Master {

pkg/cluster/k8sres.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,11 +2047,6 @@ func (c *Cluster) generateServiceAnnotations(role PostgresRole, spec *acidv1.Pos
20472047
if c.shouldCreateLoadBalancerForService(role, spec) {
20482048
dnsName := c.dnsName(role)
20492049

2050-
// Just set ELB Timeout annotation with default value, if it does not
2051-
// have a custom value
2052-
if _, ok := annotations[constants.ElbTimeoutAnnotationName]; !ok {
2053-
annotations[constants.ElbTimeoutAnnotationName] = constants.ElbTimeoutAnnotationValue
2054-
}
20552050
// External DNS name annotation is not customizable
20562051
annotations[constants.ZalandoDNSNameAnnotation] = dnsName
20572052
}

0 commit comments

Comments
 (0)