Skip to content

Commit

Permalink
Add Guides Section
Browse files Browse the repository at this point in the history
Signed-off-by: Anisur Rahman <[email protected]>
  • Loading branch information
anisurrahman75 committed Dec 29, 2023
1 parent 4a02460 commit b7886d6
Show file tree
Hide file tree
Showing 13 changed files with 202 additions and 351 deletions.
28 changes: 13 additions & 15 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,46 +14,44 @@ 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` crd. You have to provide the storage secret that we have created earlier in `spec.storage.azure.secret` 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.container` | `Required` | Name of Storage container. |
| `azure.secret` | `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
Expand Down
13 changes: 0 additions & 13 deletions docs/guides/backends/local/examples/awsElasticBolckStore.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions docs/guides/backends/local/examples/azureDisk.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions docs/guides/backends/local/examples/emptyDir.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions docs/guides/backends/local/examples/gcePersistentDisk.yaml

This file was deleted.

21 changes: 15 additions & 6 deletions docs/guides/backends/local/examples/hostPath.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
apiVersion: stash.appscode.com/v1alpha1
kind: Repository
apiVersion: storage.kubestash.com/v1alpha1
kind: BackupStorage
metadata:
name: local-repo-with-hostpath
name: local-storage-with-hostpath
namespace: demo
spec:
backend:
storage:
provider: local
local:
mountPath: /safe/data
hostPath:
path: /data/stash-test/repo
storageSecretName: local-secret
path: /data/kubestash-test/storage
usagePolicy:
allowedNamespaces:
from: All
default: true
deletionPolicy: WipeOut
runtimeSettings:
pod:
securityContext:
runAsUser: 0 # Give run as a root permission
19 changes: 14 additions & 5 deletions docs/guides/backends/local/examples/nfs.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
apiVersion: stash.appscode.com/v1alpha1
kind: Repository
apiVersion: storage.kubestash.com/v1alpha1
kind: BackupStorage
metadata:
name: local-repo-with-nfs
name: local-storage-with-nfs
namespace: demo
spec:
backend:
storage:
provider: local
local:
mountPath: /safe/data
nfs:
server: "nfs-service.storage.svc.cluster.local" # use you own NFS server address
path: "/" # this path is relative to "/exports" path of NFS server
storageSecretName: local-secret
usagePolicy:
allowedNamespaces:
from: All
default: false
deletionPolicy: WipeOut
runtimeSettings:
pod:
securityContext:
fsGroup: 65535 # Give file system group permission
21 changes: 15 additions & 6 deletions docs/guides/backends/local/examples/pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
apiVersion: stash.appscode.com/v1alpha1
kind: Repository
apiVersion: storage.kubestash.com/v1alpha1
kind: BackupStorage
metadata:
name: local-repo-with-pvc
name: local-storage-with-pvc
namespace: demo
spec:
backend:
storage:
provider: local
local:
mountPath: /safe/data
persistentVolumeClaim:
claimName: repo-pvc
storageSecretName: local-secret
claimName: storage-pvc
usagePolicy:
allowedNamespaces:
from: All
default: false
deletionPolicy: WipeOut
runtimeSettings:
pod:
securityContext:
fsGroup: 65535 # Give file system group permission
13 changes: 0 additions & 13 deletions docs/guides/backends/local/examples/storageOS.yaml

This file was deleted.

Loading

0 comments on commit b7886d6

Please sign in to comment.