Logical MongoDB Backup on OpenShift clusters

To demonstrate data protection for MongoDB provided and deployed with OpenShift, the install should be performed according to the documentation provided here.

$ oc create namespace mongodb-logical
$ oc new-app https://raw.githubusercontent.com/openshift/origin/master/examples/db-templates/mongodb-ephemeral-template.json \
      --namespace mongodb-logical

A Blueprint resource should be created via the following command:

 $ curl https://raw.githubusercontent.com/kanisterio/kanister/0.107.0/examples/mongodb-deploymentconfig/blueprint-v2/mongo-dep-config-blueprint.yaml > mongo-dep-config-blueprint.yaml
 $ oc apply -f mongo-dep-config-blueprint.yaml --namespace kasten-io

Note

The MongoDB backup example provided above serves as a blueprint for logical backups on OpenShift clusters. Please note that these examples may need to be modified for specific production environments and setups on OpenShift. 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.

Note

If MongoDB chart is installed specifying existing secret by setting parameter --set auth.existingSecret=<mongo-secret-name>, secret name in the blueprint mongo-dep-config-blueprint.yaml needs to be modified at following places:

actions.backup.phases[0].objects.mongosecret.name: <mongo-secret-name> actions.restore.phases[0].objects.mongosecret.name: <mongo-secret-name>

Once the Blueprint is created, annotate the DeploymentConfig with the below annotations to instruct K10 to use this Blueprint while performing data management operations on the MongoDB instance.

$ oc annotate deploymentconfig mongodb kanister.kasten.io/blueprint='mongodb-blueprint' \
      --namespace=mongodb-logical

Finally, use K10 to backup and restore the application.