From fbf037ddaa0b1389b8a85213de59d95aaaa2f2f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Mart=C3=ADnez=20Rinc=C3=B3n?= Date: Mon, 13 May 2024 11:08:19 +0200 Subject: [PATCH] [bitnami/postgresql] Allow loadBalancerClass to be customized (#25569) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add loadBalancerClass field Signed-off-by: Jaime Martínez Rincón * chore: bump version Signed-off-by: Jaime Martínez Rincón * Update README.md with readme-generator-for-helm Signed-off-by: Bitnami Containers Signed-off-by: Jaime Martínez Rincón * Update Chart.yaml Signed-off-by: Andrés Bono --------- Signed-off-by: Jaime Martínez Rincón Signed-off-by: Bitnami Containers Signed-off-by: Andrés Bono Co-authored-by: Bitnami Containers Co-authored-by: Andrés Bono Signed-off-by: Francois Marceau --- bitnami/postgresql/Chart.yaml | 2 +- bitnami/postgresql/README.md | 2 ++ bitnami/postgresql/templates/primary/svc.yaml | 3 +++ bitnami/postgresql/templates/read/svc.yaml | 3 +++ bitnami/postgresql/values.yaml | 8 ++++++++ 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/bitnami/postgresql/Chart.yaml b/bitnami/postgresql/Chart.yaml index ee45b5b85d711d..54d246fe63c442 100644 --- a/bitnami/postgresql/Chart.yaml +++ b/bitnami/postgresql/Chart.yaml @@ -35,4 +35,4 @@ maintainers: name: postgresql sources: - https://github.com/bitnami/charts/tree/main/bitnami/postgresql -version: 15.2.13 +version: 15.3.0 diff --git a/bitnami/postgresql/README.md b/bitnami/postgresql/README.md index b9b08721706e11..4bb943c06d1c56 100644 --- a/bitnami/postgresql/README.md +++ b/bitnami/postgresql/README.md @@ -470,6 +470,7 @@ If you already have data in it, you will fail to sync to standby nodes for all c | `primary.service.nodePorts.postgresql` | Node port for PostgreSQL | `""` | | `primary.service.clusterIP` | Static clusterIP or None for headless services | `""` | | `primary.service.annotations` | Annotations for PostgreSQL primary service | `{}` | +| `primary.service.loadBalancerClass` | Load balancer class if service type is `LoadBalancer` | `""` | | `primary.service.loadBalancerIP` | Load balancer IP if service type is `LoadBalancer` | `""` | | `primary.service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | | `primary.service.loadBalancerSourceRanges` | Addresses that are allowed when service is LoadBalancer | `[]` | @@ -583,6 +584,7 @@ If you already have data in it, you will fail to sync to standby nodes for all c | `readReplicas.service.nodePorts.postgresql` | Node port for PostgreSQL | `""` | | `readReplicas.service.clusterIP` | Static clusterIP or None for headless services | `""` | | `readReplicas.service.annotations` | Annotations for PostgreSQL read only service | `{}` | +| `readReplicas.service.loadBalancerClass` | Load balancer class if service type is `LoadBalancer` | `""` | | `readReplicas.service.loadBalancerIP` | Load balancer IP if service type is `LoadBalancer` | `""` | | `readReplicas.service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | | `readReplicas.service.loadBalancerSourceRanges` | Addresses that are allowed when service is LoadBalancer | `[]` | diff --git a/bitnami/postgresql/templates/primary/svc.yaml b/bitnami/postgresql/templates/primary/svc.yaml index d8a49b6a24f5d2..62fe7d40c382fa 100644 --- a/bitnami/postgresql/templates/primary/svc.yaml +++ b/bitnami/postgresql/templates/primary/svc.yaml @@ -22,6 +22,9 @@ spec: {{- if and (eq .Values.primary.service.type "LoadBalancer") (not (empty .Values.primary.service.loadBalancerSourceRanges)) }} loadBalancerSourceRanges: {{ .Values.primary.service.loadBalancerSourceRanges | toJson}} {{- end }} + {{- if and (eq .Values.primary.service.type "LoadBalancer") (not (empty .Values.primary.service.loadBalancerClass)) }} + loadBalancerClass: {{ .Values.primary.service.loadBalancerClass }} + {{- end }} {{- if and (eq .Values.primary.service.type "LoadBalancer") (not (empty .Values.primary.service.loadBalancerIP)) }} loadBalancerIP: {{ .Values.primary.service.loadBalancerIP }} {{- end }} diff --git a/bitnami/postgresql/templates/read/svc.yaml b/bitnami/postgresql/templates/read/svc.yaml index 6cde291e24fa49..d230acb6895d54 100644 --- a/bitnami/postgresql/templates/read/svc.yaml +++ b/bitnami/postgresql/templates/read/svc.yaml @@ -23,6 +23,9 @@ spec: {{- if and (eq .Values.readReplicas.service.type "LoadBalancer") (not (empty .Values.readReplicas.service.loadBalancerSourceRanges)) }} loadBalancerSourceRanges: {{ .Values.readReplicas.service.loadBalancerSourceRanges }} {{- end }} + {{- if and (eq .Values.readReplicas.service.type "LoadBalancer") (not (empty .Values.readReplicas.service.loadBalancerClass)) }} + loadBalancerClass: {{ .Values.readReplicas.service.loadBalancerClass }} + {{- end }} {{- if and (eq .Values.readReplicas.service.type "LoadBalancer") (not (empty .Values.readReplicas.service.loadBalancerIP)) }} loadBalancerIP: {{ .Values.readReplicas.service.loadBalancerIP }} {{- end }} diff --git a/bitnami/postgresql/values.yaml b/bitnami/postgresql/values.yaml index 86890027e2c2ac..c549d19ac81195 100644 --- a/bitnami/postgresql/values.yaml +++ b/bitnami/postgresql/values.yaml @@ -696,6 +696,10 @@ primary: ## @param primary.service.annotations Annotations for PostgreSQL primary service ## annotations: {} + ## @param primary.service.loadBalancerClass Load balancer class if service type is `LoadBalancer` + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-class + ## + loadBalancerClass: "" ## @param primary.service.loadBalancerIP Load balancer IP if service type is `LoadBalancer` ## Set the LoadBalancer service type to internal only ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer @@ -1136,6 +1140,10 @@ readReplicas: ## @param readReplicas.service.annotations Annotations for PostgreSQL read only service ## annotations: {} + ## @param readReplicas.service.loadBalancerClass Load balancer class if service type is `LoadBalancer` + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-class + ## + loadBalancerClass: "" ## @param readReplicas.service.loadBalancerIP Load balancer IP if service type is `LoadBalancer` ## Set the LoadBalancer service type to internal only ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer