Prerequisites

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>
    CODE
  • Set 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>
    CODE

    (info) 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:

    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.

  1. Create a file containing your static AWS credentials:
    In this example, the file’s name is credentials-velero.

    cat << EOF > aws-credentials
      [default]
      aws_access_key_id=<REDACTED>
      aws_secret_access_key=<REDACTED>
    EOF
    CODE
  2. 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 is velero-aws-credentials.

    kubectl create secret generic -n ${WORKSPACE_NAMESPACE} velero-aws-credentials --from-file=aws=aws-credentials --kubeconfig=${CLUSTER_NAME}.conf
    CODE

Next Step:

Velero with AWS S3 - Configure Velero