Skip to content
generated from kbase/kbase-template

Custom minimal Docker image to run mongo dump & restore

License

Notifications You must be signed in to change notification settings

kbase/mongo-dump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mongo Backup & Restore

This is a minimal custom Docker image used to backup Mongo from within a Kubernetes cronJob.

Usage

  1. Create a Kubernetes cronJob definition that loads this image
  2. Create configMap to load needed env variables
  3. Set the command and args to run a command similar to:
            command: ["sh", "-c"]
            args:
              - mongodump --host=$MONGODB_URL --port=27017 -u $MONGO_INITDB_ROOT_USERNAME -p $MONGO_INITDB_ROOT_PASSWORD --readPreference=secondaryPreferred --gzip --archive=/$BACKUP_PATH/$CLUSTER-$(date +%Y-%m-%d).tar.gz
            envFrom:
              - configMapRef:
                  name: mongo-env-conf

About

Custom minimal Docker image to run mongo dump & restore

Resources

License

Stars

Watchers

Forks

Packages