You are looking at the documentation of a prior release. To read the documentation of the latest release, please
visit here.
Microsoft Azure Storage
KubeStash supports Microsoft’s Azure Blob Storage 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 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 |
---|---|---|
AZURE_ACCOUNT_KEY | Required | Azure Storage account key |
Create storage secret as below,
$ echo -n '<your-azure-storage-account-key>' > AZURE_ACCOUNT_KEY
$ kubectl create secret generic -n demo azure-secret \
--from-file=./AZURE_ACCOUNT_KEY
secret/azure-secret created
Create BackupStorage
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.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 BackupStorage
crd that uses an Azure Blob container as a backend.
apiVersion: storage.kubestash.com/v1alpha1
kind: BackupStorage
metadata:
name: azure-storage
namespace: demo
spec:
storage:
provider: azure
azure:
storageAccount: kubestash
container: kubestash-demo
prefix: /backup/demo/deployment/kubestash-demo
secretName: azure-secret
usagePolicy:
allowedNamespaces:
from: All
default: true
deletionPolicy: WipeOut
Create the BackupStorage
we have shown above using the following command,
$ kubectl apply -f https://github.com/kubestash/docs/raw/v2024.8.14/docs/guides/backends/azure/examples/azure.yaml
backupstorage.storage.kubestash.com/azure-storage created
Now, we are ready to use this backend to backup our desired data using KubeStash.