Stash for Kubernetes

Learn how to configure Stash for use with Filebase.

What is Stash?

Stash by AppsCode is a tool for backing up and restoring Kubernetes volumes and Kubernetes applications. It provides a simple and reliable way to protect your valuable data by taking regular backups and restoring them in case of any data loss or system failure. Stash can be used to backup data from various Kubernetes resources such as Deployments, StatefulSets, DaemonSets, CronJobs, and other custom resources.

Read below to learn how to use Stash with Filebase.

Prerequisites:

1. Create a new namespace

kubectl create namespace backup

2. Next, create the following environmental variables within your namespace:

echo -n 'password' > RESTIC_PASSWORD
echo -n '<FILEBASE_ACCESS_KEY>' > AWS_ACCESS_KEY_ID
echo -n '<FILEBASE_SECRET_KEY>' > AWS_SECRET_ACCESS_KEY
kubectl create secret generic -n backup filebase-secret \\
    --from-file=./RESTIC_PASSWORD \\
    --from-file=./AWS_ACCESS_KEY_ID \\
    --from-file=./AWS_SECRET_ACCESS_KEY

Replace the FILEBASE_ACCESS_KEY and FILEBASE_SECRET_KEY with your Filebase access and secret keys.

3. Create a filebase.yaml file with the following contents:

apiVersion: stash.appscode.com/v1alpha1
kind: Repository
metadata:
  name: filebase-repo
  namespace: backup
spec:
  backend:
    s3:
      endpoint: s3.filebase.com
      bucket: filebase-bucket-sample
      region: us-east-1
      prefix: /backup/
    storageSecretName: filebase-secret

4. Apply the repository with the following command:

kubectl apply -f filebase.yaml

Last updated