https://github.com/garutilorenzo/k8s-db-backup
Containerized backup agent for MySQL with AWS and OCI S3 bucket support
https://github.com/garutilorenzo/k8s-db-backup
aws backup bucket container database docker kubernetes mysql mysql-backup oci python
Last synced: 3 months ago
JSON representation
Containerized backup agent for MySQL with AWS and OCI S3 bucket support
- Host: GitHub
- URL: https://github.com/garutilorenzo/k8s-db-backup
- Owner: garutilorenzo
- License: gpl-3.0
- Created: 2022-12-07T13:44:44.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-12T11:48:09.000Z (over 3 years ago)
- Last Synced: 2025-02-07T14:47:26.907Z (over 1 year ago)
- Topics: aws, backup, bucket, container, database, docker, kubernetes, mysql, mysql-backup, oci, python
- Language: Python
- Homepage:
- Size: 29.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/garutilorenzo/k8s-db-backup/actions/workflows/ci.yml)
[](https://github.com/garutilorenzo/k8s-db-backup/issues)

[](https://github.com/garutilorenzo/k8s-db-backup/network)
[](https://github.com/garutilorenzo/k8s-db-backup/stargazers)
# K8s db backup
Containerized backup agent for MySQL with AWS and OCI S3 bucket support.
This container can be used to automatically create a logical backup of databases
and store them on S3 object storage compatible provider.
Supported providers are: aws and oci
## Requirements
The only requirements is to have enough free space on your kubernetes worker/docker swarm node/docker node to store the logical backup
before it is transferred to the object storage.
## Supported environment variables
| Var | Required | Desc |
| ------- | ------- | ----------- |
| `S3_PROVIDER` | `always` | S3 compatible provider. Supported providers: aws, oci |
| `AWS_SECRET_KEY` | `aws` | aws secret key |
| `AWS_ACCESS_KEY` | `aws` | aws access key |
| `AWS_REGION` | `aws` | aws region |
| `AWS_BUCKET_NAME` | `aws` | aws bucket name |
| `OCI_SECRET_KEY` | `oci` | oci secret key |
| `OCI_ACCESS_KEY` | `oci` | oci access key |
| `OCI_REGION` | `oci` | oci region |
| `OCI_BUCKET_NAME` | `oci` | oci bucket name |
| `OCI_NAMESPACE` | `oci` | oci namespace. Follow Understanding Object Storage Namespaces on [OCI provider setup](#oci-provider-setup) |
| `BACKUP_PATH_PREFIX` | `no` | Local and remote prefix where the backups will be stored. Default: k8s-db-backup |
| `BACKUP_STRATEGY` | `no` | Define the backup strategy: single dump or split backup by tables. Default: SINGLE_FILE_DUMP. Supported strategies are SINGLE_FILE_DUMP and SPLIT_BY_TABLE |
**Note** on required column:
* `always` variable always required
* `aws` or `oci` specific provider variable
* `no` optional/not required variable
### AWS provider setup
To get the AWS secret and access key follow the links below:
* [Accessing AWS using your AWS credentials](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html)
* [Managing access keys for IAM users](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html)
### OCI provider setup
To get the ICI secret and access key follow the links below:
* [Managing User Credentials](https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/managingcredentials.htm#create-secret-key)
* [Understanding Object Storage Namespaces](https://docs.oracle.com/en-us/iaas/Content/Object/Tasks/understandingnamespaces.htm)