lifebelt is small Typescript app that can back up different databases and upload them to an SFTP server in a unified manner. The most common use case is to run as a sidecar container in a Kubernetes pod thus giving the tool its nautical name.
Lifebelt can currently only back up the following DBMS:
- MySQL (Docker image:
neoskop/lifebelt-mysql
) - Couchbase (Docker image:
neoskop/lifebelt-couchbase
) - CouchDB (Docker image:
neoskop/lifebelt-couchdb
)
Pull requests for additional providers are much welcome!
To run an example container for a provider you just need to have Docker and Docker Compose installed. Subsequently run:
$ DEVELOPMENT=true ./build.sh # This will create the necessary docker images without trying to push them
$ cd <provider-name>
$ docker-compose up
To see a detailed list of options start a container passing the -h
flag:
$ docker run neoskop/lifebelt-mysql:latest -h
There are currently six different main commands that lifebelt can execute:
cron
: Will run nightly backupsbackup
: Will create a backup immediatelytest-backup
: Will create a test backup without saving itclean
: Removes stale backupsrestore
: Restores the latest daily dumpproviders
: List all available providers
To set-up SFTP credentials and other config options, either supply them by environment variable (As seen in the docker-compose.yml
files) or by config file (Via -c
). To see which options are available, look at the config.ts and provider sources.
To release a new version ensure that the version was adjusted in the package.json and that a tag for this was version was created in the repository. Afterwards you just need to run
$ ./build.sh
to create and push new docker images.
- Implement restoring
- Couchbase
- Implement verification
- Add more providers
- MongoDB
- Add k8s examples
- As a sidecar in a pod
- With
googlecontainer/leader-elector/
in a HA cluster - As a CronJob resource
- Add warning for anomalies in sizes
This project is under the terms of the Apache License, Version 2.0. A copy of this license is included with the sources.