You are looking at the documentation of a prior release. To read the documentation of the latest release, please visit here.
Stash supports restic’s 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.
To configure storage secret for this backend, following secret keys are needed:
|Password that will be used to encrypt the backup snapshots.|
|Username for basic authentication in the REST server.|
|Password for basic authentication in the REST Server|
|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,
$ echo -n 'changeit' > RESTIC_PASSWORD $ echo -n '<your-rest-server-username>' > REST_SERVER_USERNAME $ echo -n '<your-rest-server-password>' > 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
Now, you have to create a
Repository crd. You have to provide the storage secret that we have created earlier in
Following parameters are available for
|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.
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
Repository we have shown above using the following command,
$ kubectl apply -f https://github.com/stashed/docs/raw/v2023.03.20/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.