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

Install Elasticsearch 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 Elasticsearch databases, you have to install Elasticsearch addon (stash-elasticsearch) for Stash. This addon creates necessary Function and Task definitions to backup/restore Elasticsearch 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-elasticsearch addon as a Helm chart using Helm 3.

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

Using Helm 2

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

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

Using YAML

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

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

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

Verify Installation

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

$ kubectl get functions.stash.appscode.com
NAME                        AGE
elasticsearch-backup-7.2    20s
elasticsearch-backup-6.8    20s
elasticsearch-backup-6.5    19s
elasticsearch-backup-6.4    20s
elasticsearch-backup-6.3    20s
elasticsearch-backup-6.2    20s
elasticsearch-backup-5.6    20s
elasticsearch-restore-7.2   20s
elasticsearch-restore-6.8   20s
elasticsearch-restore-6.5   19s
elasticsearch-restore-6.4   20s
elasticsearch-restore-6.3   20s
elasticsearch-restore-6.2   20s
elasticsearch-restore-5.6   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
elasticsearch-backup-7.2    2m7s
elasticsearch-backup-6.8    2m7s
elasticsearch-backup-6.5    2m6s
elasticsearch-backup-6.4    2m7s
elasticsearch-backup-6.3    2m7s
elasticsearch-backup-6.2    2m7s
elasticsearch-backup-5.6    2m7s
elasticsearch-restore-7.2   2m7s
elasticsearch-restore-6.8   2m7s
elasticsearch-restore-6.5   2m6s
elasticsearch-restore-6.4   2m7s
elasticsearch-restore-6.3   2m7s
elasticsearch-restore-6.2   2m7s
elasticsearch-restore-5.6   2m7s
pvc-backup                  7h7m
pvc-restore                 7h7m

Now, Stash is ready to backup Elasticsearch databases.

Customizing Installation

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

curl -fsSL https://github.com/stashed/catalog/raw/v2020.10.30/deploy/helm3.sh | bash -s -- --catalog=stash-elasticsearch --version=6.5

The flowing flags are available for customizing Elasticsearch 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.
--es-backup-argsSpecify optional arguments to pass to multielaticdump command during backup. These arguments apply to all Elasticsearch instances in this cluster. To set arguments for a specific Elasticsearch database instance, set esArgs parameter in spec.task.params field of the respective BackupConfiguration.
--es-restore-argsSpecify optional arguments to pass to multielastic command during restore. These arguments apply to all Elasticsearch instances in this cluster. To set arguments for a specific Elasticsearch database instance, set esArgs parameter in spec.task.params field of the respective RestoreSession.