From 76de5f3593214c442ee133d95a764716757d5f63 Mon Sep 17 00:00:00 2001 From: Aline Fauquette Date: Fri, 13 Sep 2024 14:46:59 +0200 Subject: [PATCH] feat: Change the update strategy in case of persistence In case planka is installed with a PV associated to the planka pod, to persist attachments and avatars for example, the default update strategy for the deployment will fail. The default "rolling update" strategy would indeed try to start a new pod before stopping the old one. But as the old pod is attached to the PV, the new pod will fail to attach and so will stay in "container creating" mode, and the old pod will never be stopped. To avoid that, adding a condition on the deployment to use the "recreate" update strategy if the persistence is enabled. This will ensure the old pod is stopped and so detached from the PV before trying to attach the new one. --- charts/planka/templates/deployment.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charts/planka/templates/deployment.yaml b/charts/planka/templates/deployment.yaml index 60457a64..3365cfd8 100644 --- a/charts/planka/templates/deployment.yaml +++ b/charts/planka/templates/deployment.yaml @@ -11,6 +11,10 @@ spec: selector: matchLabels: {{- include "planka.selectorLabels" . | nindent 6 }} + {{- if .Values.persistence.enabled }} + strategy: + type: Recreate + {{- end }} template: metadata: {{- with .Values.podAnnotations }}