Velero with AWS S3 Buckets - Configure Velero
Customize Velero to allow the configuration of a non-default backup location.
Create a
ConfigMap
to enable Velero to use AWS S3 buckets as backup storage location:CODEcat <<EOF | kubectl apply -f - apiVersion: v1 kind: ConfigMap metadata: namespace: ${WORKSPACE_NAMESPACE} name: velero-overrides data: values.yaml: | configuration: backupStorageLocation: - bucket: ${BUCKET} provider: "aws" config: region: <AWS_REGION> # such as us-west-2 s3ForcePathStyle: "false" insecureSkipTLSVerify: "false" s3Url: "" # profile should be set to the AWS profile name mentioned in the secret profile: default credentials: # With the proper IAM permissions with access to the S3 bucket, # you can attach the EC2 instances using the IAM Role, OR fill in "existingSecret" OR "secretContents" below. # # Name of a pre-existing secret (if any) in the Velero namespace # that should be used to get IAM account credentials. existingSecret: velero-aws-credentials # The key must be named "cloud", and the value corresponds to the entire content of your IAM credentials file. # For more information, consult the documentation for the velero plugin for AWS at: # [AWS] https://github.com/vmware-tanzu/velero-plugin-for-aws/blob/main/README.md secretContents: # cloud: | # [default] # aws_access_key_id=<REDACTED> # aws_secret_access_key=<REDACTED> EOF
Patch the Velero
AppDeployment
to reference the createdConfigMap
with the Velero overrides:To update Velero in all clusters in a workspace:
CODEcat << EOF | kubectl -n ${WORKSPACE_NAMESPACE} patch appdeployment velero --type="merge" --patch-file=/dev/stdin spec: configOverrides: name: velero-overrides EOF
To update Velero for a specific cluster in a workspace, see Customize an Application per Cluster.
Check the
ConfigMap
on theHelmRelease
object:CODEkubectl get hr -n kommander velero -o jsonpath='{.spec.valuesFrom[?(@.name=="velero-overrides")]}'
The output looks like this if the deployment is successful:
CODE{"kind":"ConfigMap","name":"velero-overrides"}
Verify that the Velero pod is running:
CODEkubectl get pods -A --kubeconfig=${CLUSTER_NAME}.conf |grep velero
You can also configure Velero by editing the kommander.yaml
and rerunning the installation. To follow this alternative configuration path, expand the following section: