Sign inSign up

mintel/k8s-mysqldump

By mintel

•Updated over 6 years ago

Docker image for performing mysqldumps from Cloud SQL instances to Google Buckets

Image
0

3.4K

mintel/k8s-mysqldump repository overview

⁠k8s-mysqldump

An image for pulling dumps from a mysql database and pushing them to a Google bucket.

⁠Prerequisites

⁠Google Resources
  • A Google bucket into which dumps will be copied.
  • A Google service account with the correct read-write permissions to the bucket.
⁠Google Authentication

If an ENVironemnt variable named RESTIC_GOOGLE_APPLICATION_CREDENTIALS is specified pointing to a credentials.json file then it will be used to authenticate.

Otherwise the standard Application Default Credentials⁠ will be used, including support for Workload Identity

⁠Environment Variables
Variable NameDescriptionDefault
DB_HOSTHost name/address of the MySQL instance.N/A
DB_NAMEName of the database from which the dump will be created.N/A
DB_PASSWORDDatabase user's password.N/A
DB_USERDatabase user name to be used for the dump.N/A
RESTIC_GOOGLE_APPLICATION_CREDENTIALSPath to JSON file containing Google service account credentials for the backup bucket (should be mounted as a volume)./secrets/bucket/credentials.json
RESTIC_GOOGLE_PROJECT_IDThe ID of the Google Project in which the Bucket is stored.N/A
RESTIC_PASSWORDPassword for encrypting/decrypting the dumps stored in the bucket.N/A
RESTIC_REPOSITORYThe full path to where the data will be stored on the bucket (e.g. gs:my-bucket:/path/to/folder).N/A
RESTIC_RUNNER_REPOThe name of the repo config file to use (as defined by restic-runner⁠).
RESTIC_RUNNER_SETThe name of the set config file to use (as defined by restic-runner⁠).
TABLE_FILEPath to file containing a line-separated list of tables. If not provided it will dump all tables in the database.N/A

⁠Development

To get this working locally, first run ./hack/dev-setup.sh. This will set up your ./private directory structure and a .env file with the required variables for docker-compose (you'll need to update this with your own values). The included ./docker-compose.yml file shows how to get this working with Google Cloud SQL.

Tag summary

Content type

Image

Digest

Size

54.7 MB

Last updated

over 6 years ago

docker pull mintel/k8s-mysqldump