Velero requires an object storage bucket to store backups in, preferrably unique to a single Kubernetes cluster (see the FAQ for more details). Create an S3 bucket, replacing placeholders appropriately:
If you'll be using Velero to backup multiple clusters with multiple S3 buckets, it may be desirable to create a unique username per cluster rather than the default velero.
Attach policies to give velero the necessary permissions:
where the access key id and secret are the values returned from the create-access-key request.
Install and start Velero
Install Velero, including all prerequisites, into the cluster and start the deployment. This will create a namespace called velero, and place a deployment named velero in it.
Additionally, you can specify --use-restic to enable restic support, and --wait to wait for the deployment to be ready.
For more complex installation needs, use either the Helm chart, or add --dry-run -o yaml options for generating the YAML representation for the installation.
ALTERNATIVE: Setup permissions using kube2iam
Kube2iam is a Kubernetes application that allows managing AWS IAM permissions for pod via annotations rather than operating on API keys.
This path assumes you have kube2iam already running in your Kubernetes cluster. If that is not the case, please install it first, following the docs here: https://github.com/jtblin/kube2iam
It can be set up for Velero by creating a role that will have required permissions, and later by adding the permissions annotation on the velero deployment to define which role it should use internally.
Create a Trust Policy document to allow the role being used for EC2 management & assume kube2iam role:
Create the IAM role:
Attach policies to give velero the necessary permissions:
Use the --pod-annotations argument on velero install to add the following annotation: