Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 1.17 KB

README.md

File metadata and controls

31 lines (24 loc) · 1.17 KB

MongoDB 4.0 S3 docker/kubernetes backup

Build status Pulls

Docker image to backup MongoDB 4.0 to S3 using mongodump and compress using pigz.

Advantages/features

  • Supports custom S3 endpoints (e.g. minio)
  • Uses piping instead of tmp file
  • Compression is done with pigz (parallel gzip)
  • Creates bucket if it's not created
  • Can be run in Kubernetes or Docker
  • PGP encryption
  • TODO: Add other compression methods
  • TODO: Add other dbs (e.g. postgres, mysql)

Configuration

S3_BUCK=mongo1-backups
S3_NAME=folder-name/backup-name-prefix
S3_URI=https://s3-key:[email protected]
MONGO_URI=mongodb://mongo-host:27017/db-name
GPG_KEYSERVER=keyserver.ubuntu.com # your hpks keyserver
GPG_KEYID=<key_id> # recipient key, backup will be encrypted if added

Or see docker-compose.yml file to run this container with Docker.

Cron backup with kubernetes

See kubernetes.cronjob.yml file.