Logical Elasticsearch Backup
If it hasn't been done already, the elastic
Helm repository needs
to be added to your local configuration:
# Add elastic helm repo
$ helm repo add elastic https://helm.elastic.co
Install the Elasticsearch chart from the elastic Helm repository:
$ kubectl create namespace elasticsearch
$ helm install --namespace elasticsearch elasticsearch elastic/elasticsearch \
--set antiAffinity=soft
Once Elasticsearch is installed, create an index and insert some documents in the Elasticsearch cluster by following the commands mentioned here.
To create a Blueprint resource, please run the command below:
$ kubectl --namespace kasten-io apply -f \
https://raw.githubusercontent.com/kanisterio/kanister/0.96.0/examples/elasticsearch/blueprint-v2/elasticsearch-blueprint.yaml
Alternatively, use the Blueprints page on K10 Dashboard to create the Blueprint resource.
Once the Blueprint is created, the StatefulSets will need to be
annotated to instruct K10 to use the Blueprint while performing backup
operations on this Elasticsearch instance. The following example
demonstrates how to annotate the Elasticsearch StatefulSet with the
elasticsearch-blueprint
.
$ kubectl annotate statefulset elasticsearch-master kanister.kasten.io/blueprint='elasticsearch-blueprint' \
--namespace=elasticsearch
Finally, use K10 to backup and restore the application.