Skip to content

Commit c6b2f1c

Browse files
fmuleroBitnami Containers
and
Bitnami Containers
authoredMay 29, 2024··
[bitnami/postgresql] Enable PodDisruptionBudgets (#26530)
* [bitnami/postgresql] Enable PodDisruptionBudgets Signed-off-by: Fran Mulero <fmulero@vmware.com> * Update CHANGELOG.md Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> --------- Signed-off-by: Fran Mulero <fmulero@vmware.com> Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> Co-authored-by: Bitnami Containers <bitnami-bot@vmware.com>
1 parent 096d86c commit c6b2f1c

File tree

6 files changed

+91
-3
lines changed

6 files changed

+91
-3
lines changed
 

‎bitnami/postgresql/CHANGELOG.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# Changelog
22

3-
## 15.4.2 (2024-05-28)
3+
## 15.5.0 (2024-05-29)
44

5-
* [bitnami/postgresql] Release 15.4.2 ([#26475](https://github.com/bitnami/charts/pull/26475))
5+
* [bitnami/postgresql] Enable PodDisruptionBudgets ([#26530](https://github.com/bitnami/charts/pull/26530))
6+
7+
## <small>15.4.2 (2024-05-28)</small>
8+
9+
* [bitnami/postgresql] Release 15.4.2 (#26475) ([748b515](https://github.com/bitnami/charts/commit/748b51516a41ff8af151a530a0e5e0d9a62808e4)), closes [#26475](https://github.com/bitnami/charts/issues/26475)
610

711
## <small>15.4.1 (2024-05-27)</small>
812

‎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.4.2
38+
version: 15.5.0

‎bitnami/postgresql/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,9 @@ If you already have data in it, you will fail to sync to standby nodes for all c
457457
| `primary.extraVolumes` | Optionally specify extra list of additional volumes for the PostgreSQL Primary pod(s) | `[]` |
458458
| `primary.sidecars` | Add additional sidecar containers to the PostgreSQL Primary pod(s) | `[]` |
459459
| `primary.initContainers` | Add additional init containers to the PostgreSQL Primary pod(s) | `[]` |
460+
| `primary.pdb.create` | Enable/disable a Pod Disruption Budget creation | `true` |
461+
| `primary.pdb.minAvailable` | Minimum number/percentage of pods that should remain scheduled | `""` |
462+
| `primary.pdb.maxUnavailable` | Maximum number/percentage of pods that may be made unavailable. Defaults to `1` if both `primary.pdb.minAvailable` and `primary.pdb.maxUnavailable` are empty. | `""` |
460463
| `primary.extraPodSpec` | Optionally specify extra PodSpec for the PostgreSQL Primary pod(s) | `{}` |
461464
| `primary.networkPolicy.enabled` | Specifies whether a NetworkPolicy should be created | `true` |
462465
| `primary.networkPolicy.allowExternal` | Don't require server label for connections | `true` |
@@ -571,6 +574,9 @@ If you already have data in it, you will fail to sync to standby nodes for all c
571574
| `readReplicas.extraVolumes` | Optionally specify extra list of additional volumes for the PostgreSQL read only pod(s) | `[]` |
572575
| `readReplicas.sidecars` | Add additional sidecar containers to the PostgreSQL read only pod(s) | `[]` |
573576
| `readReplicas.initContainers` | Add additional init containers to the PostgreSQL read only pod(s) | `[]` |
577+
| `readReplicas.pdb.create` | Enable/disable a Pod Disruption Budget creation | `true` |
578+
| `readReplicas.pdb.minAvailable` | Minimum number/percentage of pods that should remain scheduled | `""` |
579+
| `readReplicas.pdb.maxUnavailable` | Maximum number/percentage of pods that may be made unavailable. Defaults to `1` if both `readReplicas.pdb.minAvailable` and `readReplicas.pdb.maxUnavailable` are empty. | `""` |
574580
| `readReplicas.extraPodSpec` | Optionally specify extra PodSpec for the PostgreSQL read only pod(s) | `{}` |
575581
| `readReplicas.networkPolicy.enabled` | Specifies whether a NetworkPolicy should be created | `true` |
576582
| `readReplicas.networkPolicy.allowExternal` | Don't require server label for connections | `true` |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{{- /*
2+
Copyright Broadcom, Inc. All Rights Reserved.
3+
SPDX-License-Identifier: APACHE-2.0
4+
*/}}
5+
6+
{{- if .Values.primary.pdb.create }}
7+
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
8+
kind: PodDisruptionBudget
9+
metadata:
10+
name: {{ include "postgresql.v1.primary.fullname" . }}
11+
namespace: {{ .Release.Namespace | quote }}
12+
{{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.primary.labels .Values.commonLabels ) "context" . ) }}
13+
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
14+
app.kubernetes.io/component: primary
15+
{{- if .Values.commonAnnotations }}
16+
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
17+
{{- end }}
18+
spec:
19+
{{- if .Values.primary.pdb.minAvailable }}
20+
minAvailable: {{ .Values.primary.pdb.minAvailable }}
21+
{{- end }}
22+
{{- if or .Values.primary.pdb.maxUnavailable ( not .Values.primary.pdb.minAvailable ) }}
23+
maxUnavailable: {{ .Values.primary.pdb.maxUnavailable | default 1 }}
24+
{{- end }}
25+
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.primary.podLabels .Values.commonLabels ) "context" . ) }}
26+
selector:
27+
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
28+
app.kubernetes.io/component: primary
29+
{{- end }}
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{{- /*
2+
Copyright Broadcom, Inc. All Rights Reserved.
3+
SPDX-License-Identifier: APACHE-2.0
4+
*/}}
5+
6+
{{- if and ( eq .Values.architecture "replication" ) .Values.readReplicas.pdb.create }}
7+
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
8+
kind: PodDisruptionBudget
9+
metadata:
10+
name: {{ include "postgresql.v1.readReplica.fullname" . }}
11+
namespace: {{ .Release.Namespace | quote }}
12+
{{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.readReplicas.labels .Values.commonLabels ) "context" . ) }}
13+
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
14+
app.kubernetes.io/component: read
15+
{{- if .Values.commonAnnotations }}
16+
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
17+
{{- end }}
18+
spec:
19+
{{- if .Values.readReplicas.pdb.minAvailable }}
20+
minAvailable: {{ .Values.readReplicas.pdb.minAvailable }}
21+
{{- end }}
22+
{{- if or .Values.readReplicas.pdb.maxUnavailable ( not .Values.readReplicas.pdb.minAvailable ) }}
23+
maxUnavailable: {{ .Values.readReplicas.pdb.maxUnavailable | default 1 }}
24+
{{- end }}
25+
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.readReplicas.podLabels .Values.commonLabels ) "context" . ) }}
26+
selector:
27+
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
28+
app.kubernetes.io/component: read
29+
{{- end }}

