Velero with AWS S3 - Prepare your Environment
Prerequisites
Ensure you have installed Velero (included in the default DKP installation).
Ensure you have installed the Velero CLI.
You have created an S3 bucket with AWS.
Environment variables:
Set the
BUCKET
environment variable to the name of the S3 bucket you want to use as backup storage:export BUCKET=<aws-bucket-name>
CODESet the
WORKSPACE_NAMESPACE
environment variable to the name of the workspace’s namespace. Replace<workspace_namespace>
with the name of the target workspace:export WORKSPACE_NAMESPACE=<workspace_namespace>
CODEThis can be the
kommander
namespace for the Management cluster or any other additional workspace namespace for Attached or Managed clusters. To list all available workspaces and clusters, use the dkp get clusters -A command.Set the
CLUSTER_NAME
environment variable. Replace<target_cluster>
with the name of the cluster where you want to set up Velero:export CLUSTER_NAME=<target_cluster>
CODE
Prepare your AWS Credentials
See the official docs for details on how to use IAM roles instead of static credentials.
Create a file containing your static AWS credentials:
In this example, the file’s name iscredentials-velero
.cat << EOF > aws-credentials [default] aws_access_key_id=<REDACTED> aws_secret_access_key=<REDACTED> EOF
CODECreate a secret on the cluster where you are installing and configuring Velero by referencing the file created in the previous step. This can be the Management, a Managed or an Attached cluster:
In this example, the secret’s name isvelero-aws-credentials
.kubectl create secret generic -n ${WORKSPACE_NAMESPACE} velero-aws-credentials --from-file=aws=aw
CODE