Skip to content

Commit 6703679

Browse files
ivaankobitnami-bot
andauthored
[bitnami/postgresql] allow custom service labels for primary and read (#32368)
* [bitnami/postgresql] allow custom service labels for primary and read Signed-off-by: Ivan Korolev <ivaanko@gmail.com> * fix typo Signed-off-by: Ivan Korolev <ivaanko@gmail.com> * bump chart version Signed-off-by: Ivan Korolev <ivaanko@gmail.com> * Update CHANGELOG.md Signed-off-by: Bitnami Bot <bitnami.bot@broadcom.com> --------- Signed-off-by: Ivan Korolev <ivaanko@gmail.com> Signed-off-by: Bitnami Bot <bitnami.bot@broadcom.com> Co-authored-by: Bitnami Bot <bitnami.bot@broadcom.com>
1 parent c276082 commit 6703679

6 files changed

Lines changed: 25 additions & 5 deletions

File tree

bitnami/postgresql/CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# Changelog
22

3-
## 16.5.4 (2025-03-20)
3+
## 16.5.5 (2025-03-20)
44

5-
* [bitnami/postgresql] Release 16.5.4 ([#32527](https://github.com/bitnami/charts/pull/32527))
5+
* [bitnami/postgresql] allow custom service labels for primary and read ([#32368](https://github.com/bitnami/charts/pull/32368))
6+
7+
## <small>16.5.4 (2025-03-20)</small>
8+
9+
* [bitnami/postgresql] Release 16.5.4 (#32527) ([423422d](https://github.com/bitnami/charts/commit/423422dab9ddcb40b1e8e9bb007ade8e82da7892)), closes [#32527](https://github.com/bitnami/charts/issues/32527)
610

711
## <small>16.5.3 (2025-03-19)</small>
812

bitnami/postgresql/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ maintainers:
3636
name: postgresql
3737
sources:
3838
- https://github.com/bitnami/charts/tree/main/bitnami/postgresql
39-
version: 16.5.4
39+
version: 16.5.5

bitnami/postgresql/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ If you already have data in it, you will fail to sync to standby nodes for all c
546546
| `primary.service.ports.postgresql` | PostgreSQL service port | `5432` |
547547
| `primary.service.nodePorts.postgresql` | Node port for PostgreSQL | `""` |
548548
| `primary.service.clusterIP` | Static clusterIP or None for headless services | `""` |
549+
| `primary.service.labels` | Map of labels to add to the primary service | `{}` |
549550
| `primary.service.annotations` | Annotations for PostgreSQL primary service | `{}` |
550551
| `primary.service.loadBalancerClass` | Load balancer class if service type is `LoadBalancer` | `""` |
551552
| `primary.service.loadBalancerIP` | Load balancer IP if service type is `LoadBalancer` | `""` |
@@ -663,6 +664,7 @@ If you already have data in it, you will fail to sync to standby nodes for all c
663664
| `readReplicas.service.ports.postgresql` | PostgreSQL service port | `5432` |
664665
| `readReplicas.service.nodePorts.postgresql` | Node port for PostgreSQL | `""` |
665666
| `readReplicas.service.clusterIP` | Static clusterIP or None for headless services | `""` |
667+
| `readReplicas.service.labels` | Map of labels to add to the read service | `{}` |
666668
| `readReplicas.service.annotations` | Annotations for PostgreSQL read only service | `{}` |
667669
| `readReplicas.service.loadBalancerClass` | Load balancer class if service type is `LoadBalancer` | `""` |
668670
| `readReplicas.service.loadBalancerIP` | Load balancer IP if service type is `LoadBalancer` | `""` |

bitnami/postgresql/templates/primary/svc.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ kind: Service
88
metadata:
99
name: {{ include "postgresql.v1.primary.fullname" . }}
1010
namespace: {{ include "common.names.namespace" . | quote }}
11-
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
11+
{{- $labels := .Values.commonLabels }}
12+
{{- if .Values.primary.service.labels }}
13+
{{- $labels = include "common.tplvalues.merge" ( dict "values" ( list .Values.primary.service.labels $labels ) "context" . ) }}
14+
{{- end }}
15+
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
1216
app.kubernetes.io/component: primary
1317
{{- if or .Values.commonAnnotations .Values.primary.service.annotations }}
1418
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.primary.service.annotations .Values.commonAnnotations ) "context" . ) }}

bitnami/postgresql/templates/read/svc.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ kind: Service
99
metadata:
1010
name: {{ include "postgresql.v1.readReplica.fullname" . }}
1111
namespace: {{ include "common.names.namespace" . | quote }}
12-
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
12+
{{- $labels := .Values.commonLabels }}
13+
{{- if .Values.readReplicas.service.labels }}
14+
{{- $labels = include "common.tplvalues.merge" ( dict "values" ( list .Values.readReplicas.service.labels $labels ) "context" . ) }}
15+
{{- end }}
16+
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
1317
app.kubernetes.io/component: read
1418
{{- if or .Values.commonAnnotations .Values.readReplicas.service.annotations }}
1519
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.readReplicas.service.annotations .Values.commonAnnotations ) "context" . ) }}

bitnami/postgresql/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,9 @@ primary:
731731
## clusterIP: None
732732
##
733733
clusterIP: ""
734+
## @param primary.service.labels Map of labels to add to the primary service
735+
##
736+
labels: {}
734737
## @param primary.service.annotations Annotations for PostgreSQL primary service
735738
##
736739
annotations: {}
@@ -1185,6 +1188,9 @@ readReplicas:
11851188
## clusterIP: None
11861189
##
11871190
clusterIP: ""
1191+
## @param readReplicas.service.labels Map of labels to add to the read service
1192+
##
1193+
labels: {}
11881194
## @param readReplicas.service.annotations Annotations for PostgreSQL read only service
11891195
##
11901196
annotations: {}

0 commit comments

Comments
 (0)