diff --git a/docs/guides/mongodb/backup/kubestash/auto-backup/_index.md b/docs/guides/mongodb/backup/kubestash/auto-backup/index.md similarity index 84% rename from docs/guides/mongodb/backup/kubestash/auto-backup/_index.md rename to docs/guides/mongodb/backup/kubestash/auto-backup/index.md index abde5fc780..63a9d40284 100644 --- a/docs/guides/mongodb/backup/kubestash/auto-backup/_index.md +++ b/docs/guides/mongodb/backup/kubestash/auto-backup/index.md @@ -19,21 +19,20 @@ In this tutorial, we are going to show how you can configure a backup blueprint ## Before You Begin -- At first, you need to have a Kubernetes cluster, and the `kubectl` command-line tool must be configured to communicate with your cluster. -- Install KubeStash Enterprise in your cluster following the steps [here](https://stash.run/docs/latest/setup/install/stash/). -- Install KubeDB in your cluster following the steps [here](/docs/setup/README.md). -- If you are not familiar with how Stash backup and restore MongoDB databases, please check the following guide [here](/docs/guides/mongodb/backup/stash/overview/index.md). -- If you are not familiar with how auto-backup works in Stash, please check the following guide [here](https://stash.run/docs/latest/guides/auto-backup/overview/). -- If you are not familiar with the available auto-backup options for databases in Stash, please check the following guide [here](https://stash.run/docs/latest/guides/auto-backup/database/). +- At first, you need to have a Kubernetes cluster, and the `kubectl` command-line tool must be configured to communicate with your cluster. If you do not already have a cluster, you can create one by using `Minikube` or `Kind`. +- Install `KubeDB` in your cluster following the steps [here](/docs/setup/README.md). +- Install `KubeStash` in your cluster following the steps [here](https://kubestash.com/docs/latest/setup/install/kubestash). +- Install KubeStash `kubectl` plugin following the steps [here](https://kubestash.com/docs/latest/setup/install/kubectl-plugin/). +- If you are not familiar with how KubeStash backup and restore `MongoDB` databases, please check the following guide [here](/docs/guides/mongodb/backup/kubestash/overview/index.md). You should be familiar with the following `KubeStash` concepts: -- [BackupBlueprint](https://stash.run/docs/latest/concepts/crds/backupblueprint/) -- [BackupConfiguration](https://stash.run/docs/latest/concepts/crds/backupconfiguration/) -- [BackupSession](https://stash.run/docs/latest/concepts/crds/backupsession/) -- [Repository](https://stash.run/docs/latest/concepts/crds/repository/) -- [Function](https://stash.run/docs/latest/concepts/crds/function/) -- [Task](https://stash.run/docs/latest/concepts/crds/task/) +- [BackupBlueprint](https://kubestash.com/docs/latest/concepts/crds/backupblueprint/) +- [BackupConfiguration](https://kubestash.com/docs/latest/concepts/crds/backupconfiguration/) +- [BackupSession](https://kubestash.com/docs/latest/concepts/crds/backupsession/) +- [BackupStorage](https://kubestash.com/docs/latest/concepts/crds/backupstorage/) +- [Function](https://kubestash.com/docs/latest/concepts/crds/function/) +- [Addon](https://kubestash.com/docs/latest/concepts/crds/addon/) To keep things isolated, we are going to use a separate namespace called `demo` throughout this tutorial. Create `demo` namespace if you haven't created yet. @@ -48,7 +47,7 @@ namespace/demo created So we can also take backup any MongoDB database of any namespace just by adding few annotations to our MongoDB CRD. Then, KubeStash will automatically create a `BackupConfiguration` according to the template to backup the database. -We are going to store our backed up data into a S3 bucket. At first, we need to create a secret with S3 credentials then we need to create a `BackupStorage` crd. If you want to use a different backend, please read the respective backend configuration doc from [here](https://stash.run/docs/latest/guides/backends/overview/). +We are going to store our backed up data into a S3 bucket. At first, we need to create a secret with S3 credentials then we need to create a `BackupStorage` crd. If you want to use a different backend, please read the respective backend configuration doc from [here](https://kubestash.com/docs/latest/guides/backends/overview/). ### Create Storage Secret: @@ -81,7 +80,7 @@ spec: bucket: kubestash-testing region: us-east-1 prefix: demo - secret: s3-secret + secretName: s3-secret usagePolicy: allowedNamespaces: from: All @@ -147,28 +146,30 @@ spec: backupConfigurationTemplate: deletionPolicy: OnDelete backends: - - name: s3-backend - storageRef: - namespace: ${storageNamespace} - name: ${storageName} - retentionPolicy: - name: backup-rp - namespace: demo + - name: s3-backend + storageRef: + namespace: ${storageNamespace} + name: ${storageName} + retentionPolicy: + name: backup-rp + namespace: demo sessions: - - name: frequent - scheduler: - schedule: ${scheduleTime} - repositories: - - name: ${repoName} - backend: s3-backend - directory: ${backupPath} - encryptionSecret: - name: encry-secret - namespace: demo - addon: - name: mongodb-addon - tasks: - - name: LogicalBackup + - name: frequent + scheduler: + jobTemplate: + backoffLimit: 1 + schedule: ${scheduleTime} + repositories: + - name: ${repoName} + backend: s3-backend + directory: ${backupPath} + encryptionSecret: + name: encry-secret + namespace: demo + addon: + name: mongodb-addon + tasks: + - name: LogicalBackup ``` Here, we define a template for `BackupConfiguration`. Notice the `backends` and `sessions` fields of `backupConfigurationTemplate` section. We have used some variables in form of `${VARIABLE_NAME}`. KubeStash will automatically resolve those variables from the database annotations information to make `BackupConfiguration` according to that databases need. @@ -180,7 +181,7 @@ Let's create the `BackupBlueprint` we have shown above, backupblueprint.core.kubestash.com/sample-blueprint created ``` -Now, we are ready to backup our MongoDB databases using few annotations. You can check available auto-backup annotations for a databases from [here](https://stash.run/docs/latest/guides/auto-backup/database/#available-auto-backup-annotations-for-database). +Now, we are ready to backup our `MongoDB` databases using few annotations. ### Create Database diff --git a/docs/guides/mongodb/backup/kubestash/customization/examples/backup/resource-limit.yaml b/docs/guides/mongodb/backup/kubestash/customization/examples/backup/resource-limit.yaml index 8cdeee9950..9cb2794841 100644 --- a/docs/guides/mongodb/backup/kubestash/customization/examples/backup/resource-limit.yaml +++ b/docs/guides/mongodb/backup/kubestash/customization/examples/backup/resource-limit.yaml @@ -34,11 +34,11 @@ spec: name: mongodb-addon tasks: - name: LogicalBackup - containerRuntimeSettings: - resources: - requests: - cpu: "200m" - memory: "1Gi" - limits: - cpu: "200m" - memory: "1Gi" \ No newline at end of file + containerRuntimeSettings: + resources: + requests: + cpu: "200m" + memory: "1Gi" + limits: + cpu: "200m" + memory: "1Gi" \ No newline at end of file diff --git a/docs/guides/mongodb/backup/kubestash/customization/examples/backup/specific-user.yaml b/docs/guides/mongodb/backup/kubestash/customization/examples/backup/specific-user.yaml index b2698d4590..d3dcc848c5 100644 --- a/docs/guides/mongodb/backup/kubestash/customization/examples/backup/specific-user.yaml +++ b/docs/guides/mongodb/backup/kubestash/customization/examples/backup/specific-user.yaml @@ -34,8 +34,8 @@ spec: name: mongodb-addon tasks: - name: LogicalBackup - jobTemplate: - spec: - securityContext: - runAsUser: 0 - runAsGroup: 0 \ No newline at end of file + jobTemplate: + spec: + securityContext: + runAsUser: 0 + runAsGroup: 0 \ No newline at end of file diff --git a/docs/guides/mongodb/backup/kubestash/customization/examples/restore/restore.yaml b/docs/guides/mongodb/backup/kubestash/customization/examples/restore/restore.yaml index 9fa0048030..786b98395c 100644 --- a/docs/guides/mongodb/backup/kubestash/customization/examples/restore/restore.yaml +++ b/docs/guides/mongodb/backup/kubestash/customization/examples/restore/restore.yaml @@ -19,8 +19,8 @@ spec: name: mongodb-addon tasks: - name: LogicalBackupRestoress - jobTemplate: - spec: - securityContext: - runAsUser: 0 - runAsGroup: 0 \ No newline at end of file + jobTemplate: + spec: + securityContext: + runAsUser: 0 + runAsGroup: 0 \ No newline at end of file diff --git a/docs/guides/mongodb/backup/kubestash/customization/_index.md b/docs/guides/mongodb/backup/kubestash/customization/index.md similarity index 82% rename from docs/guides/mongodb/backup/kubestash/customization/_index.md rename to docs/guides/mongodb/backup/kubestash/customization/index.md index 59549ce249..fecda2249c 100644 --- a/docs/guides/mongodb/backup/kubestash/customization/_index.md +++ b/docs/guides/mongodb/backup/kubestash/customization/index.md @@ -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`. @@ -44,18 +44,20 @@ spec: name: s3-storage retentionPolicy: name: backup-rp - namespace: demo + namespace: demo sessions: - name: frequent scheduler: schedule: "*/5 * * * *" + jobTemplate: + backoffLimit: 1 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: @@ -68,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 @@ -89,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 @@ -135,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 @@ -167,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 @@ -206,9 +212,7 @@ demo s3-repo-mg-frequent-1702291682 s3-repo frequent 2023-12-11T demo s3-repo-mg-frequent-1702291685 s3-repo frequent 2023-12-11T10:49:10Z Delete Succeeded 82m ``` ->You can also filter the snapshots as shown in the guide [here](https://stash.run/docs/latest/concepts/crds/snapshot/#working-with-snapshot). - -The below example shows how you can pass a specific snapshot id through the `snapshots` filed of `rules` section. +The below example shows how you can pass a specific snapshot id through the `snapshots` filed of `spec.dataSource` section. ```yaml apiVersion: core.kubestash.com/v1alpha1 @@ -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 @@ -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 diff --git a/docs/guides/mongodb/backup/kubestash/logical/replicaset/examples/backupstorage-replicaset.yaml b/docs/guides/mongodb/backup/kubestash/logical/replicaset/examples/backupstorage-replicaset.yaml index 81614714ba..6076cf2038 100644 --- a/docs/guides/mongodb/backup/kubestash/logical/replicaset/examples/backupstorage-replicaset.yaml +++ b/docs/guides/mongodb/backup/kubestash/logical/replicaset/examples/backupstorage-replicaset.yaml @@ -11,7 +11,7 @@ spec: bucket: kubestash-testing region: us-east-1 prefix: demo-replicaset - secret: s3-secret + secretName: s3-secret usagePolicy: allowedNamespaces: from: All diff --git a/docs/guides/mongodb/backup/kubestash/logical/replicaset/_index.md b/docs/guides/mongodb/backup/kubestash/logical/replicaset/index.md similarity index 96% rename from docs/guides/mongodb/backup/kubestash/logical/replicaset/_index.md rename to docs/guides/mongodb/backup/kubestash/logical/replicaset/index.md index 9707437312..b63a6fecae 100644 --- a/docs/guides/mongodb/backup/kubestash/logical/replicaset/_index.md +++ b/docs/guides/mongodb/backup/kubestash/logical/replicaset/index.md @@ -19,17 +19,17 @@ KubeStash v0.1.0+ supports backup and restoration of MongoDB databases. This gui - At first, you need to have a Kubernetes cluster, and the `kubectl` command-line tool must be configured to communicate with your cluster. If you do not already have a cluster, you can create one by using Minikube. - Install KubeDB in your cluster following the steps [here](/docs/setup/README.md). -- Install KubeStash Enterprise in your cluster following the steps [here(link needed)](). -- Install KubeStash `kubectl` plugin following the steps [here(link needed)](). -- If you are not familiar with how KubeStash backup and restore MongoDB databases, please check the following guide [here](/docs/guides/mongodb/backup/kubestash/overview/_index.md). +- Install KubeStash Enterprise in your cluster following the steps [here](https://kubestash.com/docs/latest/setup/install/kubestash/). +- Install KubeStash `kubectl` plugin following the steps [here](https://kubestash.com/docs/latest/setup/install/kubectl-plugin/). +- If you are not familiar with how KubeStash backup and restore MongoDB databases, please check the following guide [here](/docs/guides/mongodb/backup/kubestash/overview/index.md). You have to be familiar with following custom resources: - [AppBinding](/docs/guides/mongodb/concepts/appbinding.md) -- [Function](https://stash.run/docs/latest/concepts/crds/function/) -- [Task](https://stash.run/docs/latest/concepts/crds/task/) -- [BackupConfiguration](https://stash.run/docs/latest/concepts/crds/backupconfiguration/) -- [RestoreSession](https://stash.run/docs/latest/concepts/crds/restoresession/) +- [Function](https://kubestash.com/docs/latest/concepts/crds/function/) +- [Addon](https://kubestash.com/docs/latest/concepts/crds/addon/) +- [BackupConfiguration](https://kubestash.com/docs/latest/concepts/crds/backupconfiguration/) +- [RestoreSession](https://kubestash.com/docs/latest/concepts/crds/restoresession/) To keep things isolated, we are going to use a separate namespace called `demo` throughout this tutorial. Create `demo` namespace if you haven't created yet. @@ -169,7 +169,7 @@ Now, we are ready to backup this sample database. ### Prepare Backend -We are going to store our backed up data into a S3 bucket. At first, we need to create a secret with S3 credentials then we need to create a `BackupStorage` crd. If you want to use a different backend, please read the respective backend configuration doc from [here](https://stash.run/docs/latest/guides/backends/overview/). +We are going to store our backed up data into a S3 bucket. At first, we need to create a secret with S3 credentials then we need to create a `BackupStorage` crd. If you want to use a different backend, please read the respective backend configuration doc from [here](https://kubestash.com/docs/latest/guides/backends/overview/). **Create Storage Secret:** @@ -202,7 +202,7 @@ spec: bucket: kubestash-testing region: us-east-1 prefix: demo-replicaset - secret: s3-secret + secretName: s3-secret usagePolicy: allowedNamespaces: from: All @@ -283,18 +283,20 @@ spec: name: s3-storage-replicaset 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: /replicaset encryptionSecret: - name: encry-secret - namespace: demo + name: encry-secret + namespace: demo addon: name: mongodb-addon tasks: diff --git a/docs/guides/mongodb/backup/kubestash/logical/sharding/_index.md b/docs/guides/mongodb/backup/kubestash/logical/sharding/index.md similarity index 96% rename from docs/guides/mongodb/backup/kubestash/logical/sharding/_index.md rename to docs/guides/mongodb/backup/kubestash/logical/sharding/index.md index 69435b449e..b65f6e4c77 100644 --- a/docs/guides/mongodb/backup/kubestash/logical/sharding/_index.md +++ b/docs/guides/mongodb/backup/kubestash/logical/sharding/index.md @@ -19,17 +19,17 @@ KubeStash v0.1.0+ supports backup and restoration of MongoDB databases. This gui - At first, you need to have a Kubernetes cluster, and the `kubectl` command-line tool must be configured to communicate with your cluster. If you do not already have a cluster, you can create one by using Minikube. - Install KubeDB in your cluster following the steps [here](/docs/setup/README.md). -- Install KubeStash Enterprise in your cluster following the steps [here(link needed)](). -- Install KubeStash `kubectl` plugin following the steps [here(link needed)](). -- If you are not familiar with how KubeStash backup and restore MongoDB databases, please check the following guide [here](/docs/guides/mongodb/backup/kubestash/overview/_index.md). +- Install KubeStash Enterprise in your cluster following the steps [here](https://kubestash.com/docs/latest/setup/install/kubestash/). +- Install KubeStash `kubectl` plugin following the steps [here](https://kubestash.com/docs/latest/setup/install/kubectl-plugin/). +- If you are not familiar with how KubeStash backup and restore MongoDB databases, please check the following guide [here](/docs/guides/mongodb/backup/kubestash/overview/index.md). You have to be familiar with following custom resources: - [AppBinding](/docs/guides/mongodb/concepts/appbinding.md) -- [Function](https://stash.run/docs/latest/concepts/crds/function/) -- [Task](https://stash.run/docs/latest/concepts/crds/task/) -- [BackupConfiguration](https://stash.run/docs/latest/concepts/crds/backupconfiguration/) -- [RestoreSession](https://stash.run/docs/latest/concepts/crds/restoresession/) +- [Function](https://kubestash.com/docs/latest/concepts/crds/function/) +- [Addon](https://kubestash.com/docs/latest/concepts/crds/addon/) +- [BackupConfiguration](https://kubestash.com/docs/latest/concepts/crds/backupconfiguration/) +- [RestoreSession](https://kubestash.com/docs/latest/concepts/crds/restoresession/) To keep things isolated, we are going to use a separate namespace called `demo` throughout this tutorial. Create `demo` namespace if you haven't created yet. @@ -177,7 +177,7 @@ Now, we are ready to backup this sample database. ### Prepare Backend -We are going to store our backed up data into a S3 bucket. At first, we need to create a secret with S3 credentials then we need to create a `BackupStorage` crd. If you want to use a different backend, please read the respective backend configuration doc from [here](https://stash.run/docs/latest/guides/backends/overview/). +We are going to store our backed up data into a S3 bucket. At first, we need to create a secret with S3 credentials then we need to create a `BackupStorage` crd. If you want to use a different backend, please read the respective backend configuration doc from [here](https://kubestash.com/docs/latest/guides/backends/overview/). **Create Storage Secret:** @@ -210,7 +210,7 @@ spec: bucket: kubestash-testing region: us-east-1 prefix: demo-sharding - secret: s3-secret + secretName: s3-secret usagePolicy: allowedNamespaces: from: All @@ -291,18 +291,20 @@ spec: name: s3-storage-sharding 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: /sharding encryptionSecret: - name: encry-secret - namespace: demo + name: encry-secret + namespace: demo addon: name: mongodb-addon tasks: diff --git a/docs/guides/mongodb/backup/kubestash/logical/standalone/_index.md b/docs/guides/mongodb/backup/kubestash/logical/standalone/index.md similarity index 95% rename from docs/guides/mongodb/backup/kubestash/logical/standalone/_index.md rename to docs/guides/mongodb/backup/kubestash/logical/standalone/index.md index d364622dd2..e9e482b925 100644 --- a/docs/guides/mongodb/backup/kubestash/logical/standalone/_index.md +++ b/docs/guides/mongodb/backup/kubestash/logical/standalone/index.md @@ -19,17 +19,17 @@ KubeStash v0.1.0+ supports backup and restoration of MongoDB databases. This gui - At first, you need to have a Kubernetes cluster, and the `kubectl` command-line tool must be configured to communicate with your cluster. If you do not already have a cluster, you can create one by using Minikube. - Install KubeDB in your cluster following the steps [here](/docs/setup/README.md). -- Install KubeStash Enterprise in your cluster following the steps [here(link needed)](). -- Install KubeStash `kubectl` plugin following the steps [here(link needed)](). -- If you are not familiar with how KubeStash backup and restore MongoDB databases, please check the following guide [here](/docs/guides/mongodb/backup/kubestash/overview/_index.md). +- Install KubeStash Enterprise in your cluster following the steps [here](https://kubestash.com/docs/latest/setup/install/kubestash/). +- Install KubeStash `kubectl` plugin following the steps [here](https://kubestash.com/docs/latest/setup/install/kubectl-plugin/). +- If you are not familiar with how KubeStash backup and restore MongoDB databases, please check the following guide [here](/docs/guides/mongodb/backup/kubestash/overview/index.md). You have to be familiar with following custom resources: - [AppBinding](/docs/guides/mongodb/concepts/appbinding.md) -- [Function](https://stash.run/docs/latest/concepts/crds/function/) -- [Task](https://stash.run/docs/latest/concepts/crds/task/) -- [BackupConfiguration](https://stash.run/docs/latest/concepts/crds/backupconfiguration/) -- [RestoreSession](https://stash.run/docs/latest/concepts/crds/restoresession/) +- [Function](https://kubestash.com/docs/latest/concepts/crds/function/) +- [Addon](https://kubestash.com/docs/latest/concepts/crds/addon/) +- [BackupConfiguration](https://kubestash.com/docs/latest/concepts/crds/backupconfiguration/) +- [RestoreSession](https://kubestash.com/docs/latest/concepts/crds/restoresession/) To keep things isolated, we are going to use a separate namespace called `demo` throughout this tutorial. Create `demo` namespace if you haven't created yet. @@ -163,7 +163,7 @@ Now, we are ready to backup this sample database. ### Prepare Backend -We are going to store our backed up data into a S3 bucket. At first, we need to create a secret with S3 credentials then we need to create a `BackupStorage` crd. If you want to use a different backend, please read the respective backend configuration doc from [here](https://stash.run/docs/latest/guides/backends/overview/). +We are going to store our backed up data into a S3 bucket. At first, we need to create a secret with S3 credentials then we need to create a `BackupStorage` crd. If you want to use a different backend, please read the respective backend configuration doc from [here](https://kubestash.com/docs/latest/guides/backends/overview/). **Create Storage Secret:** @@ -196,7 +196,7 @@ spec: bucket: kubestash-testing region: us-east-1 prefix: demo - secret: s3-secret + secretName: s3-secret usagePolicy: allowedNamespaces: from: All @@ -277,18 +277,20 @@ 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: diff --git a/docs/guides/mongodb/backup/kubestash/overview/images/backup_overview.svg b/docs/guides/mongodb/backup/kubestash/overview/images/backup_overview.svg index d2c6722b0e..e359416179 100644 --- a/docs/guides/mongodb/backup/kubestash/overview/images/backup_overview.svg +++ b/docs/guides/mongodb/backup/kubestash/overview/images/backup_overview.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/docs/guides/mongodb/backup/kubestash/overview/images/sharded_backup.svg b/docs/guides/mongodb/backup/kubestash/overview/images/sharded_backup.svg index 3e0b4cb461..eb2ed49239 100644 --- a/docs/guides/mongodb/backup/kubestash/overview/images/sharded_backup.svg +++ b/docs/guides/mongodb/backup/kubestash/overview/images/sharded_backup.svg @@ -1,4 +1,4 @@ -
KubeStash
Backup Job
KubeStash...
R1
R1
R2
R2
R3
R3
MongoDB
ReplicaSet
Cluster
MongoDB...
Primary
Primary
Secondary
Secondary
Secondary
Secondary
mongodump
mongodump
Text is not SVG - cannot display
\ No newline at end of file + image/svg+xml
KubeStash
Backup Job
\ No newline at end of file diff --git a/docs/guides/mongodb/backup/kubestash/overview/images/sharded_restore.svg b/docs/guides/mongodb/backup/kubestash/overview/images/sharded_restore.svg index 25b7126c02..4202d1a277 100644 --- a/docs/guides/mongodb/backup/kubestash/overview/images/sharded_restore.svg +++ b/docs/guides/mongodb/backup/kubestash/overview/images/sharded_restore.svg @@ -1,4 +1,4 @@ -
KubeStash
Backup Job
KubeStash...
R1
R1
R2
R2
R3
R3
MongoDB
ReplicaSet
Cluster
MongoDB...
Primary
Primary
Secondary
Secondary
Secondary
Secondary
mongodump
mongodump
Text is not SVG - cannot display
\ No newline at end of file + image/svg+xml
KubeStash
Restore Job
\ No newline at end of file diff --git a/docs/guides/mongodb/backup/kubestash/overview/_index.md b/docs/guides/mongodb/backup/kubestash/overview/index.md similarity index 84% rename from docs/guides/mongodb/backup/kubestash/overview/_index.md rename to docs/guides/mongodb/backup/kubestash/overview/index.md index b09365f90f..a6b3402eb0 100644 --- a/docs/guides/mongodb/backup/kubestash/overview/_index.md +++ b/docs/guides/mongodb/backup/kubestash/overview/index.md @@ -7,11 +7,12 @@ menu: parent: guides-mongodb-backup-stashv2 weight: 10 menu_name: docs_{{ .version }} +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 @@ -77,7 +78,7 @@ For MongoDB ReplicaSet cluster, KubeStash takes backup from one of the secondary 4. Unlock the secondary replica.
- MongoDB ReplicaSet Cluster Backup Overview + MongoDB ReplicaSet Cluster Backup Overview
Fig: MongoDB ReplicaSet Cluster Backup
@@ -95,7 +96,7 @@ For MongoDB sharded cluster, KubeStash takes backup of the individual shards as 8. Enable balancer.
- MongoDB Sharded Cluster Backup Overview + MongoDB Sharded Cluster Backup Overview
Fig: MongoDB Sharded Cluster Backup
@@ -104,17 +105,17 @@ For MongoDB sharded cluster, KubeStash takes backup of the individual shards as The following diagram shows how KubeStash restores backed up data into a MongoDB database. Open the image in a new tab to see the enlarged version.
- Database Restore Overview + Database Restore Overview
Fig: MongoDB Restore Process Overview
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. @@ -133,7 +134,7 @@ This section will show you restore process works for different MongoDB configura For a standalone MongoDB database, the restore job downloads the backed up data from the backend and pipe the downloaded data to `mongorestore` command which inserts the data into the desired MongoDB database.
- Standalone MongoDB Restore Overview + Standalone MongoDB Restore Overview
Fig: Standalone MongoDB Restore
@@ -142,7 +143,7 @@ For a standalone MongoDB database, the restore job downloads the backed up data For MongoDB ReplicaSet cluster, KubeStash identifies the primary replica and restore into it.
- MongoDB ReplicaSet Cluster Restore Overview + MongoDB ReplicaSet Cluster Restore Overview
Fig: MongoDB ReplicaSet Cluster Restore
@@ -151,14 +152,14 @@ For MongoDB ReplicaSet cluster, KubeStash identifies the primary replica and res For MongoDB sharded cluster, KubeStash identifies the primary replica of each shard as well as the config server and restore respective backed up data into them.
- MongoDB Sharded Cluster Restore + MongoDB Sharded Cluster Restore
Fig: MongoDB Sharded Cluster Restore
## Next Steps -- Backup a standalone MongoDB databases using KubeStash following the guide from [here](/docs/guides/mongodb/backup/kubestash/logical/standalone/_index.md). -- Backup a MongoDB Replicaset cluster using Stash following the guide from [here](/docs/guides/mongodb/backup/kubestash/logical/replicaset/_index.md). -- Backup a sharded MongoDB cluster using KubeStash following the guide from [here](/docs/guides/mongodb/backup/kubestash/logical/sharding/_index.md). +- Backup a standalone MongoDB databases using KubeStash following the guide from [here](/docs/guides/mongodb/backup/kubestash/logical/standalone/index.md). +- Backup a MongoDB Replicaset cluster using KubeStash following the guide from [here](/docs/guides/mongodb/backup/kubestash/logical/replicaset/index.md). +- Backup a sharded MongoDB cluster using KubeStash following the guide from [here](/docs/guides/mongodb/backup/kubestash/logical/sharding/index.md).