Backing up and restoring Kubernetes Cluster and PVC using Velero and MinIO

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

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. 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 --create-namespace  \
      --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.

  3. Install the Velero client:
    chmod +x  hcl-devopsplan-prod/files/backup.sh && hcl-devopsplan-prod/files/backup.sh backup
  4. 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.