Skip to content

Commit

Permalink
[bitnami/metallb] Enable PodDisruptionBudgets
Browse files Browse the repository at this point in the history
Signed-off-by: Fran Mulero <[email protected]>
  • Loading branch information
fmulero committed May 28, 2024
1 parent b1f8a0c commit 0174342
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bitnami/metallb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ maintainers:
name: metallb
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/metallb
version: 6.2.1
version: 6.3.0
3 changes: 3 additions & 0 deletions bitnami/metallb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ spec:
| `controller.extraVolumeMounts` | Optionally specify extra list of additional volumeMounts for the MetalLB controller container(s) | `[]` |
| `controller.sidecars` | Add additional sidecar containers to the MetalLB Controller pod(s) | `[]` |
| `controller.initContainers` | Add additional init containers to the MetalLB Controller pod(s) | `[]` |
| `controller.pdb.create` | Enable/disable a Pod Disruption Budget creation | `true` |
| `controller.pdb.minAvailable` | Minimum number/percentage of pods that should remain scheduled | `""` |
| `controller.pdb.maxUnavailable` | Maximum number/percentage of pods that may be made unavailable. Defaults to `1` if both `controller.pdb.minAvailable` and `controller.pdb.maxUnavailable` are empty. | `""` |
| `controller.serviceAccount.create` | Specifies whether a ServiceAccount should be created | `true` |
| `controller.serviceAccount.name` | Name of the service account to use. If not set and create is true, a name is generated using the fullname template. | `""` |
| `controller.serviceAccount.automountServiceAccountToken` | Automount service account token for the server service account | `false` |
Expand Down
28 changes: 28 additions & 0 deletions bitnami/metallb/templates/controller/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}

{{- if .Values.controller.pdb.create }}
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ printf "%s-controller" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: controller
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if .Values.controller.pdb.minAvailable }}
minAvailable: {{ .Values.controller.pdb.minAvailable }}
{{- end }}
{{- if or .Values.controller.pdb.maxUnavailable ( not .Values.controller.pdb.minAvailable ) }}
maxUnavailable: {{ .Values.controller.pdb.maxUnavailable | default 1 }}
{{- end }}
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.controller.podLabels .Values.commonLabels ) "context" . ) }}
selector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: controller
{{- end }}
10 changes: 10 additions & 0 deletions bitnami/metallb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,16 @@ controller:
## command: ['sh', '-c', 'echo "hello world"']
##
initContainers: []
## Pod Disruption Budget configuration
## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb
## @param controller.pdb.create Enable/disable a Pod Disruption Budget creation
## @param controller.pdb.minAvailable Minimum number/percentage of pods that should remain scheduled
## @param controller.pdb.maxUnavailable Maximum number/percentage of pods that may be made unavailable. Defaults to `1` if both `controller.pdb.minAvailable` and `controller.pdb.maxUnavailable` are empty.
##
pdb:
create: true
minAvailable: ""
maxUnavailable: ""
## Pods Service Account
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
## @param controller.serviceAccount.create Specifies whether a ServiceAccount should be created
Expand Down

0 comments on commit 0174342

Please sign in to comment.