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:CODEexport BUCKET=<aws-bucket-name>
Set the
WORKSPACE_NAMESPACE
environment variable to the name of the workspace’s namespace. Replace<workspace_namespace>
with the name of the target workspace:CODEexport WORKSPACE_NAMESPACE=<workspace_namespace>
This 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:CODEexport CLUSTER_NAME=<target_cluster>
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
.CODEcat << EOF > aws-credentials [default] aws_access_key_id=<REDACTED> aws_secret_access_key=<REDACTED> EOF
Create 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
.CODEkubectl create secret generic -n ${WORKSPACE_NAMESPACE} velero-aws-credentials --from-file=aws=aws-credentials --kubeconfig=${CLUSTER_NAME}.conf