diff --git a/stable/rabbitmq/Chart.yaml b/stable/rabbitmq/Chart.yaml index 5126eb730a..fc302bddf3 100644 --- a/stable/rabbitmq/Chart.yaml +++ b/stable/rabbitmq/Chart.yaml @@ -1,5 +1,5 @@ name: rabbitmq -version: 0.4.5 +version: 0.5.0 description: Open source message broker software that implements the Advanced Message Queuing Protocol (AMQP) keywords: - rabbitmq diff --git a/stable/rabbitmq/README.md b/stable/rabbitmq/README.md index e6f5b40269..f14101352b 100644 --- a/stable/rabbitmq/README.md +++ b/stable/rabbitmq/README.md @@ -57,6 +57,7 @@ The following tables lists the configurable parameters of the RabbitMQ chart and | `rabbitmqVhost` | RabbitMQ application vhost | `/` | | `rabbitmqManagerPort` | RabbitMQ Manager port | `15672` | | `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 | `nil` (uses alpha storage class annotation) | | `persistence.accessMode` | Use volume as ReadOnly or ReadWrite | `ReadWriteOnce` | | `persistence.size` | Size of data volume | `8Gi` | @@ -85,4 +86,15 @@ $ helm install --name my-release -f values.yaml stable/rabbitmq The [Bitnami RabbitMQ](https://github.com/bitnami/bitnami-docker-rabbitmq) image stores the RabbitMQ data and configurations at the `/bitnami/rabbitmq` 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. +The chart mounts a [Persistent Volume](kubernetes.io/docs/user-guide/persistent-volumes/) volume at this location. By default, the volume is created using dynamic volume provisioning. An existing PersistentVolumeClaim can also be defined. + + +### Existing PersistentVolumeClaims + +1. Create the PersistentVolume +1. Create the PersistentVolumeClaim +1. Install the chart +```bash +$ helm install --set persistence.existingClaim=PVC_NAME rabbitmq +`` + diff --git a/stable/rabbitmq/templates/deployment.yaml b/stable/rabbitmq/templates/deployment.yaml index 29f322eeac..8a26147f94 100644 --- a/stable/rabbitmq/templates/deployment.yaml +++ b/stable/rabbitmq/templates/deployment.yaml @@ -74,7 +74,7 @@ spec: - name: data {{- if .Values.persistence.enabled }} persistentVolumeClaim: - claimName: {{ template "fullname" . }} + claimName: {{ .Values.persistence.existingClaim | default (include "fullname" .) }} {{- else }} emptyDir: {} {{- end -}} diff --git a/stable/rabbitmq/templates/pvc.yaml b/stable/rabbitmq/templates/pvc.yaml index 321f464a66..0d10937e23 100644 --- a/stable/rabbitmq/templates/pvc.yaml +++ b/stable/rabbitmq/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/rabbitmq/values.yaml b/stable/rabbitmq/values.yaml index d65ce44b6e..5b4dbbd38c 100644 --- a/stable/rabbitmq/values.yaml +++ b/stable/rabbitmq/values.yaml @@ -56,6 +56,12 @@ rabbitmqManagerPort: 15672 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 ##