Skip to content

Commit

Permalink
Helm: keep the data PersistentVolumeClaim after uninstall (#7123)
Browse files Browse the repository at this point in the history
Currently, Helm will delete the PVC when you uninstall your CVAT
release, which makes it easy to unintentionally lose data. Add a
`helm.sh/resource-policy` annotation to prevent that from happening.

This makes the data PVC consistent with the other PVCs created as part
of the Helm chart (ones belonging to PostgreSQL, KeyDB and Clickhouse),
which are also not deleted upon uninstall, albeit for a different
reason: they are created by the corresponding StatefulSets, and
StatefulSets retain their volumes when they are deleted.
  • Loading branch information
SpecLad authored Nov 10, 2023
1 parent c87cb3b commit 6eb3ef4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelog.d/20231110_134452_roman_helm_keep_pvc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Changed

- \[Helm\] The PersistentVolumeClaim for the volume used to hold application
data is now retained after uninstall
(<https://github.com/opencv/cvat/pull/7123>)
2 changes: 2 additions & 0 deletions helm-chart/templates/cvat_backend/storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ kind: PersistentVolumeClaim
metadata:
name: {{ .Release.Name }}-backend-data
namespace: {{ .Release.Namespace }}
annotations:
helm.sh/resource-policy: keep
labels:
{{- include "cvat.labels" . | nindent 4 }}
app: cvat-app
Expand Down

0 comments on commit 6eb3ef4

Please sign in to comment.