diff --git a/charts/vaultwarden/Chart.yaml b/charts/vaultwarden/Chart.yaml index 4838834..84f324c 100644 --- a/charts/vaultwarden/Chart.yaml +++ b/charts/vaultwarden/Chart.yaml @@ -13,5 +13,5 @@ maintainers: - name: guerzon email: guerzon@proton.me url: https://github.com/guerzon -version: 0.18.0 +version: 0.18.1 kubeVersion: ">=1.12.0-0" diff --git a/charts/vaultwarden/README.md b/charts/vaultwarden/README.md index c986a56..a4056da 100644 --- a/charts/vaultwarden/README.md +++ b/charts/vaultwarden/README.md @@ -208,7 +208,7 @@ data: path: "/srv/vaultwarden-data" ``` -To use persistent storage for attachments, set the `attachmenets` dictionary. Optionally set a different path. Note that by default, the path is `/data/attachments`. +To use persistent storage for attachments, set the `attachments` dictionary. Optionally set a different path. Note that by default, the path is `/data/attachments`. ```yaml data: @@ -217,6 +217,17 @@ data: class: "local-path" ``` +In case you want to keep the existing persistent volume claim during uninstall and redeployments, set the option `keepPvc: true` +(This will be ignored for StatefulSets and is only relevant for `resourceType: Deployment`) + +```yaml +data: + name: "vaultwarden-data" + size: "15Gi" + class: "local-path" + keepPvc: true +``` + ## Uninstall To uninstall/delete the `vaultwarden-demo` release: diff --git a/charts/vaultwarden/templates/_pvcSpec.tpl b/charts/vaultwarden/templates/_pvcSpec.tpl index ef30730..36a7242 100644 --- a/charts/vaultwarden/templates/_pvcSpec.tpl +++ b/charts/vaultwarden/templates/_pvcSpec.tpl @@ -9,6 +9,9 @@ volumeClaimTemplates: annotations: meta.helm.sh/release-name: {{ $.Release.Name | quote }} meta.helm.sh/release-namespace: {{ $.Release.Namespace | quote }} + {{- if .keepPvc }} + helm.sh/resource-policy: keep + {{- end }} spec: accessModes: - "ReadWriteOnce" @@ -24,6 +27,12 @@ volumeClaimTemplates: name: {{ .name }} labels: {{- include "vaultwarden.labels" $ | nindent 10 }} + annotations: + meta.helm.sh/release-name: {{ $.Release.Name | quote }} + meta.helm.sh/release-namespace: {{ $.Release.Namespace | quote }} + {{- if .keepPvc }} + helm.sh/resource-policy: keep + {{- end }} spec: accessModes: - "ReadWriteOnce" diff --git a/charts/vaultwarden/values.yaml b/charts/vaultwarden/values.yaml index 0f5d229..c24a826 100644 --- a/charts/vaultwarden/values.yaml +++ b/charts/vaultwarden/values.yaml @@ -380,6 +380,7 @@ data: {} # size: "15Gi" # class: "" # path: "/data" + # keepPvc: false ## @param attachments Attachments directory configuration, refer to values.yaml for parameters. ## By default, attachments/ is located inside the data directory. @@ -389,6 +390,7 @@ attachments: {} # size: "100Gi" # class: "" # path: /files + # keepPvc: false ## @section Logging Configuration ##