Skip to content

Commit

Permalink
Documented and default values reviewed
Browse files Browse the repository at this point in the history
  • Loading branch information
rezachalak committed Nov 1, 2023
1 parent 212a38c commit f880a15
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 19 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
Backup-Zen is a Database Backup Solution Using Helm

[Github Repo](https://github.com/rezachalak/backup-zen)

[Installation](https://github.com/rezachalak/backup-zen#using-helm)

[Web Site](https://rezachalak.github.io/backup-zen/)

[Documentation](https://artifacthub.io/packages/helm/bzen/backup-zen)

<!-- [Mailing List]() -->
[Bug Reports](https://github.com/rezachalak/backup-zen/issues)
<!-- [Donate]() -->
Expand Down
2 changes: 1 addition & 1 deletion charts/backup-zen/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
description: BackupZen is a solution for backing up and uploading various database types, leveraging the power of K8s cronjobs.
name: backup-zen
version: 0.1.3
version: 0.1.4
appVersion: 1.0.0
kubeVersion: ">= 1.20.0"
89 changes: 84 additions & 5 deletions charts/backup-zen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
Backup-Zen is a Database Backup Solution Using Helm

[Github Repo](https://github.com/rezachalak/backup-zen)

[Installation](https://github.com/rezachalak/backup-zen#using-helm)

[Web Site](https://rezachalak.github.io/backup-zen/)

[Documentation](https://artifacthub.io/packages/helm/bzen/backup-zen)

<!-- [Mailing List]() -->
[Bug Reports](https://github.com/rezachalak/backup-zen/issues)
<!-- [Donate]() -->
Expand Down Expand Up @@ -88,26 +92,101 @@ kubectl delete namespace backup-zen
The `values.yaml` contains items used to tweak a deployment of this chart.

### General Settings
#### Backup Type
Select one of these two types:

`oneByOne`: preparing databaseName, username and password for each database as an array in oneByOne.creds must be provided:

credsSecretName is the name of the secret where the database credentials are stored (can be used instead of oneByOne.creds)

`credsSecretName: mycreds-secret`

This secret must contain: `creds.json`
```
creds.json:
[
{
"database_name": "",
"username": "",
"password": ""
}
,...
]
```
Or in `values.yaml`:
```
creds:
- database_name: db1
username: user1
password: password1
- database_name: db2
username: user2
password: password2
```

`adminUser`: admin user credentials in `adminUser.username` and `adminUser.password` must be provided

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| databaseType | string | `"MongoDB"` | Database Type |
| databaseType | string | `"MongoDB"` | Available db Types: PostgreSQL, MySQL & MongoDB|
| hostname | string | `"mydb.rds.amazonaws.com"` | Database Host Address |
| | string | `""` | |
| port | string | `"54325"` | Database Port |
| credentialType | string | `"oneByOne"` | Select one of these two types: oneByOne OR adminUser |
| global.namespace | string | `"maintenance"` | |
| global.createNamespace | string | `"true"` | |
| global.rotation | string | `"true"` | |
| global.rotation_config.dayOfWeekToKeep | string | `"5"` | Which day to take the weekly backup from (1-7 = Monday-Sunday) |
| global.rotation_config.daysToKeep | string | `"7"` | Number of days to keep daily backups |
| global.rotation_config.weeksToKeep | string | `"5"` | How many weeks to keep weekly backups |
| global.teamsNotification | string | `"false"` | |
| global.succeededTeamsURL | string | `"https://myorg.webhook.office.com/webhookb1/blob-blob-blob"` | |
| global.failedTeamsURL | string | `"https://myorg.webhook.office.com/webhookb2/blob-blob-blob"` | |

### Credentials Settings

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| adminUser.username | string | `""` | |
| adminUser.password | string | `""` | |
| oneByOne.credsSecretName | string | `""` | the secret where the database credentials are stored (can be used instead of oneByOne.creds |
| oneByOne.creds | list(map) | `[{"database_name": "db1", "username": "u1", "password": "p1"}]`| |

### Cronjob Scheduling Settings

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| | string | `""` | |
| | string | `""` | |
| cronjob.pullPolicy | string | `"Always"` | |
| cronjob.imagePullSecrets | list(string) | `"[]"` | |
| cronjob.restartPolicy | string | `"Never"` | |
| cronjob.resources.requests.cpu | string | `"1"` | |
| cronjob.resources.requests.memory | string | `"1Gi"` | |
| cronjob.resources.limits.cpu | string | `"2"` | |
| cronjob.resources.limits.memory | string | `"2Gi"` | |
| cronjob.schedule | string | `"0 0 * * *"` | |
| cronjob.failedJobsHistoryLimit | string | `""` | |
| cronjob.successfulJobsHistoryLimit | string | `""` | |
| cronjob.storage.createPVC | string | `""` | |
| cronjob.storage.PVCName | string | `""` | |
| cronjob.storage.storageClass | string | `""` | |
| cronjob.storage.accessMode | string | `""` | |
| cronjob.storage.PVCSize | string | `""` | |

### Upload To objectStorage Settings

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| | string | `""` | |
| backupUpload.active | string | `"false"` | |
| backupUpload.objectStorageType | string | `"AWS_S3"` | Supported objectStorages are: MinIO and AWS_S3 |
| backupUpload.objectStorageSecretName | string | `""` | the name of the secret where the credentials of object storage is stored. |
| backupUpload.AWS_S3.AWS_ACCESS_KEY_ID | string | `""` | |
| backupUpload.AWS_S3.AWS_DEFAULT_REGION | string | `"us-west-1"` | |
| backupUpload.AWS_S3.AWS_SECRET_ACCESS_KEY | string | `""` | |
| backupUpload.AWS_S3.BUCKET_NAME | string | `"backupzen-s3"` | |
| backupUpload.MINIO.MINIO_ACCESS_KEY_ID | string | `""` | |
| backupUpload.MINIO.MINIO_URL | string | `"http://localhost:9000"` | |
| backupUpload.MINIO.MINIO_SECRET_ACCESS_KEY | string | `""` | |
| backupUpload.MINIO.BUCKET_NAME | string | `""` | |
| backupUpload.MINIO.O | string | `"backupzen-minio"` | |


---
Expand Down
1 change: 0 additions & 1 deletion charts/backup-zen/templates/objectStorage-secret.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ data:
MINIO_URL: {{ required "Setting Region key is required!" .Values.backupUpload.MINIO.MINIO_URL | b64enc }}
MINIO_SECRET_ACCESS_KEY: {{ required "Setting Secret Access key is required!" .Values.backupUpload.MINIO.MINIO_SECRET_ACCESS_KEY | b64enc }}
BUCKET_NAME: {{ required "Setting bucket name is required!" .Values.backupUpload.MINIO.BUCKET_NAME | b64enc }}
OBJECT_NAME: {{ required "Setting object name is required!" .Values.backupUpload.MINIO.OBJECT_NAME | b64enc }}
{{ end -}}
type: Opaque
{{ end -}}
Expand Down
19 changes: 7 additions & 12 deletions charts/backup-zen/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ credentialType: oneByOne
# credsSecretName: mycreds-secret

global:
charset:
namespace: db-backups
namespace: maintenance
createNamespace: true
rotation: true
#### SETTINGS FOR ROTATED BACKUPS ####
Expand All @@ -26,8 +25,8 @@ global:
daysToKeep: 7
# How many weeks to keep weekly backups
weeksToKeep: 5
teamsNotification: true
succeededTeamsURL: https://myorg.webhook.office.com/webhookb2/blob-blob-blob
teamsNotification: false
succeededTeamsURL: https://myorg.webhook.office.com/webhookb1/blob-blob-blob
failedTeamsURL: https://myorg.webhook.office.com/webhookb2/blob-blob-blob

cronjob:
Expand Down Expand Up @@ -75,25 +74,21 @@ oneByOne:
- database_name: db1
username: user1
password: password1
- database_name: db2
username: user2
password: password2

##### SETTINGS FOR AWS S3 ####
backupUpload:
active: true
active: false
# Supported objectStorages are: MinIO and AWS_S3
objectStorageType: MinIO
objectStorageType: AWS_S3
# objectStorageSecretName is the name of the secret where the credentials of object storage is stored.
# objectStorageSecretName: s3-secret-name
AWS_S3:
AWS_ACCESS_KEY_ID: "access"
AWS_DEFAULT_REGION: "us-west-1"
AWS_SECRET_ACCESS_KEY: "secret"
BUCKET_NAME: "mybucket-backup-zen"
BUCKET_NAME: "backupzen-s3"
MINIO:
MINIO_ACCESS_KEY_ID: access-key
MINIO_URL: https://localhost
MINIO_URL: http://localhost:9000
MINIO_SECRET_ACCESS_KEY: secret
BUCKET_NAME: backupzen-minio
OBJECT_NAME: c342jhc34gf

0 comments on commit f880a15

Please sign in to comment.