Skip to content

Commit

Permalink
add PodDisruptionBudget
Browse files Browse the repository at this point in the history
  • Loading branch information
skadefro committed Jan 7, 2025
1 parent c6f0e21 commit d6e660e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/mongodb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: mongodb
description: A Helm chart for deploying a mongodb
type: application
version: 0.0.14
version: 0.0.15
appVersion: 6.0.0
11 changes: 11 additions & 0 deletions charts/mongodb/templates/poddisruptionbudget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if .Values.maxUnavailable }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: "{{ include "common.name" $dot }}-pdb"
spec:
maxUnavailable: {{ .Values.maxUnavailable }}
selector:
matchLabels:
app: {{ include "common.name" $dot }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/mongodb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ imagePullSecrets:
# but if you add 2 for redundancy you will have issues, since voting cannot happen with at least 2 nodes UP
# meaning if only 2 nodes are there, and one restarts both become secondary and noone gets elected primary
replicas: 3
This is the max unavailable setting for the pod disruption budget
# The default value of 1 will make sure that kubernetes won't allow more than 1
# of your pods to be unavailable during maintenance
maxUnavailable: 1
addservicename: true
mongodbPort: 27017
debugmongodb: false
Expand Down

0 comments on commit d6e660e

Please sign in to comment.