Logical MongoDB Backup
If it hasn't been done already, the bitnami
Helm repository needs
to be added to your local configuration:
# Add bitnami helm repo
$ helm repo add bitnami https://charts.bitnami.com/bitnami
Install the MongoDB chart from the bitnami
Helm repository:
$ kubectl create namespace mongodb-logical
$ helm install mongo-logical bitnami/mongodb --namespace mongodb-logical \
--set architecture="replicaset"
To create a Blueprint resource, please run the command below:
$ kubectl --namespace kasten-io apply -f \
https://raw.githubusercontent.com/kanisterio/kanister/0.69.0/examples/stable/mongodb/blueprint-v2/mongo-blueprint.yaml
Once the Blueprint is created, we will have to annotate the StatefulSet with
the correct annotation to instruct K10 to use the Blueprint while performing
operations on this MongoDB instance.
The following example demonstrates how to annotate the MongoDB StatefulSet with
the mongodb-logical
Blueprint.
$ kubectl annotate statefulset mongo-logical-mongodb kanister.kasten.io/blueprint='mongodb-blueprint' \
--namespace=mongodb-logical
Finally, use K10 to backup and restore the application.