Backing up and restoring clusters with Velero

You can configure and use Velero with MinIO and AWS S3 to backup and restore your Kubernetes Clusters, including Persistent Volume Claims (PVCs). Velero manages backups while MinIO provides S3-compatible storage.

About this task

You can setup backup and restore using one of the following methods:
Velero with MinIO
Velero is deployed on Kubernetes with MinIO providing S3 compatible object storeage.
Velero with AWS S3
Velero is deployed on Kubernetes using AWS S3 as the backup storage backend. For more information, see Deploying Velero with AWS S3 bucket.
Note: Velero does not backup or restore hostPath volumes directly. If your KubernetesOpenShift setup uses hostPath volumes, you cannot use Velero's backup and restore functionality for those volumes. Delete the backup namespace as well to prevent potential MinIO repository corruption after uninstallating Velero/Minio.

To setup Velero with MinIO:

Procedure

  1. Download the hcl-devopsplan-prod chart from the devops-plan repository and unpack it in a local directory:
    helm pull devops-plan/hcl-devopsplan-prod --untar
  2. Create a namespace called backup.
    Kubectl create namespace backup
  3. Create a Docker registry secret for pulling images from HCL Harbor into the namespace backup.
    kubectl create secret docker-registry hcl-entitlement-key \
      --docker-server=hclcr.io \
      --docker-username=<Your Username> \
      --docker-password=<Your CLI Secret> \
      --namespace=backup
  4. Install the Backup and Restore into namespace backup with the release name backup.
    helm install backup ./hcl-devopsplan-prod \
      -f hcl-devopsplan-prod/values-backup.yaml \
      --namespace backup \
      --set global.imagePullSecrets={hcl-entitlement-key}
    Note: When you are setting the global.imagePullSecret, make sure to properly format it with curly brackets.
    If your Kubernetes Cluster does not have a default storage class set, you must specify the storage class when deploying:
    --set global.storageClass=[Your storage class name]

    Replace [Your storage class name] with the name of your storage class.

  5. Install the Velero client:
    chmod +x  hcl-devopsplan-prod/files/backup.sh && hcl-devopsplan-prod/files/backup.sh backup
  6. Verify the installation:

    The BackupStorageLocation is ready to use when it shows Available. You can check the status with the following command:

    velero backup-location get -n backup

    Run helm status backup -n backup to retrieve the URL, username, and password for the MinIO Object Store to check the list of the bucket of your backup.