The following will describe how to install and configure the DigitalOcean blockstore plugin for Ark and provide a usage example.
- Kubernetes cluster
- DigitalOcean account and resources
- API personal access token
- Spaces access keys
- Spaces bucket
- Spaces bucket region
- Heptio Ark prerequisites
-
Complete the Heptio Ark prerequisites mentioned above. This generally involves apply the
00-prereqs.yaml
available in the Ark repository:kubectl apply -f 00-prereqs.yaml
-
Update the
examples/credentials-ark
with your Spaces access and secret keys. The file will look like the following:[default] aws_access_key_id=<AWS_ACCESS_KEY_ID> aws_secret_access_key=<AWS_SECRET_ACCESS_KEY>
-
Create a Kubernetes
cloud-credentials
secret containing thecredentials-ark
and DigitalOcean API token.kubectl create secret generic cloud-credentials \ --namespace heptio-ark \ --from-file cloud=credentials-ark \ --from-literal digitalocean_token=<DIGITALOCEAN_TOKEN>
-
Update the
example/10-ark-config.yaml
with the Spaces API URL, bucket, and region and apply the configuration:kubectl apply -f 10-ark-config.yaml
-
Now apply the Ark deployment.
kubectl apply -f 20-deployment.yaml
-
Finally add the
ark-blockstore-digitalocean
plugin to Ark.ark plugin add quay.io/stackpoint/ark-blockstore-digitalocean:latest
-
Apply the Nginx
example/nginx-pv.yml
config that uses persistent storage for the log path.kubectl apply -f nginx-pv.yml
-
Once Nginx deployment is running and available, create a backup using Ark.
ark backup create nginx-backup --selector app=nginx ark backup describe nginx-backup
-
The config files should appear in the Spaces bucket and a snapshot taken of the persistent volume. Now you can simulate a disaster by deleting the
nginx-example
namespace.kubectl delete namespace nginx-example
-
The
nginx-data
backup can now be restored.ark restore create --from-backup nginx-data
make container IMAGE=quay.io/stackpoint/ark-blockstore-digitalocean