From 4b88c7b78cd2a8dbd8d4f73311a3305f9d0f5952 Mon Sep 17 00:00:00 2001 From: Test-Automation-Engineer Date: Wed, 22 Jan 2025 15:21:18 +0100 Subject: [PATCH 1/2] Add pdb for worker --- charts/opennotificaties/README.md | 4 +++- charts/opennotificaties/templates/pdb.yaml | 21 +++++++++++++++++++++ charts/opennotificaties/values.yaml | 4 ++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/charts/opennotificaties/README.md b/charts/opennotificaties/README.md index 8e86f98..e469028 100644 --- a/charts/opennotificaties/README.md +++ b/charts/opennotificaties/README.md @@ -219,7 +219,9 @@ API voor het routeren van notificaties | worker.livenessProbe.successThreshold | int | `1` | | | worker.livenessProbe.timeoutSeconds | int | `15` | | | worker.maxWorkerLivenessDelta | string | `""` | | +| worker.pdb.create | bool | `false` | | +| worker.pdb.maxUnavailable | string | `""` | | +| worker.pdb.minAvailable | int | `1` | | | worker.podLabels | object | `{}` | | | worker.replicaCount | int | `2` | | | worker.resources | object | `{}` | | - diff --git a/charts/opennotificaties/templates/pdb.yaml b/charts/opennotificaties/templates/pdb.yaml index 26c50ea..9921959 100644 --- a/charts/opennotificaties/templates/pdb.yaml +++ b/charts/opennotificaties/templates/pdb.yaml @@ -16,4 +16,25 @@ spec: selector: matchLabels: {{- include "opennotificaties.selectorLabels" . | nindent 6 }} +{{- end }} + +--- +{{- if .Values.worker.pdb.create }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "opennotificaties.workerFullname" . }} + namespace: {{ .Release.Namespace | quote }} + labels: + {{- include "opennotificaties.workerLabels" . | nindent 4 }} +spec: + {{- if .Values.worker.pdb.minAvailable }} + minAvailable: {{ .Values.worker.pdb.minAvailable }} + {{- end }} + {{- if .Values.worker.pdb.maxUnavailable }} + maxUnavailable: {{ .Values.worker.pdb.maxUnavailable }} + {{- end }} + selector: + matchLabels: + {{- include "opennotificaties.workerSelectorLabels" . | nindent 6 }} {{- end }} \ No newline at end of file diff --git a/charts/opennotificaties/values.yaml b/charts/opennotificaties/values.yaml index 8a57ca7..68fd15c 100644 --- a/charts/opennotificaties/values.yaml +++ b/charts/opennotificaties/values.yaml @@ -353,6 +353,10 @@ worker: maxReplicas: 100 targetCPUUtilizationPercentage: 80 targetMemoryUtilizationPercentage: 80 + pdb: + create: false + minAvailable: 1 + maxUnavailable: "" flower: enabled: false From 181d0e275b1578800ecf4d66bfac5594092a8532 Mon Sep 17 00:00:00 2001 From: Test-Automation-Engineer Date: Wed, 22 Jan 2025 15:58:23 +0100 Subject: [PATCH 2/2] Bump chart and update changelog --- charts/opennotificaties/CHANGELOG.md | 3 +++ charts/opennotificaties/Chart.yaml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/charts/opennotificaties/CHANGELOG.md b/charts/opennotificaties/CHANGELOG.md index e65d989..abb37b2 100644 --- a/charts/opennotificaties/CHANGELOG.md +++ b/charts/opennotificaties/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 1.8.0-beta.0 (2025-22-01) +- [#169] Add pdb for worker + ## 1.7.0-beta.0 (2025-10-01) - [#148] Replace the worker liveness probe with the `celery inspect active` command. This should detect when a worker is down and should not interrupt long running tasks. diff --git a/charts/opennotificaties/Chart.yaml b/charts/opennotificaties/Chart.yaml index b5748b1..0dd3798 100644 --- a/charts/opennotificaties/Chart.yaml +++ b/charts/opennotificaties/Chart.yaml @@ -3,7 +3,7 @@ name: opennotificaties description: API voor het routeren van notificaties type: application -version: 1.7.0-beta.0 +version: 1.8.0-beta.0 appVersion: latest dependencies: