Backup and restore
Back up and restore guide for PerfectScale self-hosted deployments
Common requirements for all providers
CSI driver
A CSI driver specific to your cloud provider must be installed in the cluster.
Snapshot controller
Install the Kubernetes external-snapshotter’s snapshot-controller
Volume snapshot CRDs
Ensure that the following CRDs are installed:
volumesnapshots.snapshot.storage.k8s.iovolumesnapshotcontents.snapshot.storage.k8s.iovolumesnapshotclasses.snapshot.storage.k8s.io
VolumeSnapshotClass
A VolumeSnapshotClass must be defined and configured for the respective CSI driver.
AWS (Amazon Web Services)
Requirements
Install the aws-ebs-csi-driver
Install the snapshot-controller
Define the following
IAM permissions
Ensure that the IAM role used by the CSI driver has permissions:
ec2:CreateSnapshotec2:DeleteSnapshotec2:DescribeSnapshotsec2:CreateTagsec2:DeleteTags
Azure (Microsoft Azure)
Requirements
Install the azure-disk-csi-driver
Enable and configure the snapshot feature
Install the snapshot-controller
Define the following
Azure Role-Based Access Control (RBAC)
Ensure that the managed identity associated with the cluster has the needed permissions:
Microsoft.Compute/snapshots/*Microsoft.Compute/disks/*Microsoft.Resources/subscriptions/resourceGroups/read
GCP (Google Cloud Platform)
Requirements
Install the gcp-compute-persistent-disk-csi-driver
Install the snapshot-controller
Enable the
compute.googleapis.comAPI in your projectDefine the following
IAM permissions
Ensure that the service account used by the node pool has:
compute.snapshots.createcompute.snapshots.deletecompute.snapshots.getcompute.disks.createSnapshotcompute.snapshots.useReadOnly
How to back up a PVC
By default, we have a CronJob psc-snapshot-pvc-job running that checks for the existence of a VolumeSnapshotClass. If one is found, it automatically creates snapshots for all PVCs with a retention period of 7 days.
To verify that snapshots are being created, you may use the following command
How to restore a PVC from a VolumeSnapshot
Use the following guide to create a new PersistentVolumeClaim (PVC) from an existing VolumeSnapshot.
Prerequisites
A valid
VolumeSnapshotalready exists.A compatible
StorageClassandVolumeSnapshotClassare installed.Your CSI driver supports volume snapshot restore (e.g., AWS EBS, Azure Disk, GCP PD).
Step 1: Identify your VolumeSnapshot
Run the following command to list available snapshots
For example, we found a snapshot for PostgreSQL with the name snapshot-data-postgres-postgresql-0-1745265598
Step 2: Create a PVC from the Snapshot
We need to create a new PVC from the existing snapshot
Ensure that the service that will use it is scaled to 0
Set the correct volume size
Set the correct Namespace
Verify that PVC was created
Step 3: Scale up or install the helm chart with Postgres to use the new PVC
How to restore ClickHouse
Scale down to 0 for ClickHouse and ClickHouse-keeper, and delete PVCs.
Run the command below to list the available snapshots:
Identify the default StorageClass.
Use the following command to create PVC from the snapshot:
Scale up clickhouse-keeper to 3 replicas, and wait for all 3 replicas to be running.
Scale ClickHouse
Once all pods are running, exec into the pod and check the status of the tables
If the last command returns some tables, run the restore replica command for every table
and check again
How to restore Minio
Scale
minio1andminio2to 0 replicas and remove their associated PVCs.
List the available snapshots by running the following command:
For example, we found snapshots for minio with names snapshot-minio1-202506040306 and snapshot-minio2-202506040306.
Identify the default StorageClass.
Create PVC from the snapshot by running the following command:
Scale
minio1andminio2to 1 replica, and wait until both are running.
Last updated
Was this helpful?