Skip to content

Commit

Permalink
update images
Browse files Browse the repository at this point in the history
Signed-off-by: sayedppqq <[email protected]>
  • Loading branch information
sayedppqq committed Sep 16, 2024
1 parent a3c33f4 commit 79a1ad2
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ spec:
name: mongodb-addon
tasks:
- name: LogicalBackup
containerRuntimeSettings:
resources:
requests:
cpu: "200m"
memory: "1Gi"
limits:
cpu: "200m"
memory: "1Gi"
containerRuntimeSettings:
resources:
requests:
cpu: "200m"
memory: "1Gi"
limits:
cpu: "200m"
memory: "1Gi"
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ spec:
name: mongodb-addon
tasks:
- name: LogicalBackup
jobTemplate:
spec:
securityContext:
runAsUser: 0
runAsGroup: 0
jobTemplate:
spec:
securityContext:
runAsUser: 0
runAsGroup: 0
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ spec:
name: mongodb-addon
tasks:
- name: LogicalBackupRestoress
jobTemplate:
spec:
securityContext:
runAsUser: 0
runAsGroup: 0
jobTemplate:
spec:
securityContext:
runAsUser: 0
runAsGroup: 0
80 changes: 42 additions & 38 deletions docs/guides/mongodb/backup/kubestash/customization/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ In this section, we are going to show you how to customize the backup process. H

### Passing arguments to the backup process

