feat: Change the update strategy in case of persistence #876
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 PV is attached to the old pod, 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 the PV is detached before trying to attach the new one.