Skip to content

Commit 4890ba6

Browse files
fmuleroBitnami Containers
and
Bitnami Containers
authoredMay 23, 2024··
[bitnami/redis] Enable PodDisruptionBudgets (#26355)
* [bitnami/redis] Enable PodDisruptionBudgets Signed-off-by: Fran Mulero <fmulero@vmware.com> * Update CHANGELOG.md Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> * Amend PDB names 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 1864e42 commit 4890ba6

File tree

7 files changed

+633
-555
lines changed

7 files changed

+633
-555
lines changed
 

‎bitnami/redis/CHANGELOG.md

+540-535
Large diffs are not rendered by default.

‎bitnami/redis/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ maintainers:
3636
name: redis
3737
sources:
3838
- https://github.com/bitnami/charts/tree/main/bitnami/redis
39-
version: 19.4.0
39+
version: 19.5.0

‎bitnami/redis/README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,9 @@ helm install my-release --set master.persistence.existingClaim=PVC_NAME oci://RE
603603
| `master.serviceAccount.name` | The name of the ServiceAccount to use. | `""` |
604604
| `master.serviceAccount.automountServiceAccountToken` | Whether to auto mount the service account token | `false` |
605605
| `master.serviceAccount.annotations` | Additional custom annotations for the ServiceAccount | `{}` |
606+
| `master.pdb.create` | Enable/disable a Pod Disruption Budget creation | `true` |
607+
| `master.pdb.minAvailable` | Minimum number/percentage of pods that should remain scheduled | `{}` |
608+
| `master.pdb.maxUnavailable` | Maximum number/percentage of pods that may be made unavailable. Defaults to `1` if both `master.pdb.minAvailable` and `master.pdb.maxUnavailable` are empty. | `{}` |
606609

607610
### Redis&reg; replicas configuration parameters
608611

@@ -727,6 +730,9 @@ helm install my-release --set master.persistence.existingClaim=PVC_NAME oci://RE
727730
| `replica.serviceAccount.name` | The name of the ServiceAccount to use. | `""` |
728731
| `replica.serviceAccount.automountServiceAccountToken` | Whether to auto mount the service account token | `false` |
729732
| `replica.serviceAccount.annotations` | Additional custom annotations for the ServiceAccount | `{}` |
733+
| `replica.pdb.create` | Enable/disable a Pod Disruption Budget creation | `true` |
734+
| `replica.pdb.minAvailable` | Minimum number/percentage of pods that should remain scheduled | `{}` |
735+
| `replica.pdb.maxUnavailable` | Maximum number/percentage of pods that may be made unavailable. Defaults to `1` if both `replica.pdb.minAvailable` and `replica.pdb.maxUnavailable` are empty. | `{}` |
730736

731737
### Redis&reg; Sentinel configuration parameters
732738

@@ -862,9 +868,7 @@ helm install my-release --set master.persistence.existingClaim=PVC_NAME oci://RE
862868
| `serviceAccount.name` | The name of the ServiceAccount to use. | `""` |
863869
| `serviceAccount.automountServiceAccountToken` | Whether to auto mount the service account token | `false` |
864870
| `serviceAccount.annotations` | Additional custom annotations for the ServiceAccount | `{}` |
865-
| `pdb.create` | Specifies whether a PodDisruptionBudget should be created | `false` |
866-
| `pdb.minAvailable` | Min number of pods that must still be available after the eviction | `1` |
867-
| `pdb.maxUnavailable` | Max number of pods that can be unavailable after the eviction | `""` |
871+
| `pdb` | DEPRECATED Please use `master.pdb` and `replica.pdb` values instead | `{}` |
868872
| `tls.enabled` | Enable TLS traffic | `false` |
869873
| `tls.authClients` | Require clients to authenticate | `true` |
870874
| `tls.autoGenerated` | Enable autogenerated certificates | `false` |
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{{- /*
2+
Copyright Broadcom, Inc. All Rights Reserved.
3+
SPDX-License-Identifier: APACHE-2.0
4+
*/}}
5+
6+
{{- if and .Values.master.pdb.create (gt (int64 .Values.master.count) 0) (or (eq .Values.architecture "replication") (not .Values.sentinel.enabled)) }}
7+
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
8+
kind: PodDisruptionBudget
9+
metadata:
10+
name: {{ printf "%s-master" (include "common.names.fullname" .) }}
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: master
14+
{{- if .Values.commonAnnotations }}
15+
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
16+
{{- end }}
17+
spec:
18+
{{- if .Values.master.pdb.minAvailable }}
19+
minAvailable: {{ .Values.master.pdb.minAvailable }}
20+
{{- end }}
21+
{{- if or .Values.master.pdb.maxUnavailable (not .Values.master.pdb.minAvailable)}}
22+
maxUnavailable: {{ .Values.master.pdb.maxUnavailable | default 1 }}
23+
{{- end }}
24+
selector:
25+
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }}
26+
app.kubernetes.io/component: master
27+
{{- end }}

‎bitnami/redis/templates/pdb.yaml ‎bitnami/redis/templates/replicas/pdb.yaml

+9-6
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,26 @@ Copyright Broadcom, Inc. All Rights Reserved.
33
SPDX-License-Identifier: APACHE-2.0
44
*/}}
55

