Skip to content

Commit dc93455

Browse files
authoredMar 20, 2024··
[bitnami/postgresql] Add a NetworkPolicy to allow backup pods to access primary nodes (#24363)
* [bitnami/postgresql] Add a NetworkPolicy to allow backup pods to access primary node Signed-off-by: Axel FAUVEL <axel.fauvel@orange.com> * [bitnami/postgresql] Bump chart version Signed-off-by: Axel FAUVEL <axel.fauvel@orange.com> * [bitnami/postgresql] Remove duplicated key Signed-off-by: Axel FAUVEL <axel.fauvel@orange.com> --------- Signed-off-by: Axel FAUVEL <axel.fauvel@orange.com>
1 parent 012a84b commit dc93455

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-1
lines changed
 

‎bitnami/postgresql/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ maintainers:
3535
name: postgresql
3636
sources:
3737
- https://github.com/bitnami/charts/tree/main/bitnami/postgresql
38-
version: 15.0.0
38+
version: 15.1.0

‎bitnami/postgresql/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,7 @@ If you already have data in it, you will fail to sync to standby nodes for all c
638638
| `backup.cronjob.nodeSelector` | Node labels for PostgreSQL backup CronJob pod assignment | `{}` |
639639
| `backup.cronjob.resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, small, medium, large, xlarge, 2xlarge). This is ignored if backup.cronjob.resources is set (backup.cronjob.resources is recommended for production). | `nano` |
640640
| `backup.cronjob.resources` | Set container requests and limits for different resources like CPU or memory | `{}` |
641+
| `backup.cronjob.networkPolicy.enabled` | Specifies whether a NetworkPolicy should be created | `true` |
641642
| `backup.cronjob.storage.existingClaim` | Provide an existing `PersistentVolumeClaim` (only when `architecture=standalone`) | `""` |
642643
| `backup.cronjob.storage.resourcePolicy` | Setting it to "keep" to avoid removing PVCs during a helm delete operation. Leaving it empty will delete PVCs after the chart deleted | `""` |
643644
| `backup.cronjob.storage.storageClass` | PVC Storage Class for the backup data volume | `""` |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{{- /*
2+
Copyright VMware, Inc.
3+
SPDX-License-Identifier: APACHE-2.0
4+
*/}}
5+
6+
{{- if .Values.backup.cronjob.networkPolicy.enabled }}
7+
kind: NetworkPolicy
8+
apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }}
9+
metadata:
10+
name: {{ include "postgresql.v1.primary.fullname" . }}-pgdumpall
11+
namespace: {{ include "common.names.namespace" . | quote }}
12+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
13+
app.kubernetes.io/component: pg_dumpall
14+
{{- if .Values.commonAnnotations }}
15+
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
16+
{{- end }}
17+
spec:
18+
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.backup.cronjob.podLabels .Values.commonLabels ) "context" . ) }}
19+
podSelector:
20+
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
21+
app.kubernetes.io/component: pg_dumpall
22+
policyTypes:
23+
- Egress
24+
egress:
25+
- ports:
26+
- port: 5432
27+
protocol: TCP
28+
{{- end }}

‎bitnami/postgresql/values.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -1319,6 +1319,10 @@ backup:
13191319
## limits:
13201320
## cpu: 2
13211321
## memory: 1024Mi
1322+
networkPolicy:
1323+
## @param backup.cronjob.networkPolicy.enabled Specifies whether a NetworkPolicy should be created
1324+
##
1325+
enabled: true
13221326
storage:
13231327
## @param backup.cronjob.storage.existingClaim Provide an existing `PersistentVolumeClaim` (only when `architecture=standalone`)
13241328
## If defined, PVC must be created manually before volume will be bound

0 commit comments

Comments
 (0)
Please sign in to comment.