Add persistence.existingClaim and persistence.subPath options (#1526)

This commit is contained in:
Jakub Dlugolecki
2017-08-13 19:03:51 +02:00
committed by Reinhard Nägele
parent 97dee7894b
commit 34bfb33052
3 changed files with 10 additions and 2 deletions
+2
View File
@@ -56,6 +56,8 @@ The following tables lists the configurable parameters of the MySQL chart and th
| `persistence.size` | Size of persistent volume claim | 8Gi RW |
| `persistence.storageClass` | Type of persistent volume claim | nil (uses alpha storage class annotation) |
| `persistence.accessMode` | ReadWriteOnce or ReadOnly | ReadWriteOnce |
| `persistence.existingClaim`| Name of existing persistent volume | `nil`
| `persistence.subPath` | Subdirectory of the volume to mount | `nil`
| `resources` | CPU/Memory resource requests/limits | Memory: `256Mi`, CPU: `100m` |
Some of the parameters above map to the env variables defined in the [MySQL DockerHub image](https://hub.docker.com/_/mysql/).
+7 -1
View File
@@ -21,6 +21,9 @@ spec:
"volumeMounts": [
{
"name": "data",
{{- if .Values.persistence.subPath }}
"subPath": "{{ .Values.persistence.subPath }}",
{{- end }}
"mountPath": "/var/lib/mysql"
}
],
@@ -86,11 +89,14 @@ spec:
volumeMounts:
- name: data
mountPath: /var/lib/mysql
{{- if .Values.persistence.subPath }}
subPath: {{ .Values.persistence.subPath }}
{{- end }}
volumes:
- name: data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ template "fullname" . }}
claimName: {{ .Values.persistence.existingClaim | default (include "fullname" .) }}
{{- else }}
emptyDir: {}
{{- end -}}
+1 -1
View File
@@ -1,4 +1,4 @@
{{- if .Values.persistence.enabled }}
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata: