Skip to content

Commit

Permalink
[stable/rabbitmq] Update to the recommended pvc patterns. (helm#464)
Browse files Browse the repository at this point in the history
* Convert chart rabbitmq to use the recommended pvc patterns

* fix notes for 1.5

* truncate to 63 and trim trailing dashes

* remove annotations and fix trunc in pvc

* document alpha storage class fallback

* bump version
  • Loading branch information
AmandaCameron authored and prydonius committed Jan 31, 2017
1 parent 5f99812 commit b393cbd
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: rabbitmq
version: 0.4.0
version: 0.4.1
description: Open source message broker software that implements the Advanced Message Queuing Protocol (AMQP)
keywords:
- rabbitmq
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +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.storageClass` | Storage class of backing PVC | `generic` |
| `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` |

Expand Down
4 changes: 2 additions & 2 deletions templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
The RabbitMQ AMQP port {{ default "5672" .Values.rabbitmqNodePort }} can be accessed on the following DNS name from within your cluster: {{ template "fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local

echo Username : {{ .Values.rabbitmqUsername }}
echo Password : $(printf $(printf '\%o' `kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.rabbitmq-password[*]}"`))
echo ErLang Cookie : $(printf $(printf '\%o' `kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.rabbitmq-erlang-cookie[*]}"`))
echo Password : $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.rabbitmq-password}" | base64 --decode)
echo ErLang Cookie : $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.rabbitmq-erlang-cookie}" | base64 --decode)

To Access the RabbitMQ Management interface:

Expand Down
6 changes: 3 additions & 3 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 24 -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 24 -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
6 changes: 5 additions & 1 deletion templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ apiVersion: v1
metadata:
name: {{ template "fullname" . }}
annotations:
volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }}
{{- if .Values.persistence.storageClass }}
volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }}
{{- else }}
volume.alpha.kubernetes.io/storage-class: default
{{- end }}
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote }}
Expand Down
5 changes: 4 additions & 1 deletion values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ rabbitmqManagerPort: 15672

persistence:
enabled: true
storageClass: generic
## If defined, volume.beta.kubernetes.io/storage-class: <storageClass>
## Default: volume.alpha.kubernetes.io/storage-class: default
##
# storageClass:
accessMode: ReadWriteOnce
size: 8Gi

Expand Down

0 comments on commit b393cbd

Please sign in to comment.