You are looking at the documentation of a prior release. To read the documentation of the latest release, please visit here.

Install MySQL Addon for Stash

Stash uses Function-Task model to backup databases. This Function-Task model enables Stash to extend its capability via addons. In order to backup MySQL databases, you have to install MySQL addon (stash-mysql) for Stash. This addon creates necessary Function and Task definitions to backup/restore MySQL database.

You can install the addon either as a helm chart or you can create only the YAMLs of the respective resources.

Using Helm 3

Run the following script to install stash-mysql addon as a Helm chart using Helm 3.

curl -fsSL https://github.com/stashed/catalog/raw/v2020.11.06/deploy/helm3.sh | bash -s -- --catalog=stash-mysql

Using Helm 2

Run the following script to install stash-mysql addon as a Helm chart using Helm 2.

curl -fsSL https://github.com/stashed/catalog/raw/v2020.11.06/deploy/helm2.sh | bash -s -- --catalog=stash-mysql

Using YAML

Run the following script to install stash-mysql addon as Kubernetes YAMLs.

curl -fsSL https://github.com/stashed/catalog/raw/v2020.11.06/deploy/script.sh | bash -s -- --catalog=stash-mysql

The above script uses Helm 3 for rendering the charts to generate the YAMLs.

Verify Installation

After installation is completed, this addon will create mysql-backup-* and mysql-restore-* Functions and Tasks for all supported MySQL versions. To verify, run the following command:

$ kubectl get functions.stash.appscode.com
NAME                    AGE
mysql-backup-8.0.14     20s
mysql-backup-5.7        20s
mysql-restore-8.0.14    20s
mysql-restore-5.7       20s
pvc-backup              7h6m
pvc-restore             7h6m
update-status           7h6m

Also, verify that the Task have been created.

$ kubectl get tasks.stash.appscode.com
NAME                    AGE
mysql-backup-8.0.14     2m7s
mysql-backup-5.7        2m7s
mysql-restore-8.0.14    2m7s
mysql-restore-5.7       2m7s
pvc-backup              7h7m
pvc-restore             7h7m

Now, Stash is ready to backup MySQL databases.

Customizing Installation

In order to install Function and Task only for a specific MySQL version, use --version flag to specify the desired database version.

curl -fsSL https://github.com/stashed/catalog/raw/v2020.11.06/deploy/helm3.sh | bash -s -- --catalog=stash-mysql --version=8.0.14

The flowing flags are available for customizing MySQL addon installation:

FlagUsage
--versionSpecify a specific version of a specific addon to install. Use it along with --catalog flag.
--docker-registrySpecify the docker registry to use to pull respective addon images. Default Value: stashed.
--imageSpecify the name of the docker image to use for respective addons.
--image-tagSpecify the tag of the docker image to use for respective addon.
--my-backup-argsSpecify optional arguments to pass to mysqldump command during backup. These arguments apply to all MySQL instances in this cluster. To set arguments for a specific MySQL database instance, set myArgs parameter in spec.task.params field of the respective BackupConfiguration.
--my-restore-argsSpecify optional arguments to pass to mysql command during restore. These arguments apply to all MySQL instances in this cluster. To set arguments for a specific MySQL database instance, set myArgs parameter in spec.task.params field of the respective RestoreSession.