Skip to content

Commit

Permalink
fix bad yamls
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 64cd8e4 commit 55346a1
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 49 deletions.
69 changes: 35 additions & 34 deletions docs/guides/mongodb/backup/kubestash/auto-backup/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -81,7 +80,7 @@ spec:
bucket: kubestash-testing
region: us-east-1
prefix: demo
secret: s3-secret
secretName: s3-secret
usagePolicy:
allowedNamespaces:
from: All
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 5 additions & 3 deletions docs/guides/mongodb/backup/kubestash/customization/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 6 additions & 4 deletions docs/guides/mongodb/backup/kubestash/logical/replicaset/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
10 changes: 6 additions & 4 deletions docs/guides/mongodb/backup/kubestash/logical/sharding/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
10 changes: 6 additions & 4 deletions docs/guides/mongodb/backup/kubestash/logical/standalone/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ spec:
bucket: kubestash-testing
region: us-east-1
prefix: demo
secret: s3-secret
secretName: s3-secret
usagePolicy:
allowedNamespaces:
from: All
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 55346a1

Please sign in to comment.