Skip to content

Commit

Permalink
feat: pod disruption budget
Browse files Browse the repository at this point in the history
Added a flag to enable/disable a [pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/), helping Connaisseur to be always available.

fixes #1850
  • Loading branch information
phbelitz committed Dec 6, 2024
1 parent 5466ad5 commit cfa2505
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions charts/connaisseur/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ Create the name of the redis tls secret
{{- include "connaisseur.name" . }}-redis-tls
{{- end -}}

{{/*
Create the name of the pod disruption budget
*/}}
{{- define "connaisseur.podDisruptionBudget" -}}
{{- include "connaisseur.name" . }}-pod-disruption-budget
{{- end -}}

{{/*
Extract Kubernetes Minor Version.
*/}}
Expand Down
14 changes: 14 additions & 0 deletions charts/connaisseur/templates/pod_disruption_budget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{ if .Values.kubernetes.podDisruptionBudget -}}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "connaisseur.podDisruptionBudget" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "connaisseur.labels" . | nindent 4 }}
spec:
minAvailable: 1
selector:
matchLabels:
{{ include "connaisseur.selectorLabels" . | nindent 8 }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/connaisseur/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ kubernetes:
# (except for pods – see kubernetes.deployment.podLabels for that)
additionalLabels: {}

# activate pod disruption budget
podDisruptionBudget: false

# -----------------------------------------------------

# changes to connaisseur application logic
Expand Down

0 comments on commit cfa2505

Please sign in to comment.