Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

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

* document storage class fallback

* bump chart version
  • Loading branch information
AmandaCameron authored and Vic Iglesias committed Jan 27, 2017
1 parent b8d5095 commit a3d2da1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion stable/postgresql/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: postgresql
version: 0.3.0
version: 0.3.1
description: Chart for PostgreSQL
keywords:
- postgresql
Expand Down
2 changes: 1 addition & 1 deletion stable/postgresql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The following tables lists the configurable parameters of the PostgresSQL chart
| `postgresPassword` | Password for the new user. | random 10 characters |
| `postgresDatabase` | Name for new database to create. | `postgres` |
| `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` |
| `resources` | CPU/Memory resource requests/limits | Memory: `256Mi`, CPU: `100m` |
Expand Down
9 changes: 8 additions & 1 deletion stable/postgresql/templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ metadata:
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
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 }}
{{- range $key, $value := .Values.persistence.annotations }}
{{ $key }}: {{ $value }}
{{- end }}
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote }}
Expand Down
5 changes: 4 additions & 1 deletion stable/postgresql/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ imageTag: "9.5.4"
## Persist data to a persitent volume
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 a3d2da1

Please sign in to comment.