Skip to content

Commit

Permalink
re-write backend overview
Browse files Browse the repository at this point in the history
Signed-off-by: Anisur Rahman <[email protected]>
  • Loading branch information
anisurrahman75 committed Mar 6, 2024
1 parent fe1d00d commit a782895
Show file tree
Hide file tree
Showing 11 changed files with 169 additions and 174 deletions.
5 changes: 2 additions & 3 deletions docs/guides/backends/azure/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ secret/azure-secret created

### Create BackupStorage

Now, you have to create a `BackupStorage` crd. You have to provide the storage secret that we have created earlier in `spec.storage.azure.secret` field.
Now, you have to create a `BackupStorage` crd. You have to provide the storage secret that we have created earlier in `spec.storage.azure.secretName` field.

Following parameters are available for `azure` backend.

| Parameter | Type | Description |
|------------------------| ---------- |-----------------------------------------------------------------------------------------------------------------------------------------|
| `azure.storageAccount` | `Required` | Name of the Storage account. |
| `azure.container` | `Required` | Name of Storage container. |
| `azure.secret` | `Required` | Specify the name of the Secret that contains the access credential for this storage. | |
| `azure.secretName` | `Required` | Specify the name of the Secret that contains the access credential for this storage. | |
| `azure.prefix` | `Optional` | Path prefix inside the container where backed up data will be stored. |
| `azure.maxConnections` | `Optional` | Maximum number of parallel connections to use for uploading backup data. By default, KubeStash will use maximum 5 parallel connections. |

Expand Down Expand Up @@ -84,5 +84,4 @@ Now, we are ready to use this backend to backup our desired data using KubeStash
## Next Steps

- Learn how to use KubeStash to backup workloads data from [here](/docs/guides/workloads/overview/index.md).
- Learn how to use KubeStash to backup databases from [here](/docs/guides/addons/overview/index.md).
- Learn how to use KubeStash to backup stand-alone PVC from [here](/docs/guides/volumes/overview/index.md).
8 changes: 4 additions & 4 deletions docs/guides/backends/gcs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@ secret/gcs-secret created

### Create BackupStorage

Now, you have to create a `BackupStorage` crd. You have to provide the storage secret that we have created earlier in `spec.backend.storageSecretName` field.
Now, you have to create a `BackupStorage` crd. You have to provide the storage secret that we have created earlier in `spec.storage.gcs.SecretName` field.

Following parameters are available for `gcs` backend.

| Parameter | Type | Description |
| -------------------- | ---------- |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Parameter | Type | Description |
|----------------------| ---------- |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `gcs.bucket` | `Required` | Name of Bucket. If the bucket does not exist yet, it will be created in the default location (US). It is not possible at the moment for KubeStash to create a new bucket in a different location, so you need to create it using Google cloud console. |
| `gcs.secretName` | `Required` | Specify the name of the Secret that contains the access credential for this storage. |
| `gcs.prefix` | `Optional` | Path prefix inside the bucket where backed up data will be stored. |
| `gcs.maxConnections` | `Optional` | Maximum number of parallel connections to use for uploading backup data. By default, KubeStash will use maximum 5 parallel connections. |

Expand Down Expand Up @@ -87,5 +88,4 @@ Now, we are ready to use this backend to backup our desired data using KubeStash
## Next Steps

- Learn how to use KubeStash to backup workloads data from [here](/docs/guides/workloads/overview/index.md).
- Learn how to use KubeStash to backup databases from [here](/docs/guides/addons/overview/index.md).
- Learn how to use KubeStash to backup stand-alone PVC from [here](/docs/guides/volumes/overview/index.md).
11 changes: 5 additions & 6 deletions docs/guides/backends/local/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ section_menu_id: guides

### What is Local Backend

