Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add supported backends docs under guides #4

Merged
merged 4 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 1 addition & 35 deletions docs/FAQ/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,9 @@ aliases:

# Frequently Asked Questions

## How to temporarily pause a backup?

### Pause Backup

Run the following commands to pasue a backup temporarily,

```bash
# pause backup by patching BackupConfiguration
❯ kubectl patch backupconfiguration -n <namespace> <backupconfiguration name> --type="merge" --patch='{"spec": {"paused": true}}'

# pause backup using Stash `kubectl` plugin
❯ kubectl stash pause backup -n demo --backupconfig=<backupconfiguration name>
```

### Resume Backup

Similarly you can also resume a paused backup. Run the following commands to resume a backup,

```bash
# resume backup by patching BackupConfiguration
kubectl patch backupconfiguration -n <namespace> <backupconfiguration name> --type="merge" --patch='{"spec": {"paused": false}}'

# resume backup using Stash `kubectl` plugin
❯ kubectl stash resume backup -n demo --backupconfig=<backupconfiguration name>
```

## When `retentionPolicy` is applied?

`retentionPolicy` specifies the policy to follow for cleaning old snapshots. Stash removes any snapshot from backend that falls outside the scope of the policy. When a `BackupSession` is completed, Stash checks for outdated snapshots according to the `retentionPolicy` and remove them. If you use the policy `keep-last-5`, Stash will remove any snapshot that is older than the most recent 5 snapshots.

## Do I need to delete the init containers after recovery?

You don't need to delete the init containers after recovery. If your workload restarts with the `stash-init` init-container for any reason, the init-container will skip running restore process if there is no pending RestoreSession for this workload. If you delete the RestoreSession, Stash will remove the `init-container` automatically. Beware that it will cause your workload to restart.

## I am experiencing problem X. How do I fix this?

Please check our troubleshooting guide [here](/docs/guides/troubleshooting/how-to-troubleshoot/index.md).
Please check our troubleshooting guide [here](/docs/guides/).

## Need More Help?

Expand Down
2 changes: 1 addition & 1 deletion docs/concepts/crds/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Declarative API | Stash
title: Declarative API | KubeStash
description: Declarative API
menu:
docs_{{ .version }}:
Expand Down
2 changes: 1 addition & 1 deletion docs/concepts/what-is-kubestash/overview/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ section_menu_id: concepts

# KubeStash

