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
Copy to clipboard

Install the Elasticsearch chart from the elastic Helm repository:

$ kubectl create namespace elasticsearch
$ helm install --namespace elasticsearch elasticsearch elastic/elasticsearch  \
    --set antiAffinity=soft
Copy to clipboard

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.58.0/examples/stable/elasticsearch/blueprint-v2/elasticsearch-blueprint.yaml
Copy to clipboard

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
Copy to clipboard

Finally, use K10 to backup and restore the application.