kalisio / kargo

A K8S based solution to build and operate Geospatial Platforms
https://kalisio.github.io/kargo/
MIT License
23 stars 6 forks source link

Provide a solution to backup mongodb #169

Closed cnouguier closed 2 years ago

cnouguier commented 4 years ago

https://github.com/stefanprodan/mgob looks like a good candidate as it allows to use rclone and slack It also supports replica set

cnouguier commented 4 years ago

Mgob does the job but we'd like to be able to filter the databases to backup. See: https://github.com/stefanprodan/mgob/issues/119

cnouguier commented 3 years ago

Still no feedback from mgob. For now we are not very confident with mgob and its future.

cnouguier commented 2 years ago

We provide an helper template to do it using k8S : https://github.com/kalisio/kargo/blob/master/charts/common/templates/_db-backup.tpl#L276

It can be used specifying the job in the values.yaml

mongodbBackupRestoreCronjob:
  image: bitnami/mongodb:4.4.11-debian-10-r12
  host: apps-mongodb
  rcloneSecret: '{{ .Values.global.rcloneSecret }}'
  remotePath: 'backup:{{ .Release.Namespace }}'
  backupCron: '0 23 * * *'
  restoreTimestamp: '20220308-1034'

And instanciate the template using a template file with the following content:

{{ include "common.mongodb-backup-restore-cronjobs" (dict "context" $ "args" .Values.mongodbBackupRestoreCronjob) }}