mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
Add persistence.existingClaim and persistence.subPath options (#1526)
This commit is contained in:
committed by
Reinhard Nägele
parent
97dee7894b
commit
34bfb33052
@@ -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/).
|
||||
|
||||
@@ -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,4 +1,4 @@
|
||||
{{- if .Values.persistence.enabled }}
|
||||
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
|
||||
Reference in New Issue
Block a user