Skip to content

Commit

Permalink
charts: Add PodDisruptionBudget to vault Helm Chart
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Weston <[email protected]>
  • Loading branch information
cablespaghetti authored and bonifaido committed Mar 17, 2021
1 parent 7e47251 commit 4830b64
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
7 changes: 6 additions & 1 deletion charts/vault-secrets-webhook/templates/webhook-pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: mutating-webhook
spec:
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
{{- with .Values.podDisruptionBudget.minAvailable }}
minAvailable: {{ . }}
{{- end }}
{{- with .Values.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ . }}
{{- end }}
selector:
matchLabels:
app.kubernetes.io/name: {{ template "vault-secrets-webhook.name" . }}
Expand Down
1 change: 1 addition & 0 deletions charts/vault-secrets-webhook/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ objectSelector: {}
podDisruptionBudget:
enabled: true
minAvailable: 1
#maxUnavailable: 1

timeoutSeconds: false

Expand Down
23 changes: 23 additions & 0 deletions charts/vault/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{- if .Values.podDisruptionBudget.enabled }}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: {{ template "vault.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
helm.sh/chart: {{ template "vault.chart" . }}
app.kubernetes.io/name: {{ template "vault.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
{{- with .Values.podDisruptionBudget.minAvailable }}
minAvailable: {{ . }}
{{- end }}
{{- with .Values.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ . }}
{{- end }}
selector:
matchLabels:
app.kubernetes.io/name: {{ template "vault.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
5 changes: 5 additions & 0 deletions charts/vault/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -295,3 +295,8 @@ certManager:
# issuerRef:
# additionalDomains:
# - vault.mydomain.com

podDisruptionBudget:
enabled: true
#minAvailable: 1
maxUnavailable: 1

0 comments on commit 4830b64

Please sign in to comment.