You can use Velero with CSI snapshot to backup and restore CSI-created persistent volumes for workloads running on TKG clusters provisioned on Supervisor.

Requirements

Adhere to the following requirements:
  • vSphere 8.0 U2, or later
  • Tanzu Kubernetes release v1.26.5 for vSphere 8.x, or later
  • Persistent volumes created using CSI drivers supporting volume snapshot
Attention: The use of Velero with CSI snapshot is available only for persistent volumes created using CSI drivers supporting volume snapshot. See Creating Snapshots in a TKG Cluster in Using TKG Service with vSphere IaaS Control Plane for details.

Procedure

You can use Velero with Container Storage Interface (CSI) snapshot to backup and restore workloads running on TKGS clusters. The Velero node-agent is a DaemonSet that hosts modules to complete the concrete tasks of backup and restore using CSI snapshot data movement. For more information, see Container Storage Interface Snapshot Support in Velero.
  1. Create an S3 compatible storage location, such as MinIO or an AWS S3 bucket.

    The below example uses an AWS S3 bucket.

    To use MinIO, see Install and Configure MinIO Object Store.

  2. Install the Velero CLI on the cluster client where you are running kubectl.

    Download from https://github.com/vmware-tanzu/velero/releases.

  3. Connect to the TKG Service cluster where you want to run the Velero Backup.

    See Connect to a TKG Service Cluster as a vCenter Single Sign-On User with Kubectl.

  4. Install Velero with the Velero CLI plugin on the cluster.

    As of the Velero v1.14 release, the Velero CSI plugin is merged with Velero. As such, if you are installing Velero v1.14 or later, you do not need to install the Velero CSI plugin separately. If you do, the Velero pod fails to start.

    For example, the following command installs Velero with an AWS S3 storage backend and corresponding credential file for it. Since it is Velero v1.14, you do not need to install the Velero CSI plugin separately.
    velero install \
        --provider aws \
        --plugins velero/velero-plugin-for-aws:v1.14 \
        --bucket velero-cpe-backup-bucket \
        --secret-file ./cloud-credential \
        --use-volume-snapshots=true \
        --features=EnableCSI --use-node-agent
    To install an earlier version of Velero, you must also install the Velero CSI plugin as well. For example:
    velero install \
        --provider aws \
        --plugins velero/velero-plugin-for-aws:v1.9.0,velero/velero-plugin-for-csi:v0.7.0 \
        --bucket velero-cpe-backup-bucket \
        --secret-file ./cloud-credential \
        --use-volume-snapshots=true \
        --features=EnableCSI --use-node-agent