From 951f75cae1e2c57db59b73bf0038c59784b7970e Mon Sep 17 00:00:00 2001 From: mxmCherry Date: Thu, 5 Feb 2026 19:18:07 +0200 Subject: [PATCH] feat: overridable mongodb strategy --- .../templates/mongodb-deployment.yaml | 4 ++++ .../tests/mongodb-deployment_test.yaml | 19 +++++++++++++++++-- charts/clickstack/values.yaml | 6 ++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/charts/clickstack/templates/mongodb-deployment.yaml b/charts/clickstack/templates/mongodb-deployment.yaml index 047921b..699cc61 100644 --- a/charts/clickstack/templates/mongodb-deployment.yaml +++ b/charts/clickstack/templates/mongodb-deployment.yaml @@ -34,6 +34,10 @@ spec: matchLabels: {{- include "clickstack.selectorLabels" . | nindent 6 }} app: mongodb + {{- if .Values.mongodb.strategy }} + strategy: + {{- toYaml .Values.mongodb.strategy | nindent 4 }} + {{- end }} template: metadata: labels: diff --git a/charts/clickstack/tests/mongodb-deployment_test.yaml b/charts/clickstack/tests/mongodb-deployment_test.yaml index 4bafe01..3e3122f 100644 --- a/charts/clickstack/tests/mongodb-deployment_test.yaml +++ b/charts/clickstack/tests/mongodb-deployment_test.yaml @@ -30,8 +30,8 @@ tests: of: Deployment - documentSelector: *service-selector isKind: - of: Service - + of: Service + - it: should not render any documents when disabled set: mongodb: @@ -302,3 +302,18 @@ tests: equal: path: spec.template.spec.imagePullSecrets[0].name value: regcred + + - it: should include strategy when configured + set: + mongodb: + enabled: true + strategy: + type: Recreate + asserts: + - documentIndex: 1 + isNotNull: + path: spec.strategy + - documentIndex: 1 + equal: + path: spec.strategy.type + value: Recreate diff --git a/charts/clickstack/values.yaml b/charts/clickstack/values.yaml index 1d62db7..877a5f2 100644 --- a/charts/clickstack/values.yaml +++ b/charts/clickstack/values.yaml @@ -257,6 +257,12 @@ mongodb: image: "mongo:5.0.32-focal" port: 27017 enabled: true + # Optionally override rollout strategy with type=Recreate + # to avoid mongodb image update issues + # when newer instance cannot start + # because older one holds /data/db/mongod.lock + # at a cost of short mongodb downtime. + strategy: null # Add nodeSelector and tolerations for mongodb service nodeSelector: {}