‎bitnami/postgresql/values.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,16 @@ primary:
613613
## command: ['do', 'something']
614614
##
615615
initContainers: []
616+
## Pod Disruption Budget configuration
617+
## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb
618+
## @param primary.pdb.create Enable/disable a Pod Disruption Budget creation
619+
## @param primary.pdb.minAvailable Minimum number/percentage of pods that should remain scheduled
620+
## @param primary.pdb.maxUnavailable Maximum number/percentage of pods that may be made unavailable. Defaults to `1` if both `primary.pdb.minAvailable` and `primary.pdb.maxUnavailable` are empty.
621+
##
622+
pdb:
623+
create: true
624+
minAvailable: ""
625+
maxUnavailable: ""
616626
## @param primary.extraPodSpec Optionally specify extra PodSpec for the PostgreSQL Primary pod(s)
617627
##
618628
extraPodSpec: {}
@@ -1057,6 +1067,16 @@ readReplicas:
10571067
## command: ['do', 'something']
10581068
##
10591069
initContainers: []
1070+
## Pod Disruption Budget configuration
1071+
## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb
1072+
## @param readReplicas.pdb.create Enable/disable a Pod Disruption Budget creation
1073+
## @param readReplicas.pdb.minAvailable Minimum number/percentage of pods that should remain scheduled
1074+
## @param readReplicas.pdb.maxUnavailable Maximum number/percentage of pods that may be made unavailable. Defaults to `1` if both `readReplicas.pdb.minAvailable` and `readReplicas.pdb.maxUnavailable` are empty.
1075+
##
1076+
pdb:
1077+
create: true
1078+
minAvailable: ""
1079+
maxUnavailable: ""
10601080
## @param readReplicas.extraPodSpec Optionally specify extra PodSpec for the PostgreSQL read only pod(s)
10611081
##
10621082
extraPodSpec: {}

0 commit comments

Comments
 (0)
Please sign in to comment.