KubeStash MongoDB addon uses [mongoump](https://docs.mongodb.com/database-tools/mongodump/) for backup. You can pass arguments to the `mongodump` through `args` param under `spec.sessions.addon.task.params` section.
KubeStash MongoDB addon uses [mongoump](https://docs.mongodb.com/database-tools/mongodump/) for backup. You can pass arguments to the `mongodump` through `args` param under `spec.sessions.addon.tasks[0].params` section.

The below example shows how you can pass the `--db testdb` to take backup for a specific mongodb databases named `testdb`.

Expand Down Expand Up @@ -70,7 +70,7 @@ spec:

### Running backup job as a specific user

If your cluster requires running the backup job as a specific user, you can provide `securityContext` under `spec.sessions.addon.tasks.jobTemplate.spec` section. The below example shows how you can run the backup job as the root user.
If your cluster requires running the backup job as a specific user, you can provide `securityContext` under `spec.sessions.addon.tasks[0].jobTemplate.spec` section. The below example shows how you can run the backup job as the root user.

```yaml
apiVersion: core.kubestash.com/v1alpha1
Expand All @@ -91,32 +91,34 @@ spec:
name: s3-storage
retentionPolicy:
name: backup-rp
namespace: demo
namespace: demo
sessions:
- name: frequent
scheduler:
jobTemplate:
backoffLimit: 1
schedule: "*/5 * * * *"
repositories:
- name: s3-repo
backend: s3-backend
directory: /mongodb
encryptionSecret:
name: encry-secret
namespace: demo
name: encry-secret
namespace: demo
addon:
name: mongodb-addon
tasks:
- name: LogicalBackup
jobTemplate:
spec:
securityContext:
runAsUser: 0
runAsGroup: 0
jobTemplate:
spec:
securityContext:
runAsUser: 0
runAsGroup: 0
```

### Specifying Memory/CPU limit/request for the backup job

If you want to specify the Memory/CPU limit/request for your backup job, you can specify `resources` field under `spec.sessions.addon.tasks.containerRuntimeSettings` section.
If you want to specify the Memory/CPU limit/request for your backup job, you can specify `resources` field under `spec.sessions.addon.containerRuntimeSettings` section.

```yaml
apiVersion: core.kubestash.com/v1alpha1
Expand All @@ -137,30 +139,32 @@ spec:
name: s3-storage
retentionPolicy:
name: backup-rp
namespace: demo
namespace: demo
sessions:
- name: frequent
scheduler:
jobTemplate:
backoffLimit: 1
schedule: "*/3 * * * *"
repositories:
- name: s3-repo
backend: s3-backend
directory: /mongodb
encryptionSecret:
name: encry-secret
namespace: demo
name: encry-secret
namespace: demo
addon:
name: mongodb-addon
tasks:
- name: LogicalBackup
containerRuntimeSettings:
resources:
requests:
cpu: "200m"
memory: "1Gi"
limits:
cpu: "200m"
memory: "1Gi"
containerRuntimeSettings:
resources:
requests:
cpu: "200m"
memory: "1Gi"
limits:
cpu: "200m"
memory: "1Gi"
```

## Customizing Restore Process
Expand All @@ -169,7 +173,7 @@ KubeStash also uses `mongorestore` during the restore process. In this section,

### Passing arguments to the restore process

Similar to the backup process, you can pass arguments to the restore process through the `args` params under `spec.addon.task.params` section. This example will restore data from database `testdb`.
Similar to the backup process, you can pass arguments to the restore process through the `args` params under `spec.addon.tasks[0].params` section. This example will restore data from database `testdb`.

```yaml
apiVersion: core.kubestash.com/v1alpha1
Expand Down Expand Up @@ -256,22 +260,22 @@ spec:
snapshot: latest
repository: s3-repo
encryptionSecret:
name: encry-secret
name: encry-secret
namespace: demo
addon:
name: mongodb-addon
tasks:
- name: LogicalBackupRestoress
jobTemplate:
spec:
securityContext:
runAsUser: 0
runAsGroup: 0
jobTemplate:
spec:
securityContext:
runAsUser: 0
runAsGroup: 0
```

### Specifying Memory/CPU limit/request for the restore job

Similar to the backup process, you can also provide `resources` field under the `spec.addon.tasks.containerRuntimeSettings` section to limit the Memory/CPU for your restore job.
Similar to the backup process, you can also provide `resources` field under the `spec.addon.containerRuntimeSettings` section to limit the Memory/CPU for your restore job.

```yaml
apiVersion: core.kubestash.com/v1alpha1
Expand All @@ -295,14 +299,14 @@ spec:
name: mongodb-addon
tasks:
- name: LogicalBackupRestoress
containerRuntimeSettings:
resources:
requests:
cpu: "200m"
memory: "1Gi"
limits:
cpu: "200m"
memory: "1Gi"
containerRuntimeSettings:
resources:
requests:
cpu: "200m"
memory: "1Gi"
limits:
cpu: "200m"
memory: "1Gi"
```

## Cleanup
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/guides/mongodb/backup/kubestash/overview/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ section_menu_id: guides

> New to KubeDB? Please start [here](/docs/README.md).
{{< notice type="warning" message="This is an Enterprise-only feature. Please install [KubeStash Enterprise Edition] to try this feature. You can use KubeDB Enterprise license to install KubeStash Enterprise edition. Database backup with KubeStash is already included in the KubeDB Enterprise license. So, you don't need a separate license for KubeStash." >}}
{{< notice type="warning" message="Please install [KubeStash](https://kubestash.com/docs/latest/setup/install/kubestash/) to try this feature. Database backup with KubeStash is already included in the KubeDB license. So, you don't need a separate license for KubeStash." >}}

# MongoDB Backup & Restore Overview

Expand Down Expand Up @@ -111,11 +111,11 @@ The following diagram shows how KubeStash restores backed up data into a MongoDB

The restore process consists of the following steps:

1. At first, a user creates a `RestoreSession` crd targeting the `AppBinding` of the desired database where the backed up data will be restored. It also specifies the `Repository` crd which holds the backend information and the `Task` to use to restore the target.
1. At first, a user creates a `RestoreSession` crd that specifies the target database where the backed-up data will be restored, addon information (including restore tasks), the target snapshot to be restored, the Repository containing that snapshot, and other additional settings.

2. KubeStash operator watches for `RestoreSession` object.

3. Once it finds a `RestoreSession` object, it resolves the respective `Task` and `Function` and prepares a Job definition to restore.
3. When it finds a `RestoreSession` custom resource, it resolves the respective `Addon` and `Function` and prepares a restore Job definition.

4. Then, it creates the Job to restore the target.

Expand Down

0 comments on commit 79a1ad2

Please sign in to comment.