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.109.0/examples/elasticsearch/blueprint-v2/elasticsearch-blueprint.yaml

Note

The Elasticsearch backup example provided above serves as a blueprint template for logical backups. Please note that these examples may need to be modified for specific production environments and setups. As a result, it is highly recommended to carefully review and modify the blueprints as needed before deploying them for production use.

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.