`Local` backend refers to a local path inside `kubestash` backup container. Any Kubernetes supported [persistent volume](https://kubernetes.io/docs/concepts/storage/volumes/) such as [PersistentVolumeClaim](https://kubernetes.io/docs/concepts/storage/volumes/#persistentvolumeclaim), [HostPath](https://kubernetes.io/docs/concepts/storage/volumes/#hostpath), [EmptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir) (for testing only), [NFS](https://kubernetes.io/docs/concepts/storage/volumes/#nfs), [gcePersistentDisk](https://kubernetes.io/docs/concepts/storage/volumes/#gcepersistentdisk) etc. can be used as local backend.
`Local` backend refers to a local path inside `kubestash` backup job. Any Kubernetes supported [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) such as [PersistentVolumeClaim](https://kubernetes.io/docs/concepts/storage/volumes/#persistentvolumeclaim), [HostPath](https://kubernetes.io/docs/concepts/storage/volumes/#hostpath), [EmptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir) (for testing only), [NFS](https://kubernetes.io/docs/concepts/storage/volumes/#nfs), [gcePersistentDisk](https://kubernetes.io/docs/concepts/storage/volumes/#gcepersistentdisk) etc. can be used as local backend.

### Create BackupStorage

Expand All @@ -31,7 +31,7 @@ Following parameters are available for `Local` backend.
| `local.VolumeSource` | `Required` | Any Kubernetes volume. Can be specified inlined. Example: `hostPath`. |


> Note that by default, for local backend KubeStash run an initializer job, which doesn’t have file write permission. So, in order to achieve
> Note that by default, KubeStash run an initializer job for the local backend, which doesn’t have file write permission. So, in order to achieve
that you must give file system group permission, achieved by specifying `spec.securityContext.pod.fsGroup` in the BackupStorage configuration.

Here, we are going to show some sample `BackupStorage` objects that uses different Kubernetes volume as a backend.
Expand Down Expand Up @@ -146,10 +146,9 @@ $ kubectl apply -f https://github.com/kubestash/docs/raw/{{< param "info.version
backupstorage.storage.kubestash.com/local-storage-with-nfs created
```

>For NFS backend, KubeStash may have to run the network volume accessor deployments in privileged mode to provide Snapshot listing facility. In this case, please configure network volume accessors by following the instruction [here](/docs/setup/install/troubleshooting/index.md#configuring-network-volume-accessor).
>For NFS backend, KubeStash may have to run the network volume accessor deployments in privileged mode to provide KubeStash CLI facilities. In this case, please configure network volume accessors by following the instruction [here](/docs/setup/install/troubleshooting/index.md#configuring-network-volume-accessor).

## Next Steps

- Learn how to use Stash to backup workloads data from [here](/docs/guides/workloads/overview/index.md).
- Learn how to use Stash to backup databases from [here](/docs/guides/addons/overview/index.md).
- Learn how to use Stash to backup stand-alone PVC from [here](/docs/guides/volumes/overview/index.md).
- Learn how to use KubeStash to backup workloads data from [here](/docs/guides/workloads/overview/index.md).
- Learn how to use KubeStash to backup stand-alone PVC from [here](/docs/guides/volumes/overview/index.md).
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 13 additions & 7 deletions docs/guides/backends/overview/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ section_menu_id: guides

KubeStash supports various backends for use as a BackupStorage. It can be a cloud storage like GCS bucket, AWS S3, Azure Blob Storage etc. or a Kubernetes persistent volume like [HostPath](https://kubernetes.io/docs/concepts/storage/volumes/#hostpath), [PersistentVolumeClaim](https://kubernetes.io/docs/concepts/storage/volumes/#persistentvolumeclaim), [NFS](https://kubernetes.io/docs/concepts/storage/volumes/#nfs) etc.

The following diagram shows how kubestash backup container accesses and backs up data into a backend.
The following diagram shows how kubestash operator and backup container accesses and backs up data into a backend.

<figure align="center">
<img alt="KubeStash Backend Overview" src="images/kubestash_backend_overview.svg">
<figcaption align="center">Fig: KubeStash Backend Overview</figcaption>
</figure>

You need to create a [BackupStorage]() object that contains backend information along with a Secret object containing the corresponding backend credentials required for accessing the backend.
The Backend process works in the following steps:

When you create the BackupStorage object, the Kubestash operator reads backend information from this object and retrieves access credentials from the associated Secret and initializes the BackupStorage.

Below, a screenshot that shows initialization of a BackupStorage in a GCS bucket named `kubestash-qa`:
- At first user creates a [BackupStorage](/docs/concepts/crds/backupstorage/index.md) object that contains the backend information along with a `Secret` object containing the corresponding backend credentials required for accessing the backend.
- KubeStash operator watches for `BackupStorage` custom resources and `Secrets`. When it finds a `BackupStorage` object, it establishes a connection with the storage by uploading the `metadata.yaml` file into the target storage.

Below, a screenshot that shows initialization of a `BackupStorage` in a GCS bucket named `kubestash-qa`:

<figure align="center">
  <img alt="BackupStorage initialization in GCS Backend" src="./images/backupstorage-initialize.png">
Expand All @@ -42,8 +42,11 @@ Below, a screenshot that shows initialization of a BackupStorage in a GCS bucket
Here, `kubestash-qa` serves as the bucket name, and the presence of `metadata.yaml` indicates the successful initialization of the BackupStorage.

## Repository
Once the BackupStoarge is initialize and in ready phase then the next steps is creating [BackupConfiguration](). When you create a BackupConfiguration, then KubeStash operator retrieves [Repository]() information from it and create Repository. This Repository object serve as a container for effectively managing and storing the backups data.

- Once the `BackupStorage` is initialized and in ready phase then the next steps is creating [BackupConfiguration](/docs/concepts/crds/backupconfiguration/index.md).
- User creates a `BackupConfiguration` custom resource. The `BackupConfiguration` object specifies the `Repository` pointing to a `BackupStorage` that contains backend information, indicating where to upload backup data. Multiple `Repository` objects can refer to a single `BackupStorage`.
- Then KubeStash operator retrieves `Repository` information from it and create `Repository` object. This Repository object serves as a container for effectively managing and storing the backup data.
- KubeStash operator triggers a `Backup` job according to the schedule defined in the `BackupConfiguration`. This job accesses the `BackupStorage` object and `Secret` and uploads backup data into the storage.

Below, a screenshot the shows a `Repository` named `mongodb-backup` with backup data under a `BackupStorage` named `demo`:

Expand All @@ -54,4 +57,7 @@ Below, a screenshot the shows a `Repository` named `mongodb-backup` with backup


## Next Steps
- Learn how to configure `Kubernetes Volume` as backend from [here]().
- Learn how to configure `Kubernetes Volume` as backend from [here](/docs/guides/backends/local/index.md).
- Learn how to configure `AWS S3/Minio/Rook` backend from [here](/docs/guides/backends/s3/index.md).
- Learn how to configure `Google Cloud Storage (GCS)` backend from [here](/docs/guides/backends/gcs/index.md).
- Learn how to configure `Microsoft Azure Storage` backend from [here](/docs/guides/backends/azure/index.md).
9 changes: 4 additions & 5 deletions docs/guides/backends/s3/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,20 @@ secret/minio-secret created

### Create BackupStorage

Now, you have to create a `BackupStorage` object. You have to provide the storage secret that we have created earlier in `spec.storage.s3.secret` field.
Now, you have to create a `BackupStorage` object. You have to provide the storage secret that we have created earlier in `spec.storage.s3.secretName` field.

Following parameters are available for `S3` backend.

| Parameter | Type | Description |
|------------------| ---------- |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `s3.endpoint` | `Required` | For S3, use `s3.amazonaws.com`. If your bucket is in a different location, S3 server (s3.amazonaws.com) will redirect KubeStash to the correct endpoint. For DigitalOCean, use `nyc3.digitaloceanspaces.com` etc. depending on your bucket region. For S3-compatible other storage services like Minio / Rook use URL of the server. |
| `s3.bucket` | `Required` | Name of Bucket. If the bucket does not exist yet it will be created in the default location (`us-east-1` for S3). It is not possible at the moment for KubeStash to create a new bucket in a different location, so you need to create it using a different program. |
| `s3.secret` | `Required` | Specify the name of the Secret that contains the access credential for this storage. |
| `s3.secretName` | `Required` | Specify the name of the Secret that contains the access credential for this storage. |
| `s3.region` | `Optional` | Specify the region of your bucket. |
| `s3.prefix` | `Optional` | Path prefix inside the bucket where the backed up data will be stored. |
| `s3.insecureTLS` | `Optional` | Specify whether to skip TLS certificate verification. Setting this field to `true` disables verification, which might be necessary in cases where the server uses self-signed certificates or certificates from an untrusted CA. Use this option with caution, as it can expose the client to man-in-the-middle attacks and other security risks. Only use it when absolutely necessary. |

Below, the YAML of a sample `Repository` crd that uses an `S3` bucket as a backend.
Below, the YAML of a sample `BackupStorage` object that uses an `S3` bucket as a backend.

```yaml
apiVersion: storage.kubestash.com/v1alpha1
Expand Down Expand Up @@ -121,7 +121,7 @@ spec:
deletionPolicy: WipeOut
```
Create the `s3-repo` Repository we have shown above using the following command,
Create the `s3-storage` BackupStorage we have shown above using the following command,

```bash
$ kubectl apply -f https://github.com/kubestash/docs/raw/{{< param "info.version" >}}/docs/guides/backends/s3/examples/minio.yaml
Expand All @@ -133,5 +133,4 @@ Now, we are ready to use this backend to backup our desired data using KubeStash
## Next Steps

- Learn how to use KubeStash to backup workloads data from [here](/docs/guides/workloads/overview/index.md).
- Learn how to use KubeStash to backup databases from [here](/docs/guides/addons/overview/index.md).
- Learn how to use KubeStash to backup stand-alone PVC from [here](/docs/guides/volumes/overview/index.md).
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

0 comments on commit a782895

Please sign in to comment.