[KubeStash](https://kubestash.Com) by AppsCode is a cloud native data backup and recovery solution for Kubernetes workloads. If you are running production workloads in Kubernetes, you might want to take backup of your disks, databases etc. Traditional tools are too complex to setup and maintain in a dynamic compute environment like Kubernetes. KubeStash is a Kubernetes operator that uses [restic](https://github.com/restic/restic) or Kubernetes CSI Driver VolumeSnapshotter functionality to address these issues. Using KubeStash, you can backup Kubernetes volumes mounted in workloads, stand-alone volumes and databases. User may even extend KubeStash via [addons](https://stash.run/docs/{{< param "info.version" >}}/guides/addons/overview/) for any custom workload.
[KubeStash](https://kubestash.Com) by AppsCode is a cloud native data backup and recovery solution for Kubernetes workloads. If you are running production workloads in Kubernetes, you might want to take backup of your disks, databases etc. Traditional tools are too complex to setup and maintain in a dynamic compute environment like Kubernetes. KubeStash is a Kubernetes operator that uses [restic](https://github.com/restic/restic) or Kubernetes CSI Driver VolumeSnapshotter functionality to address these issues. Using KubeStash, you can backup Kubernetes volumes mounted in workloads, stand-alone volumes and databases. User may even extend KubeStash via [addons](https://kubestash.com/docs/{{< param "info.version" >}}/concepts/crds/addon/) for any custom workload.

## Features

Expand Down
21 changes: 14 additions & 7 deletions docs/guides/backends/azure/examples/azure.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
apiVersion: stash.appscode.com/v1alpha1
kind: Repository
apiVersion: storage.kubestash.com/v1alpha1
kind: BackupStorage
metadata:
name: azure-repo
name: azure-storage
namespace: demo
spec:
backend:
storage:
provider: azure
azure:
container: stash-backup
prefix: /demo/deployment/my-deploy
storageSecretName: azure-secret
storageAccount: kubestash
container: kubestash-demo
prefix: /backup/demo/deployment/kubestash-demo
secretName: azure-secret
usagePolicy:
allowedNamespaces:
from: All
default: true
deletionPolicy: WipeOut
64 changes: 33 additions & 31 deletions docs/guides/backends/azure/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Azure Backend | Stash
description: Configure Stash to use Microsoft Azure Storage as Backend.
title: Azure Backend | KubeStash
description: Configure KubeStash to use Microsoft Azure Storage as Backend.
menu:
docs_{{ .version }}:
identifier: backend-azure
Expand All @@ -14,72 +14,74 @@ section_menu_id: guides

# Microsoft Azure Storage

Stash supports Microsoft's [Azure Blob Storage](https://azure.microsoft.com/en-us/services/storage/blobs/) as a backend. This tutorial will show you how to use this backend.
KubeStash supports Microsoft's [Azure Blob Storage](https://azure.microsoft.com/en-us/services/storage/blobs/) as a backend. This tutorial will show you how to use this backend.

In order to use Azure Blob Storage as backend, you have to create a `Secret` and a `Repository` object pointing to the desired blob container.
In order to use Azure Blob Storage as backend, you have to create a `Secret` and a `BackupStorage` object pointing to the desired blob container.

#### Create Storage Secret

To configure storage secret for this backend, following secret keys are needed:

| Key | Type | Description |
| -------------------- | ---------- | ---------------------------------------------------------- |
| `RESTIC_PASSWORD` | `Required` | Password that will be used to encrypt the backup snapshots |
| `AZURE_ACCOUNT_NAME` | `Required` | Azure Storage account name |
| `AZURE_ACCOUNT_KEY` | `Required` | Azure Storage account key |

Create storage secret as below,

```bash
$ echo -n 'changeit' > RESTIC_PASSWORD
$ echo -n '<your-azure-storage-account-name>' > AZURE_ACCOUNT_NAME
$ echo -n '<your-azure-storage-account-key>' > AZURE_ACCOUNT_KEY
$ kubectl create secret generic -n demo azure-secret \
--from-file=./RESTIC_PASSWORD \
--from-file=./AZURE_ACCOUNT_NAME \
--from-file=./AZURE_ACCOUNT_KEY
secret/azure-secret created
```

### Create Repository
### Create BackupStorage

Now, you have to create a `Repository` 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` cr. You have to specify the name of the storage secret that we have created earlier in the `spec.storage.azure.secretName` field.

Following parameters are available for `azure` backend.

| Parameter | Type | Description |
| ---------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `azure.container` | `Required` | Name of Storage container. |
| `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, Stash will use maximum 5 parallel connections. |
| Parameter | Type | Description |
|------------------------| ---------- |-----------------------------------------------------------------------------------------------------------------------------------------|
| `azure.storageAccount` | `Required` | Name of the Storage account. |
| `azure.container` | `Required` | Name of Storage container. |
| `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. |

Below, the YAML of a sample `Repository` crd that uses an Azure Blob container as a backend.
Below, the YAML of a sample `BackupStorage` crd that uses an Azure Blob container as a backend.

```yaml
apiVersion: stash.appscode.com/v1alpha1
kind: Repository
apiVersion: storage.kubestash.com/v1alpha1
kind: BackupStorage
metadata:
name: azure-repo
name: azure-storage
namespace: demo
spec:
backend:
storage:
provider: azure
azure:
container: stash-backup
prefix: /demo/deployment/my-deploy
storageSecretName: azure-secret
storageAccount: kubestash
container: kubestash-demo
prefix: /backup/demo/deployment/kubestash-demo
secretName: azure-secret
usagePolicy:
allowedNamespaces:
from: All
default: true
deletionPolicy: WipeOut
```

Create the `Repository` we have shown above using the following command,
Create the `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/azure/examples/azure.yaml
repository/azure-repo created
backupstorage.storage.kubestash.com/azure-storage created
```

Now, we are ready to use this backend to backup our desired data using Stash.
Now, we are ready to use this backend to backup our desired data using KubeStash.

## 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).
11 changes: 0 additions & 11 deletions docs/guides/backends/b2/examples/b2.yaml

This file was deleted.

87 changes: 0 additions & 87 deletions docs/guides/backends/b2/index.md

This file was deleted.

24 changes: 16 additions & 8 deletions docs/guides/backends/gcs/examples/gcs.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
apiVersion: stash.appscode.com/v1alpha1
kind: Repository
apiVersion: storage.kubestash.com/v1alpha1
kind: BackupStorage
metadata:
name: gcs-repo
name: s3-storage
namespace: demo
spec:
backend:
gcs:
bucket: stash-backup
prefix: /demo/deployment/my-deploy
storageSecretName: gcs-secret
storage:
provider: s3
s3:
endpoint: s3.amazonaws.com # use server URL for s3 compatible other storage service
bucket: kubestash-demo
region: us-west-1
prefix: /backup/demo/deployment/kubestash-demo
secretName: s3-secret
usagePolicy:
allowedNamespaces:
from: All
default: true
deletionPolicy: WipeOut
Loading
Loading