From 54f10b8885cb1539c16ea2dfdf8f1944651f6e5f Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Wed, 10 Apr 2024 20:55:50 +0200 Subject: [PATCH] feat: keep PVCs when uninstalling helm chart Signed-off-by: Nikolas Rimikis --- charts/nextcloud/Chart.yaml | 2 +- charts/nextcloud/README.md | 1 + charts/nextcloud/templates/nextcloud-data-pvc.yaml | 7 ++++--- charts/nextcloud/templates/nextcloud-pvc.yaml | 7 ++++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/charts/nextcloud/Chart.yaml b/charts/nextcloud/Chart.yaml index 8ae04020..876c6238 100644 --- a/charts/nextcloud/Chart.yaml +++ b/charts/nextcloud/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: nextcloud -version: 4.6.5 +version: 4.6.6 appVersion: 28.0.4 description: A file sharing server that puts the control and security of your own data back into your hands. keywords: diff --git a/charts/nextcloud/README.md b/charts/nextcloud/README.md index 9d87425a..6581b09c 100644 --- a/charts/nextcloud/README.md +++ b/charts/nextcloud/README.md @@ -257,6 +257,7 @@ Is there a missing parameter for one of the Bitnami helm charts listed above? Pl The [Nextcloud](https://hub.docker.com/_/nextcloud/) image stores the nextcloud data and configurations at the `/var/www/html` paths of the container. Persistent Volume Claims are used to keep the data across deployments. This is known to work with GKE, EKS, K3s, and minikube. +Nextcloud will *not* delete the PVCs when uninstalling the helm chart. | Parameter | Description | Default | diff --git a/charts/nextcloud/templates/nextcloud-data-pvc.yaml b/charts/nextcloud/templates/nextcloud-data-pvc.yaml index d10900a8..e2a3606d 100644 --- a/charts/nextcloud/templates/nextcloud-data-pvc.yaml +++ b/charts/nextcloud/templates/nextcloud-data-pvc.yaml @@ -10,10 +10,11 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/component: app - {{- with .Values.persistence.nextcloudData.annotations }} annotations: - {{- toYaml . | nindent 4 }} - {{- end }} + helm.sh/resource-policy: keep + {{- with .Values.persistence.nextcloudData.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: accessModes: - {{ .Values.persistence.nextcloudData.accessMode | quote }} diff --git a/charts/nextcloud/templates/nextcloud-pvc.yaml b/charts/nextcloud/templates/nextcloud-pvc.yaml index 6bdd620b..d329f00b 100644 --- a/charts/nextcloud/templates/nextcloud-pvc.yaml +++ b/charts/nextcloud/templates/nextcloud-pvc.yaml @@ -9,10 +9,11 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/component: app - {{- with .Values.persistence.annotations }} annotations: - {{- toYaml . | nindent 4 }} - {{- end }} + helm.sh/resource-policy: keep + {{- with .Values.persistence.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: accessModes: - {{ .Values.persistence.accessMode | quote }}