mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
[stable/mysqldump] option to run additional shell steps (#11100)
* add option for additional shell steps to run, fix kc alias in Notes.txt to kubectl Signed-off-by: Norbert Varzariu <norbert.varzariu@lotto24.de> * bump minor chart version, add example for additionalSteps Signed-off-by: Norbert Varzariu <norbert.varzariu@lotto24.de>
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
fd37371d69
commit
4c2ca4c38a
@@ -1,8 +1,8 @@
|
||||
apiVersion: v1
|
||||
appVersion: 2.3.1
|
||||
appVersion: 2.4.0
|
||||
description: A Helm chart to help backup MySQL databases using mysqldump
|
||||
name: mysqldump
|
||||
version: 2.3.1
|
||||
version: 2.4.0
|
||||
keywords:
|
||||
- mysql
|
||||
- mysqldump
|
||||
|
||||
@@ -57,6 +57,7 @@ The following tables lists the configurable parameters of the mysqldump chart an
|
||||
| schedule | crontab schedule to run on. set as `now` to run as a one time job | "0/5 \* \* \* \*" |
|
||||
| options | options to pass onto MySQL | "--opt --single-transaction" |
|
||||
| debug | print some extra debug logs during backup | false |
|
||||
| additionalSteps | run these extra shell steps after all backup jobs completed | [] |
|
||||
| successfulJobsHistoryLimit | number of successful jobs to remember | 5 |
|
||||
| failedJobsHistoryLimit | number of failed jobs to remember | 5 |
|
||||
| persistentVolumeClaim | existing Persistent Volume Claim to backup to, leave blank to create a new one | |
|
||||
|
||||
@@ -10,7 +10,7 @@ $ kubectl get pods --selector=job-name={{ template "mysqldump.fullname" . }} --s
|
||||
|
||||
To see the logs from the backup job run:
|
||||
|
||||
$ kubectl logs `kc get pods --selector=job-name=test-mysqldump --output=jsonpath={.items..metadata.name}`
|
||||
$ kubectl logs `kubectl get pods --selector=job-name=test-mysqldump --output=jsonpath={.items..metadata.name}`
|
||||
|
||||
mysqldump contents can be found in:
|
||||
{{- if .Values.persistentVolumeClaim }}
|
||||
@@ -19,7 +19,7 @@ $ kubectl get persistentvolumeclaim {{ .Values.persistentVolumeClaim }}
|
||||
{{- if .Values.persistence.enabled }}
|
||||
$ kubectl get persistentvolumeclaim {{ template "mysqldump.fullname" . }}
|
||||
{{- else }}
|
||||
$ kubectl logs `kc get pods --selector=job-name=test-mysqldump --output=jsonpath={.items..metadata.name}`
|
||||
$ kubectl logs `kubectl get pods --selector=job-name=test-mysqldump --output=jsonpath={.items..metadata.name}`
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
@@ -35,8 +35,8 @@ $ kubectl get jobs --selector=cronjob-name={{ template "mysqldump.fullname" . }}
|
||||
|
||||
To see the logs from the most recent backup job run:
|
||||
|
||||
$ kubectl logs $(kc get pods --selector \
|
||||
job-name=$(kc get jobs --selector=cronjob-name={{ template "mysqldump.fullname" . }} \
|
||||
$ kubectl logs $(kubectl get pods --selector \
|
||||
job-name=$(kubectl get jobs --selector=cronjob-name={{ template "mysqldump.fullname" . }} \
|
||||
--output=jsonpath='{.items[-1:].metadata.name}') \
|
||||
--output=jsonpath={.items..metadata.name})
|
||||
|
||||
@@ -47,7 +47,7 @@ $ kubectl get persistentvolumeclaim {{ .Values.persistentVolumeClaim }}
|
||||
{{- if .Values.persistence.enabled }}
|
||||
$ kubectl get persistentvolumeclaim {{ template "mysqldump.fullname" . }}
|
||||
{{- else }}
|
||||
$ kubectl logs `kc get pods --selector=job-name=test-mysqldump --output=jsonpath={.items..metadata.name}`
|
||||
$ kubectl logs `kubectl get pods --selector=job-name=test-mysqldump --output=jsonpath={.items..metadata.name}`
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
|
||||
@@ -103,6 +103,12 @@ data:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
{{ if .Values.additionalSteps }}
|
||||
{{- range .Values.additionalSteps }}
|
||||
{{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{ if .Values.debug }}
|
||||
ls -alh ${BACKUP_DIR}
|
||||
{{ end }}
|
||||
|
||||
@@ -40,6 +40,14 @@ debug: false
|
||||
successfulJobsHistoryLimit: 5
|
||||
failedJobsHistoryLimit: 5
|
||||
|
||||
# additional steps for mysqldump shell script
|
||||
# will be inserted after all backup and upload jobs completed successfully.
|
||||
# Use "${BACKUP_DIR}/${TIMESTAMP}_${MYSQL_DB}.sql.gz" as dump file name.
|
||||
# see examples
|
||||
additionalSteps: []
|
||||
# - gsutil cp "${BACKUP_DIR}/${TIMESTAMP}_${MYSQL_DB}.sql.gz" gs://mybucket/latest.sql.gz
|
||||
# - echo "latest sql dump updated"
|
||||
|
||||
## set persistentVolumeClaim to use a PVC that already exists.
|
||||
## if set will override any settings under `persistence` otherwise
|
||||
## if not set and `persistence.enabled` set to true, will create a PVC.
|
||||
|
||||
Reference in New Issue
Block a user