From f880a154e1ceba3554cea9e8e4d832c0f750b7af Mon Sep 17 00:00:00 2001 From: Reza Chalak Date: Wed, 1 Nov 2023 22:45:04 +0330 Subject: [PATCH] Documented and default values reviewed --- README.md | 4 + charts/backup-zen/Chart.yaml | 2 +- charts/backup-zen/README.md | 89 +++++++++++++++++-- .../templates/objectStorage-secret.yml | 1 - charts/backup-zen/values.yaml | 19 ++-- 5 files changed, 96 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 8fc11b6..7917223 100644 --- a/README.md +++ b/README.md @@ -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) + [Bug Reports](https://github.com/rezachalak/backup-zen/issues) diff --git a/charts/backup-zen/Chart.yaml b/charts/backup-zen/Chart.yaml index 93c9fc1..2c7881e 100644 --- a/charts/backup-zen/Chart.yaml +++ b/charts/backup-zen/Chart.yaml @@ -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" \ No newline at end of file diff --git a/charts/backup-zen/README.md b/charts/backup-zen/README.md index 824da80..9d8a542 100644 --- a/charts/backup-zen/README.md +++ b/charts/backup-zen/README.md @@ -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) + [Bug Reports](https://github.com/rezachalak/backup-zen/issues) @@ -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"` | | --- diff --git a/charts/backup-zen/templates/objectStorage-secret.yml b/charts/backup-zen/templates/objectStorage-secret.yml index 404ddf3..58520fa 100644 --- a/charts/backup-zen/templates/objectStorage-secret.yml +++ b/charts/backup-zen/templates/objectStorage-secret.yml @@ -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 -}} diff --git a/charts/backup-zen/values.yaml b/charts/backup-zen/values.yaml index fc6920f..29dfb44 100644 --- a/charts/backup-zen/values.yaml +++ b/charts/backup-zen/values.yaml @@ -14,8 +14,7 @@ credentialType: oneByOne # credsSecretName: mycreds-secret global: - charset: - namespace: db-backups + namespace: maintenance createNamespace: true rotation: true #### SETTINGS FOR ROTATED BACKUPS #### @@ -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: @@ -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 \ No newline at end of file