diff --git a/docs/guides/backends/azure/examples/azure.yaml b/docs/guides/backends/azure/examples/azure.yaml index ef092cf..fbef278 100644 --- a/docs/guides/backends/azure/examples/azure.yaml +++ b/docs/guides/backends/azure/examples/azure.yaml @@ -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 + secret: azure-secret + usagePolicy: + allowedNamespaces: + from: All + default: true + deletionPolicy: WipeOut \ No newline at end of file diff --git a/docs/guides/backends/azure/index.md b/docs/guides/backends/azure/index.md index 6a8d87d..facda72 100644 --- a/docs/guides/backends/azure/index.md +++ b/docs/guides/backends/azure/index.md @@ -24,16 +24,13 @@ To configure storage secret for this backend, following secret keys are needed: | Key | Type | Description | | -------------------- | ---------- | ---------------------------------------------------------- | -| `AZURE_ACCOUNT_NAME` | `Required` | Azure Storage account name | | `AZURE_ACCOUNT_KEY` | `Required` | Azure Storage account key | Create storage secret as below, ```bash -$ echo -n '' > AZURE_ACCOUNT_NAME $ echo -n '' > AZURE_ACCOUNT_KEY $ kubectl create secret generic -n demo azure-secret \ - --from-file=./AZURE_ACCOUNT_NAME \ --from-file=./AZURE_ACCOUNT_KEY secret/azure-secret created ``` @@ -46,38 +43,46 @@ 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.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 `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 + secret: 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-storaqge 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 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). diff --git a/docs/guides/backends/b2/examples/b2.yaml b/docs/guides/backends/b2/examples/b2.yaml deleted file mode 100644 index e03411c..0000000 --- a/docs/guides/backends/b2/examples/b2.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: stash.appscode.com/v1alpha1 -kind: Repository -metadata: - name: b2-repo - namespace: demo -spec: - backend: - b2: - bucket: stash-backup - prefix: /demo/deployment/my-deploy - storageSecretName: b2-secret diff --git a/docs/guides/backends/b2/index.md b/docs/guides/backends/b2/index.md deleted file mode 100644 index cbb021f..0000000 --- a/docs/guides/backends/b2/index.md +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: Backblaze B2 Backend | Stash -description: Configure Stash to use Backblaze B2 as Backend. -menu: - docs_{{ .version }}: - identifier: backend-b2 - name: Backblaze B2 - parent: backend - weight: 70 -product_name: kubestash -menu_name: docs_{{ .version }} -section_menu_id: guides ---- - -# Backblaze B2 - -Stash supports Backblaze's [B2 Cloud Storage](https://www.backblaze.com/b2/cloud-storage.html) as a backend. This tutorial will show you how to use this backend. - -In order to use Backblaze B2 Cloud Storage as backend, you have to create a `Secret` and a `Repository` object pointing to the desired B2 bucket. - ->If the bucket does not exist yet and the credentials you have provided have the privilege to create bucket, it will be created automatically during the first backup. In this case, you have to make sure that the bucket name is unique across all B2 buckets. - -#### 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. | -| `B2_ACCOUNT_ID` | `Required` | Backblaze B2 account id. | -| `B2_ACCOUNT_KEY` | `Required` | Backblaze B2 account key. | - -Create storage secret as below, - -```bash -$ echo -n 'changeit' > RESTIC_PASSWORD -$ echo -n '' > B2_ACCOUNT_ID -$ echo -n '' > B2_ACCOUNT_KEY -$ kubectl create secret generic -n demo b2-secret \ - --from-file=./RESTIC_PASSWORD \ - --from-file=./B2_ACCOUNT_ID \ - --from-file=./B2_ACCOUNT_KEY -secret/b2-secret created -``` - -### Create Repository - -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. - -Following parameters are available for `b2` backend, - -| Parameter | Type | Description | -| ------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------- | -| `b2.bucket` | `Required` | Name of the B2 bucket. | -| `b2.prefix` | `Optional` | Path prefix inside the bucket where the backed up data will be stored. | -| `b2.maxConnections` | `Optional` | Maximum number of parallel connections to use for uploading backup data. By default, Stash will use maximum 5 parallel connections. | - -Below, the YAML of a sample `Repository` crd that uses a B2 bucket as a backend. - -```yaml -apiVersion: stash.appscode.com/v1alpha1 -kind: Repository -metadata: - name: b2-repo - namespace: demo -spec: - backend: - b2: - bucket: stash-backup - prefix: /demo/deployment/my-deploy - storageSecretName: b2-secret -``` - -Create the `Repository` we have shown above using the following command, - -```bash -$ kubectl apply -f https://github.com/kubestash/docs/raw/{{< param "info.version" >}}/docs/guides/backends/b2/examples/b2.yaml -repository/b2-repo created -``` - -Now, we are ready to use this backend to backup our desired data using Stash. - -## 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). diff --git a/docs/guides/backends/gcs/examples/gcs.yaml b/docs/guides/backends/gcs/examples/gcs.yaml index 8dadcee..330ff64 100644 --- a/docs/guides/backends/gcs/examples/gcs.yaml +++ b/docs/guides/backends/gcs/examples/gcs.yaml @@ -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 + secret: s3-secret + usagePolicy: + allowedNamespaces: + from: All + default: true + deletionPolicy: WipeOut \ No newline at end of file diff --git a/docs/guides/backends/gcs/index.md b/docs/guides/backends/gcs/index.md index 8c2ccdc..15ea67b 100644 --- a/docs/guides/backends/gcs/index.md +++ b/docs/guides/backends/gcs/index.md @@ -1,6 +1,6 @@ --- -title: GCS Backend | Stash -description: Configure Stash to use Google Cloud Storage (GCS) as Backend. +title: GCS Backend | KubeStash +description: Configure KubeStash to use Google Cloud Storage (GCS) as Backend. menu: docs_{{ .version }}: identifier: backend-gcs @@ -14,11 +14,11 @@ section_menu_id: guides # Google Cloud Storage (GCS) -Stash supports [Google Cloud Storage(GCS)](https://cloud.google.com/storage/) as a backend. This tutorial will show you how to use this backend. +KubeStash supports [Google Cloud Storage(GCS)](https://cloud.google.com/storage/) as a backend. This tutorial will show you how to use this backend. -In order to use Google Cloud Storage as backend, you have to create a `Secret` and a `Repository` object pointing to the desired GCS bucket. +In order to use Google Cloud Storage as backend, you have to create a `Secret` and a `BackupStorage` object pointing to the desired GCS bucket. -> If the bucket already exists, the Google Cloud service account you provide to Stash only needs `Storage Object Creator` role permission. However, if the bucket does not exist, Stash will create the bucket during the first backup. In this case, the Google Cloud service account key used for Stash must have `Storage Object Admin` role permission. To avoid giving this elevated level of permission to Stash, create the bucket manually (either from GCP console or gcloud cli) ahead of time. +> If the bucket already exists, the Google Cloud service account you provide to KubeStash only needs `Storage Object Creator` role permission. However, if the bucket does not exist, KubeStash will create the bucket during the first backup. In this case, the Google Cloud service account key used for KubeStash must have `Storage Object Admin` role permission. To avoid giving this elevated level of permission to KubeStash, create the bucket manually (either from GCP console or gcloud cli) ahead of time. #### Create Storage Secret @@ -26,62 +26,66 @@ 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. | | `GOOGLE_PROJECT_ID` | `Required` | Google Cloud project ID. | | `GOOGLE_SERVICE_ACCOUNT_JSON_KEY` | `Required` | Google Cloud service account json key. | Create storage secret as below, ```bash -$ echo -n 'changeit' > RESTIC_PASSWORD $ echo -n '' > GOOGLE_PROJECT_ID $ mv downloaded-sa-json.key GOOGLE_SERVICE_ACCOUNT_JSON_KEY $ kubectl create secret generic -n demo gcs-secret \ - --from-file=./RESTIC_PASSWORD \ --from-file=./GOOGLE_PROJECT_ID \ --from-file=./GOOGLE_SERVICE_ACCOUNT_JSON_KEY secret/gcs-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.backend.storageSecretName` field. Following parameters are available for `gcs` backend. -| 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 Stash to create a new bucket in a different location, so you need to create it using Google cloud console. | -| `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, Stash will use maximum 5 parallel connections. | +| 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.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. | -Below, the YAML of a sample `Repository` crd that uses a GCS bucket as a backend. +Below, the YAML of a sample `BackupStorage` crd that uses a GCS bucket as a backend. ```yaml -apiVersion: stash.appscode.com/v1alpha1 -kind: Repository +apiVersion: storage.kubestash.com/v1alpha1 +kind: BackupStorage metadata: - name: gcs-repo + name: gcs-storage namespace: demo spec: - backend: + storage: + provider: gcs gcs: - bucket: stash-backup - prefix: /demo/deployment/my-deploy - storageSecretName: gcs-secret + bucket: kubestash-demo + prefix: demo + secret: gcs-secret + usagePolicy: + allowedNamespaces: + from: All + default: true # Use this BackupStorage as the default + deletionPolicy: WipeOut # One of: WipeOut, Delete ``` -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/gcs/examples/gcs.yaml -repository/gcs-repo created +backupstorage.storage.kubestash.com/gcs-storaqge 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 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). diff --git a/docs/guides/backends/local/index.md b/docs/guides/backends/local/index.md index f2d84e0..4b7b073 100644 --- a/docs/guides/backends/local/index.md +++ b/docs/guides/backends/local/index.md @@ -36,7 +36,7 @@ that you must give file system group permission, achieved by specifying `spec.se Here, we are going to show some sample `BackupStorage` objects that uses different Kubernetes volume as a backend. -##### HostPath volume as Backend +### HostPath volume as Backend Below, the YAML of a sample `BackupStorage` object that uses a `hostPath` volume as a backend. @@ -75,7 +75,7 @@ backupstorage.storage.kubestash.com/local-storage-with-hostpath created So, in order to use `hostPath` volume as a backend, you must either run initializer job as the `root` user, achieved by specifying `spec.securityContext.pod.runAsUser` in the BackupStorage configuration, or adjust the permissions of the `hostPath` to allow write access for `non-root` users. -##### PersistentVolumeClaim as Backend +### PersistentVolumeClaim as Backend Below, the YAML of a sample `BackupStorage` crd that uses a `PersistentVolumeClaim` as a backend. @@ -110,7 +110,7 @@ $ kubectl apply -f https://github.com/kubestash/docs/raw/{{< param "info.version backupstorage.storage.kubestash.com/local-storage-with-pvc created ``` -##### NFS volume as Backend +### NFS volume as Backend Below, the YAML of a sample `BackupStorage` crd that uses an `NFS` volume as a backend. diff --git a/docs/guides/backends/overview/images/backend_overview.svg b/docs/guides/backends/overview/images/backend_overview.svg deleted file mode 100644 index 7106b39..0000000 --- a/docs/guides/backends/overview/images/backend_overview.svg +++ /dev/null @@ -1,527 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/guides/backends/overview/images/gcs_repository.png b/docs/guides/backends/overview/images/gcs_repository.png new file mode 100644 index 0000000..d39a904 Binary files /dev/null and b/docs/guides/backends/overview/images/gcs_repository.png differ diff --git a/docs/guides/backends/overview/images/kubestash_backend_overview.svg b/docs/guides/backends/overview/images/kubestash_backend_overview.svg new file mode 100644 index 0000000..51501d5 --- /dev/null +++ b/docs/guides/backends/overview/images/kubestash_backend_overview.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/guides/backends/overview/images/s3_repository.png b/docs/guides/backends/overview/images/s3_repository.png deleted file mode 100644 index 47cdab9..0000000 Binary files a/docs/guides/backends/overview/images/s3_repository.png and /dev/null differ diff --git a/docs/guides/backends/overview/index.md b/docs/guides/backends/overview/index.md index 812cc9b..e4b8dcc 100644 --- a/docs/guides/backends/overview/index.md +++ b/docs/guides/backends/overview/index.md @@ -23,7 +23,7 @@ KubeStash supports various backends for use as a BackupStorage. It can be a clou The following diagram shows how kubestash backup container accesses and backs up data into a backend.
- KubeStash Backend Overview + KubeStash Backend Overview
Fig: KubeStash Backend Overview
@@ -45,7 +45,13 @@ Here, `kubestash-qa` serves as the bucket name, and the presence of `metadata.ya 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. -Below, a screenshot the shows a `Repository` with backup data under a `BackupStorage` named `demo`: +Below, a screenshot the shows a `Repository` named `mongodb-backup` with backup data under a `BackupStorage` named `demo`: + +
+  Repository with backup data under a `demo` BackupStorage +
Fig: Repository with backup data under a BackupStorage
+
+ ## Next Steps - Learn how to configure `Kubernetes Volume` as backend from [here](). diff --git a/docs/guides/backends/rest/examples/rest.yaml b/docs/guides/backends/rest/examples/rest.yaml deleted file mode 100644 index de74aae..0000000 --- a/docs/guides/backends/rest/examples/rest.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: stash.appscode.com/v1alpha1 -kind: Repository -metadata: - name: rest-repo - namespace: demo -spec: - backend: - rest: - url: http://rest-server.demo.svc:8000/stash-backup-demo - storageSecretName: rest-secret diff --git a/docs/guides/backends/rest/index.md b/docs/guides/backends/rest/index.md deleted file mode 100644 index 9d92887..0000000 --- a/docs/guides/backends/rest/index.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -title: REST Backend | Stash -description: Configure Stash to REST Server as Backend. -menu: - docs_{{ .version }}: - identifier: backend-rest - name: REST Server - parent: backend - weight: 80 -product_name: kubestash -menu_name: docs_{{ .version }} -section_menu_id: guides ---- - -# REST Backend - -Stash supports restic's [REST Server](https://github.com/restic/rest-server) as a backend. This tutorial will show you how to use this backend. - -In order to use REST Server as backend, you have to create a `Secret` and a `Repository` object pointing to the desired REST Server address. - -#### 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. | -| `REST_SERVER_USERNAME` | `Optional` | Username for basic authentication in the REST server. | -| `REST_SERVER_PASSWORD` | `Optional` | Password for basic authentication in the REST Server | -| `CA_CERT_DATA` | `optional` | CA certificate used by storage backend. This can be used to pass the root certificate that has been used to sign the server certificate of a TLS secured REST Server. | - -Create storage secret as below, - -```bash -$ echo -n 'changeit' > RESTIC_PASSWORD -$ echo -n '' > REST_SERVER_USERNAME -$ echo -n '' > REST_SERVER_PASSWORD -$ kubectl create secret generic -n demo rest-secret \ - --from-file=./RESTIC_PASSWORD \ - --from-file=./REST_SERVER_USERNAME \ - --from-file=./REST_SERVER_PASSWORD -secret/rest-secret created -``` - -### Create Repository - -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. - -Following parameters are available for `rest` backend, - -| Parameter | Type | Description | -| ---------- | ---------- | ------------------------------------------------------------------------------------------------------------- | -| `rest.url` | `Required` | URL of the REST Server along with an optional path inside the server where backed up snapshot will be stored. | - -Below, the YAML of a sample `Repository` crd that uses a REST Server as a backend. - -```yaml -apiVersion: stash.appscode.com/v1alpha1 -kind: Repository -metadata: - name: rest-repo - namespace: demo -spec: - backend: - rest: - url: http://rest-server.demo.svc:8000/stash-backup-demo - storageSecretName: rest-secret -``` - -Create the `Repository` we have shown above using the following command, - -```bash -$ kubectl apply -f https://github.com/kubestash/docs/raw/{{< param "info.version" >}}/docs/guides/backends/rest/examples/rest.yaml -repository/rest-repo created -``` - -Now, we are ready to use this backend to backup our desired data using Stash. - -## 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). diff --git a/docs/guides/backends/s3/examples/minio.yaml b/docs/guides/backends/s3/examples/minio.yaml index b8ccb26..b89ae75 100644 --- a/docs/guides/backends/s3/examples/minio.yaml +++ b/docs/guides/backends/s3/examples/minio.yaml @@ -1,12 +1,18 @@ -apiVersion: stash.appscode.com/v1alpha1 -kind: Repository +apiVersion: storage.kubestash.com/v1alpha1 +kind: BackupStorage metadata: - name: minio-repo + name: minio-storage namespace: demo spec: - backend: + storage: + provider: s3 s3: endpoint: https://my-minio-service.minio-namespace.svc - bucket: stash-demo - prefix: /backup/demo/deployment/stash-demo - storageSecretName: minio-secret + bucket: kubestash-demo + prefix: /backup/demo/deployment/kubestash-demo + secret: minio-secret + usagePolicy: + allowedNamespaces: + from: All + default: true + deletionPolicy: WipeOut \ No newline at end of file diff --git a/docs/guides/backends/s3/examples/s3.yaml b/docs/guides/backends/s3/examples/s3.yaml index ec4559c..330ff64 100644 --- a/docs/guides/backends/s3/examples/s3.yaml +++ b/docs/guides/backends/s3/examples/s3.yaml @@ -1,13 +1,19 @@ -apiVersion: stash.appscode.com/v1alpha1 -kind: Repository +apiVersion: storage.kubestash.com/v1alpha1 +kind: BackupStorage metadata: - name: s3-repo + name: s3-storage namespace: demo spec: - backend: + storage: + provider: s3 s3: endpoint: s3.amazonaws.com # use server URL for s3 compatible other storage service - bucket: stash-demo + bucket: kubestash-demo region: us-west-1 - prefix: /backup/demo/deployment/stash-demo - storageSecretName: s3-secret + prefix: /backup/demo/deployment/kubestash-demo + secret: s3-secret + usagePolicy: + allowedNamespaces: + from: All + default: true + deletionPolicy: WipeOut \ No newline at end of file diff --git a/docs/guides/backends/s3/index.md b/docs/guides/backends/s3/index.md index 79472bd..476e7c7 100644 --- a/docs/guides/backends/s3/index.md +++ b/docs/guides/backends/s3/index.md @@ -18,7 +18,7 @@ KubeStash supports AWS S3 or S3 compatible storage services like [Minio](https:/ In order to use S3 or S3 compatible storage service as backend, you have to create a `Secret` and a `BackupStorage` object pointing to the desired bucket. ->If the bucket does not exist yet, KubeStash will create it automatically in the default region (`us-east-1`) during the first backup. In this case, you have to make sure that the bucket name is unique across all S3 buckets. Currently, it is not possible for KubeStash to create bucket in different region. You have to create the bucket in your desired region before using it in Stash. +>If the bucket does not exist yet, KubeStash will create it automatically in the default region (`us-east-1`) during the first backup. In this case, you have to make sure that the bucket name is unique across all S3 buckets. Currently, it is not possible for KubeStash to create bucket in different region. You have to create the bucket in your desired region before using it in KubeStash. #### Create Storage Secret @@ -65,8 +65,8 @@ 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 Stash 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.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.region` | `Optional` | Specify the region of your bucket. | | `s3.prefix` | `Optional` | Path prefix inside the bucket where the backed up data will be stored. | diff --git a/docs/guides/backends/swift/examples/swift.yaml b/docs/guides/backends/swift/examples/swift.yaml deleted file mode 100644 index 9a817f3..0000000 --- a/docs/guides/backends/swift/examples/swift.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: stash.appscode.com/v1alpha1 -kind: Repository -metadata: - name: swift-repo - namespace: demo -spec: - backend: - swift: - container: stash-backup - prefix: /demo/deployment/my-deploy - storageSecretName: swift-secret diff --git a/docs/guides/backends/swift/index.md b/docs/guides/backends/swift/index.md deleted file mode 100644 index ce490f4..0000000 --- a/docs/guides/backends/swift/index.md +++ /dev/null @@ -1,158 +0,0 @@ ---- -title: Swift Backend | Stash -description: Configure Stash to use OpenStack Swift as Backend. -menu: - docs_{{ .version }}: - identifier: backend-swift - name: OpenStack Swift - parent: backend - weight: 60 -product_name: kubestash -menu_name: docs_{{ .version }} -section_menu_id: guides ---- - -# OpenStack Swift - -Stash supports [OpenStack Swift](https://docs.openstack.org/swift/latest/) as a backend. This tutorial will show you how to use this backend. - -In order to use OpenStack Swift as backend, you have to create a `Secret` and a `Repository` object pointing to the desired Swift container. - ->If the Swift container does not exist yet, Stash will automatically create it during the first backup. - -#### Create Storage Secret - -Stash supports Swift's Keystone v1, v2, v3 authentication as well as token-based authentication. - -**Keystone v1 authentication:** - -For keystone v1 authentication, following secret keys are needed: - -| Key | Description | -|--------------------------|------------------------------------------------------------| -| `RESTIC_PASSWORD` | Password used that will be used to encrypt the backup snapshots.| -| `ST_AUTH` | URL of the Keystone server. | -| `ST_USER` | Username. | -| `ST_KEY` | Password. | - -**Keystone v2 authentication:** - -For keystone v2 authentication, following secret keys are needed: - -| Key | Description | -|--------------------------|------------------------------------------------------------| -| `RESTIC_PASSWORD` | Password used that will be used to encrypt the backup snapshots.| -| `OS_AUTH_URL` | URL of the Keystone server. | -| `OS_REGION_NAME` | Storage region name | -| `OS_USERNAME` | Username | -| `OS_PASSWORD` | Password | -| `OS_TENANT_ID` | Tenant ID | -| `OS_TENANT_NAME` | Tenant Name | - -**Keystone v3 authentication:** - -For keystone v3 authentication, following secret keys are needed: - -| Key | Description | -|--------------------------|------------------------------------------------------------| -| `RESTIC_PASSWORD` | Password used that will be used to encrypt the backup snapshots.| -| `OS_AUTH_URL` | URL of the Keystone server. | -| `OS_REGION_NAME` | Storage region name | -| `OS_USERNAME` | Username | -| `OS_PASSWORD` | Password | -| `OS_USER_DOMAIN_NAME` | User domain name | -| `OS_PROJECT_NAME` | Project name | -| `OS_PROJECT_DOMAIN_NAME` | Project domain name | - -For keystone v3 application credential authentication (application credential id): - -| Key | Description | -|--------------------------|------------------------------------------------------------| -| `RESTIC_PASSWORD` | Password used that will be used to encrypt the backup snapshots.| -| `OS_AUTH_URL` | URL of the Keystone server. | -| `OS_APPLICATION_CREDENTIAL_ID` | The ID of the application credential used for authentication. If not provided, the application credential must be identified by its name and its owning user.| -| `OS_APPLICATION_CREDENTIAL_SECRET` | The secret for authenticating the application credential. | - -For keystone v3 application credential authentication (application credential name): - -| Key | Description | -|--------------------------|------------------------------------------------------------| -| `RESTIC_PASSWORD` | Password used that will be used to encrypt the backup snapshots.| -| `OS_AUTH_URL` | URL of the Keystone server. | -| `OS_USERNAME` | User name| -| `OS_USER_DOMAIN_NAME` | User domain name| -| `OS_APPLICATION_CREDENTIAL_NAME` | The name of the application credential used for authentication. If provided, must be accompanied by a user object. | -| `OS_APPLICATION_CREDENTIAL_SECRET` | The secret for authenticating the application credential. | - -**Token-based authentication:** - -For token-based authentication, following secret keys are needed: - -| Key | Description | -|--------------------------|------------------------------------------------------------| -| `RESTIC_PASSWORD` | Password used that will be used to encrypt the backup snapshots.| -| `OS_STORAGE_URL` | Storage URL | -| `OS_AUTH_TOKEN` | Authentication token | - -A sample storage secret creation for keystone v2 authentication is shown below, - -```bash -$ echo -n 'changeit' > RESTIC_PASSWORD -$ echo -n '' > OS_AUTH_URL -$ echo -n '' > OS_TENANT_ID -$ echo -n '' > OS_TENANT_NAME -$ echo -n '' > OS_USERNAME -$ echo -n '' > OS_PASSWORD -$ echo -n '' > OS_REGION_NAME -$ kubectl create secret generic swift-secret \ - --from-file=./RESTIC_PASSWORD \ - --from-file=./OS_AUTH_URL \ - --from-file=./OS_TENANT_ID \ - --from-file=./OS_TENANT_NAME \ - --from-file=./OS_USERNAME \ - --from-file=./OS_PASSWORD \ - --from-file=./OS_REGION_NAME -secret/swift-secret created -``` - -### Create Repository - -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. - -Following parameters are available for `Swift` backend. - -| Parameter | Description | -| ----------------- | ------------------------------------------------------------------------------ | -| `swift.container` | `Required`. Name of Storage container | -| `swift.prefix` | `Optional`. Path prefix inside the container where backed up data will be stored. | - -Below, the YAML of a sample `Repository` crd that uses a Swift container as a backend. - -```yaml -apiVersion: stash.appscode.com/v1alpha1 -kind: Repository -metadata: - name: swift-repo - namespace: demo -spec: - backend: - swift: - container: stash-backup - prefix: /demo/deployment/my-deploy - storageSecretName: swift-secret -``` - -Create the `Repository` we have shown above using the following command, - -```bash -$ kubectl apply -f https://github.com/kubestash/docs/raw/{{< param "info.version" >}}/docs/guides/backends/swift/examples/swift.yaml -repository/swift-repo created -``` - -Now, we are ready to use this backend to backup our desired data using Stash. - -## 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).