6-
{{- if .Values.pdb.create }}
6+
{{- $pdb := coalesce .Values.replica.pdb .Values.pdb }}
7+
{{- if and (eq .Values.architecture "replication") (not .Values.sentinel.enabled) $pdb.create }}
78
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
89
kind: PodDisruptionBudget
910
metadata:
10-
name: {{ template "common.names.fullname" . }}
11+
name: {{ printf "%s-replicas" (include "common.names.fullname" .) }}
1112
namespace: {{ include "common.names.namespace" . | quote }}
1213
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
14+
app.kubernetes.io/component: replica
1315
{{- if .Values.commonAnnotations }}
1416
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
1517
{{- end }}
1618
spec:
17-
{{- if .Values.pdb.minAvailable }}
18-
minAvailable: {{ .Values.pdb.minAvailable }}
19+
{{- if $pdb.minAvailable }}
20+
minAvailable: {{ $pdb.minAvailable }}
1921
{{- end }}
20-
{{- if .Values.pdb.maxUnavailable }}
21-
maxUnavailable: {{ .Values.pdb.maxUnavailable }}
22+
{{- if or $pdb.maxUnavailable (not $pdb.minAvailable) }}
23+
maxUnavailable: {{ $pdb.maxUnavailable | default 1 }}
2224
{{- end }}
2325
selector:
2426
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }}
27+
app.kubernetes.io/component: replica
2528
{{- end }}
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{{- /*
2+
Copyright Broadcom, Inc. All Rights Reserved.
3+
SPDX-License-Identifier: APACHE-2.0
4+
*/}}
5+
6+
{{- if and (eq .Values.architecture "replication") (not .Values.sentinel.enabled) .Values.replica.pdb.create }}
7+
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
8+
kind: PodDisruptionBudget
9+
metadata:
10+
name: {{ printf "%s-node" (include "common.names.fullname" .) }}
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: node
14+
{{- if .Values.commonAnnotations }}
15+
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
16+
{{- end }}
17+
spec:
18+
{{- if .Values.replica.pdb.minAvailable }}
19+
minAvailable: {{ .Values.replica.pdb.minAvailable }}
20+
{{- end }}
21+
{{- if or .Values.replica.pdb.maxUnavailable (not .Values.replica.pdb.minAvailable) }}
22+
maxUnavailable: {{ .Values.replica.pdb.maxUnavailable | default 1 }}
23+
{{- end }}
24+
selector:
25+
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }}
26+
app.kubernetes.io/component: node
27+
{{- end }}

‎bitnami/redis/values.yaml

+22-10
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,16 @@ master:
618618
## @param master.serviceAccount.annotations Additional custom annotations for the ServiceAccount
619619
##
620620
annotations: {}
621+
## Pod Disruption Budget configuration
622+
## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb
623+
## @param master.pdb.create Enable/disable a Pod Disruption Budget creation
624+
## @param master.pdb.minAvailable [object] Minimum number/percentage of pods that should remain scheduled
625+
## @param master.pdb.maxUnavailable [object] Maximum number/percentage of pods that may be made unavailable. Defaults to `1` if both `master.pdb.minAvailable` and `master.pdb.maxUnavailable` are empty.
626+
##
627+
pdb:
628+
create: true
629+
minAvailable: ""
630+
maxUnavailable: ""
621631
## @section Redis&reg; replicas configuration parameters
622632
##
623633
replica:
@@ -1090,6 +1100,16 @@ replica:
10901100
## @param replica.serviceAccount.annotations Additional custom annotations for the ServiceAccount
10911101
##
10921102
annotations: {}
1103+
## Pod Disruption Budget configuration
1104+
## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb
1105+
## @param replica.pdb.create Enable/disable a Pod Disruption Budget creation
1106+
## @param replica.pdb.minAvailable [object] Minimum number/percentage of pods that should remain scheduled
1107+
## @param replica.pdb.maxUnavailable [object] Maximum number/percentage of pods that may be made unavailable. Defaults to `1` if both `replica.pdb.minAvailable` and `replica.pdb.maxUnavailable` are empty.
1108+
##
1109+
pdb:
1110+
create: true
1111+
minAvailable: ""
1112+
maxUnavailable: ""
10931113
## @section Redis&reg; Sentinel configuration parameters
10941114
##
10951115

@@ -1612,17 +1632,9 @@ serviceAccount:
16121632
annotations: {}
16131633
## Redis&reg; Pod Disruption Budget configuration
16141634
## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/
1635+
## @param pdb DEPRECATED Please use `master.pdb` and `replica.pdb` values instead
16151636
##
1616-
pdb:
1617-
## @param pdb.create Specifies whether a PodDisruptionBudget should be created
1618-
##
1619-
create: false
1620-
## @param pdb.minAvailable Min number of pods that must still be available after the eviction
1621-
##
1622-
minAvailable: 1
1623-
## @param pdb.maxUnavailable Max number of pods that can be unavailable after the eviction
1624-
##
1625-
maxUnavailable: ""
1637+
pdb: {}
16261638
## TLS configuration
16271639
##
16281640
tls:

0 commit comments

Comments
 (0)
Please sign in to comment.