diff --git a/stable/redis/Chart.yaml b/stable/redis/Chart.yaml index ab28de4afb..7936971c27 100644 --- a/stable/redis/Chart.yaml +++ b/stable/redis/Chart.yaml @@ -1,5 +1,5 @@ name: redis -version: 0.4.6 +version: 0.5.0 description: Open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. keywords: - redis diff --git a/stable/redis/README.md b/stable/redis/README.md index eff119f0a8..ea6e97d9c0 100644 --- a/stable/redis/README.md +++ b/stable/redis/README.md @@ -49,6 +49,7 @@ The following tables lists the configurable parameters of the Redis chart and th | `imagePullPolicy` | Image pull policy | `IfNotPresent` | | `redisPassword` | Redis password | Randomly generated | | `persistence.enabled` | Use a PVC to persist data | `true` | +| `persistence.existingClaim`| Use an existing PVC to persist data | `nil` | | `persistence.storageClass` | Storage class of backing PVC | `generic` | | `persistence.accessMode` | Use volume as ReadOnly or ReadWrite | `ReadWriteOnce` | | `persistence.size` | Size of data volume | `8Gi` | @@ -78,4 +79,14 @@ $ helm install --name my-release -f values.yaml stable/redis The [Bitnami Redis](https://github.com/bitnami/bitnami-docker-redis) image stores the Redis data and configurations at the `/bitnami/redis` path of the container. -The chart mounts a [Persistent Volume](kubernetes.io/docs/user-guide/persistent-volumes/) volume at this location. The volume is created using dynamic volume provisioning. +By default, the chart mounts a [Persistent Volume](kubernetes.io/docs/user-guide/persistent-volumes/) volume at this location. The volume is created using dynamic volume provisioning. If a Persistent Volume Claim already exists, specify it during installation. + +### Existing PersistentVolumeClaim + +1. Create the PersistentVolume +1. Create the PersistentVolumeClaim +1. Install the chart +```bash +$ helm install --set persistence.existingClaim=PVC_NAME redis +``` + diff --git a/stable/redis/templates/deployment.yaml b/stable/redis/templates/deployment.yaml index c97a9b0e41..8b89c4ad5b 100644 --- a/stable/redis/templates/deployment.yaml +++ b/stable/redis/templates/deployment.yaml @@ -49,7 +49,7 @@ spec: - name: redis-data {{- if .Values.persistence.enabled }} persistentVolumeClaim: - claimName: {{ template "fullname" . }} + claimName: {{ .Values.persistence.existingClaim | default (include "fullname" .) }} {{- else }} emptyDir: {} {{- end -}} diff --git a/stable/redis/templates/pvc.yaml b/stable/redis/templates/pvc.yaml index 6a21fe551b..0136362a7c 100644 --- a/stable/redis/templates/pvc.yaml +++ b/stable/redis/templates/pvc.yaml @@ -1,4 +1,4 @@ -{{- if .Values.persistence.enabled }} +{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} kind: PersistentVolumeClaim apiVersion: v1 metadata: diff --git a/stable/redis/values.yaml b/stable/redis/values.yaml index 19fbca9efc..768ecb24b4 100644 --- a/stable/redis/values.yaml +++ b/stable/redis/values.yaml @@ -19,6 +19,12 @@ imagePullPolicy: IfNotPresent ## persistence: enabled: true + + ## A manually managed Persistent Volume and Claim + ## Requires persistence.enabled: true + ## If defined, PVC must be created manually before volume will be bound + # existingClaim: + ## If defined, volume.beta.kubernetes.io/storage-class: ## Default: volume.alpha.kubernetes.io/storage-class: default ##