Sub topic 9
Installing Velero with a storage provider
This chapter installs Velero on a cluster and connects it to an S3 bucket. It assumes you can use kubectl, you have cluster-admin access, and you have an S3 bucket plus credentials that can read and write it. The Velero CLI must be installed on your workstation.
What the install creates
velero install does not install anything on your workstation beyond sending manifests to the cluster. It creates a velero namespace, the Velero custom resource definitions, a Deployment for the Velero server, and a Secret that holds your cloud credentials. It also creates a BackupStorageLocation resource that tells Velero which bucket to use. Because of the --use-node-agent flag, it also creates a DaemonSet called node-agent, which runs on each node and copies volume data for file system backups.
Prepare credentials
Velero reads AWS credentials from a file in the standard credentials format. Create credentials-velero with an IAM user's keys:
[default]
aws_access_key_id = <access-key-id>
aws_secret_access_key = <secret-access-key>Give that IAM user only the permissions Velero needs on the bucket, such as list, get, put and delete objects. Keep the file out of version control.
Run the install
velero install \
--provider aws \
--plugins velero/velero-plugin-for-aws:<plugin-version> \
--bucket my-velero-backups \
--backup-location-config region=us-east-1 \
--secret-file ./credentials-velero \
--use-node-agentEach flag has a specific job:
| Flag | Purpose |
|---|---|
| `--provider aws` | Selects the object store type |
| `--plugins` | Image of the provider plugin, added as an init container. Pick a version compatible with your Velero version |
| `--bucket` | Bucket that stores backup data |
| `--backup-location-config` | Provider settings, here the bucket region |
| `--secret-file` | Credentials file stored in a cluster Secret |
| `--use-node-agent` | Deploys the node agent for file system volume backups |
For an S3-compatible store such as MinIO, add s3Url=<endpoint> and s3ForcePathStyle=true to --backup-location-config.
Verify the installation
Check that the Pods are running and that Velero can reach the bucket:
kubectl -n velero get pods
velero backup-location getThe Velero Pod and one node-agent Pod per node should be Running. The location named default should show the phase Available. Velero checks the bucket periodically, so a new location can take a minute to change from Unknown.
Common errors
- Location is
Unavailable. Check the bucket name, region and credentials.kubectl -n velero logs deploy/velerousually states the AWS error. - Velero Pod crashes at start. The plugin image may be missing or incompatible with the server version.
- Node agent Pods stay
Pending. Node taints may block the DaemonSet. Add tolerations if you need it on control plane or tainted nodes. - Access denied on write. The IAM policy allows reading but not
PutObjectorDeleteObject.
Inspect the storage location
The location is a normal Kubernetes resource, so you can inspect it:
kubectl -n velero get backupstoragelocations.velero.io default -o yamlYou can later add more locations, for example a bucket in another region, and select one per backup with --storage-location.
Exercise
After running velero install, velero backup-location get shows the location as Unavailable. Name two things you would check first.
Show answer
Check the Velero Pod logs with kubectl -n velero logs deploy/velero for the exact error. Then verify that the bucket name and region match the flags, and that the credentials in the Secret have list, get, put and delete permissions on the bucket.