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

[stable/postgresql] Update to the recommended pvc patterns. #461

Merged
merged 3 commits into from
Jan 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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