diff --git a/couchdb/README.md b/couchdb/README.md index 7d1f86b..276fd59 100644 --- a/couchdb/README.md +++ b/couchdb/README.md @@ -164,7 +164,6 @@ required options to set: A variety of other parameters are also configurable. See the comments in the `values.yaml` file for further details: - | Parameter | Default | |--------------------------------------| ------------------------------------------------ | | `adminUsername` | admin | @@ -189,6 +188,7 @@ A variety of other parameters are also configurable. See the comments in the | `persistentVolume.accessModes` | ReadWriteOnce | | `persistentVolume.storageClass` | Default for the Kube cluster | | `persistentVolume.annotations` | {} | +| `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.existingClaims` | [] (a list of existing PV/PVC volume value objects with `volumeName`, `claimName`, `persistentVolumeName` and `volumeSource` defined) | | `persistentVolume.volumeName` | | | `persistentVolume.claimName` | | diff --git a/couchdb/README.md.gotmpl b/couchdb/README.md.gotmpl index 261d081..d32a7ce 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 | 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 8e85063..18ba222 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: {}