From 189a3ae82862513461428bf643f8963029847a31 Mon Sep 17 00:00:00 2001 From: Pawel Sarbinowski Date: Tue, 30 May 2023 11:07:45 +0100 Subject: [PATCH 1/3] Add .Values.persistentVolume.selfManaged so PVCs can be managed outside of the helm-chart for consistency and to prevent accidental deletions by helm. --- couchdb/templates/persistentvolume.yaml | 2 +- couchdb/templates/persistentvolumeclaim.yaml | 2 +- couchdb/values.yaml | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/couchdb/templates/persistentvolume.yaml b/couchdb/templates/persistentvolume.yaml index 3349b83..1256b75 100644 --- a/couchdb/templates/persistentvolume.yaml +++ b/couchdb/templates/persistentvolume.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.persistentVolume.enabled .Values.persistentVolume.existingClaims -}} +{{- if and (and .Values.persistentVolume.enabled .Values.persistentVolume.existingClaims) (not .Values.persistentVolume.selfManaged) -}} {{- range $claim := .Values.persistentVolume.existingClaims }} apiVersion: v1 kind: PersistentVolume diff --git a/couchdb/templates/persistentvolumeclaim.yaml b/couchdb/templates/persistentvolumeclaim.yaml index 5371682..b131dfb 100644 --- a/couchdb/templates/persistentvolumeclaim.yaml +++ b/couchdb/templates/persistentvolumeclaim.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.persistentVolume.enabled .Values.persistentVolume.existingClaims -}} +{{- if and (and .Values.persistentVolume.enabled .Values.persistentVolume.existingClaims) (not .Values.persistentVolume.selfManaged) -}} {{- $context := . }} {{- range $claim := .Values.persistentVolume.existingClaims }} apiVersion: v1 diff --git a/couchdb/values.yaml b/couchdb/values.yaml index 19b6b50..b8d794b 100644 --- a/couchdb/values.yaml +++ b/couchdb/values.yaml @@ -67,6 +67,9 @@ serviceAccount: # provisioner. persistentVolume: enabled: false + # Set selfManaged to true if you want to provide the chart with existing PVCs created outside of the scope of this helm chart. + # Warning: If you have existing PVCs generated through the helm chart and you set this to true, it will end up deleting the PVCs unless you remove the owner reference of helm from the PVCs/PVs OR if you keep a snapshot/backup and restore yourself. + selfManaged: false # NOTE: the number of existing claims must match the cluster size existingClaims: [] annotations: {} From 483176f325fd135590c80e6b26227ceede394f04 Mon Sep 17 00:00:00 2001 From: Pawel Sarbinowski Date: Tue, 30 May 2023 11:18:11 +0100 Subject: [PATCH 2/3] Add readme for the new value --- couchdb/README.md | 1 + couchdb/README.md.gotmpl | 1 + 2 files changed, 2 insertions(+) diff --git a/couchdb/README.md b/couchdb/README.md index 569837f..d1685db 100644 --- a/couchdb/README.md +++ b/couchdb/README.md @@ -188,6 +188,7 @@ A variety of other parameters are also configurable. See the comments in the | `ingress.tls` | | | `persistentVolume.accessModes` | ReadWriteOnce | | `persistentVolume.storageClass` | Default for the Kube cluster | +| `persistentVolume.selfManaged` | Set selfManaged to true if you want to provide the chart with existing PVCs created outside of the scope of this helm chart. | | `persistentVolume.annotations` | {} | | `persistentVolume.existingClaims` | [] (a list of existing PV/PVC volume value objects with `volumeName`, `claimName`, `persistentVolumeName` and `volumeSource` defined) | | `persistentVolume.volumeName` | | diff --git a/couchdb/README.md.gotmpl b/couchdb/README.md.gotmpl index 969c2d0..9664f1a 100644 --- a/couchdb/README.md.gotmpl +++ b/couchdb/README.md.gotmpl @@ -178,6 +178,7 @@ A variety of other parameters are also configurable. See the comments in the | `ingress.tls` | | | `persistentVolume.accessModes` | ReadWriteOnce | | `persistentVolume.storageClass` | Default for the Kube cluster | +| `persistentVolume.selfManaged` | Set selfManaged to true if you want to provide the chart with existing PVCs created outside of the scope of this helm chart. | | `persistentVolume.annotations` | {} | | `podDisruptionBudget.enabled` | false | | `podDisruptionBudget.minAvailable` | nil | From 6ff4c68985109a0f2149ecaa5b11a04250602897 Mon Sep 17 00:00:00 2001 From: Pawel Sarbinowski Date: Tue, 30 May 2023 11:22:18 +0100 Subject: [PATCH 3/3] Bump chart version --- couchdb/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/couchdb/Chart.yaml b/couchdb/Chart.yaml index 76e58d4..aeb3551 100644 --- a/couchdb/Chart.yaml +++ b/couchdb/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: couchdb -version: 4.4.0 +version: 4.4.1 appVersion: 3.3.2 description: A database featuring seamless multi-master sync, that scales from big data to mobile, with an intuitive HTTP/JSON API and designed for