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.
About this task
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.Procedure
-
Download the
hcl-devopsplan-prodibm-devopsplan-prodchart from thedevops-planrepository and unpack it in a local directory:helm pull devops-plan/hcl-devopsplan-prod --untarhelm pull ibm-helm/ibm-devopsplan-prod --untar -
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}helm install backup ./ibm-devopsplan-prod \ -f ibm-devopsplan-prod/backup-openshift.yaml \ --namespace backup --create-namespace \ --set global.imagePullSecrets={ibm-entitlement-key} \ --timeout 10mNote: 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. -
Install the Velero client:
chmod +x hcl-devopsplan-prod/files/backup.sh && hcl-devopsplan-prod/files/backup.sh backup
-
Verify the installation:
The
BackupStorageLocationis ready to use when it showsAvailable. You can check the status with the following command:velero backup-location get -n backupRun 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.