Cassandra CSI backup and restore Stay organized with collections Save and categorize content based on your preferences.
You can back up and restore yourhybrid data usingCSI (Container Storage Interface) snapshots. CSI backup triggers disk snapshots taken by the underlying storage system using the provided CSI driver. CSI backup does not need a Google Cloud Storage bucket or a remote server to store backup data.
CSI backup is recommended for hybrid instances hosted in Google Cloud, AWS, or Azure.
This page describes the steps to use hybrid CSI backup and restore. For an overview of hybrid back up and restore in general, see theCassandra backup and restore overview.
Warning about deleting:Be careful which version or release of the datastore components you delete. You can see your releases with the commandhelm -nAPIGEE_NAMESPACE ls. To delete a specific release usehelm -nAPIGEE_NAMESPACE deleteRELEASE-NAME.
Backup and restore limitations
Be aware of these limitations when using CSI backup and restore:
- The CSI driver used by the configured storage class must support CSI snapshots. See thisKubernetes CSI driver list for driver information.
- Not all platforms are supported. Only Google Cloud, AWS, and Azure platforms are supported.
- OpenShift Container Platform is not supported due to volume snapshotlimitations.
- Only cloud platforms are supported. On-prem platforms are not supported.
- CSI backup data and non-CSI hybrid backup data are incompatible. Non-CSI backups cannot be used with CSI restore and CSI backups cannot be used with non-CSI restore.
- CSI driver installation and functionality is the responsibility of the CSI driver vendor.
- Users are responsible for ensuring adequate cluster resources are available for provisioning CSI snapshots.
- Users are responsible for removing old snapshot data.
Set up CSI backups
To schedule hybrid backups using CSI, perform the following steps:
- If you have not previously set up hybrid backup:
- Run the following
create-service-accountcommand to create a Google Cloud service account (SA) with the standardroles/storage.objectAdminrole. This SA role allows you to write backup data to Cloud Storage. Execute the following command in the directory appropriate for your management tool:- Helm charts:
$APIGEE_HELM_CHARTS_HOME/apigee-operator/etc/ apigeectl:HYBRID_BASE_DIRECTORY/hybrid-files/
./tools/create-service-account --env non-prod --dir ./service-accounts
This command creates a single service account named
Note: If you prefer to create all the individual service accounts for a production environment, use the following command:apigee-non-prodfor use in non-production environments and places the downloaded key file in the./service-accountsdirectory../tools/create-service-account--env prod --dir ./service-accounts
For more information about Google Cloud service accounts, seeCreating and managing service accounts.
- Helm charts:
- The
create-service-accountcommand saves a JSON file containing the service account private key. The file is saved in the same directory where the command executes. You will need the path to this file in the following steps.
- Run the following
- Open your
overrides.yamlfile. Set the follow parameters, as shown inExample overrides files.- Set the general parameters shown below in the
backupblock. If you've already set these parameters for the non-CSI hybrid back up solution, you can use the same parameters for your CSI snapshots. Seebackup properties reference table for more information about each value.For
backup:- enabled: Set to
trueto enable scheduled backups. - pullPolicy in image: Set to
Always. - schedule: Provide acron expression schedule.
- enabled: Set to
- Set these parameters for CSI-specific backup:
- Cassandra storage group values: The configured Cassandra storage class must support CSI snapshots for CSI backup and restore to work. To check if a storage class supports CSI snapshots, run the following command to get the available storage classes:
Look at the "Provisioner" output for each storage class. Provisioners using CSI usually have a ".csi." part to their name like "pd.csi.storage.gke.io". Look for the provisioner name in thisKubernetes CSI driver list. If the "Other Features" column for the provisioner contains the word "SNAPSHOT", then the storage class using the provisioner supports CSI snapshots.kubectl get sc
Add these parameters in the storage group. Both values are required.
- storageclass: A CSI snapshot-enabled storage class name.
- capacity: The capacity of the disk.
- Cloud provider type:
Once the CSI snapshot capability has been verified, modify the overrides file to use CSI backup and restore:
- cloudProvider: Set
cloudProviderinbackupandrestoretoCSI.
- cloudProvider: Set
- Cassandra storage group values: The configured Cassandra storage class must support CSI snapshots for CSI backup and restore to work. To check if a storage class supports CSI snapshots, run the following command to get the available storage classes:
- Set the general parameters shown below in the
Example backup config
This section shows the backup-related portions of an exampleoverrides.yaml file.Note: If your initial Apigee Hybrid installation was configured without the cassandra.storage section in your overrides file, you should not add the cassandra.storage section in your overrides file.Adding this section post-installation to enable backups can lead to an upgrade failure as this may be interpreted as an attempt to modify the storage class of the existing Cassandra statefulset which is not a supported operation.cassandra:hostNetwork:falsereplicaCount:3storage:storageclass:standard-rwocapacity:100Giimage:pullPolicy:Alwaysbackup:enabled:trueimage:pullPolicy:AlwayscloudProvider:"CSI"schedule:"0 * * 11 *"
Launch a manual backup
CSI backups generate automatically according to the cron schedule set in theoverrides.yaml file.
To initiate a manual CSI backup, use this command:
kubectl create job -nAPIGEE_NAMESPACE --from=cronjob/apigee-cassandra-backupBACKUP_POD_NAME
BACKUP_POD_NAME is the name of the backup pod that will be created.Verify backups
One way to verify a backup was successfully created is to check the volume snapshots on theKubernetes cluster, using this command:
kubectl get volumesnapshot -nAPIGEE_NAMESPACE
The output shows the current list of snapshots on the cluster. The CSI backup process creates a snapshot of each Cassandra disk. The number of generated snapshots should match the total number of cassandra pods in the cluster.
Restore a backup
Use this process to restore a previously generated CSI backup. For general information on restoring backups and an overview of the process, see therestore overview page.
To initiate a restore of a CSI backup, follow the instructions for thehybrid non-CSI single region restore, but use these values in therestore block in youroverrides.yaml. See thebackup properties reference table for more information about each value and theexample restore configuration for an example.
- enabled: Set to
trueto enable restore for the backup referenced with thesnapshotTimestamptimestamp. - snapshotTimestamp: Provide the timestamp of a previous CSI backup.
- pullPolicy in image: Set to
Always.
To find thesnapshotTimestamp value to restore, run this command to get the list of available snapshots:
kubectl get volumesnapshot -nAPIGEE_NAMESPACE
pvc-us-west2-b-20220803004907-47beff0e306d8861
20220803004907. Important: Terminating the Cassandra cluster is a normal part of the CSI restoration process. After terminating the cluster, the restore process creates new PVCs containing the backup data and then re-creates the Cassandra cluster using the new PVCs. Do not be concerned if you see the cluster terminating.Example restore config
This section shows the restore-related portions of an exampleoverrides.yaml file.cassandra:hostNetwork:falsereplicaCount:3storage:storageclass:standard-rwocapacity:100Giimage:pullPolicy:Alwaysrestore:enabled:truesnapshotTimestamp:"20220908222130"cloudProvider:"CSI"image:pullPolicy:Always
Migrate to CSI backup and restore
If you have not previously used hybrid backup and restore, you can follow the instructions inSet up CSI backups to create a new CSI backups without the steps in this section. These steps guide you through migrating from the non-CSI backup and restore solution to CSI backups.
- Generate a new backup using the currently configured non-CSI backup method.
- Change the backup configuration in the hybrid
overrides.yamlfile to use the CSI backup overrides as shown in theexample backup config. - Apply the changes in the
overrides.yamlfile: Note: If you see an error sayinghelm upgrade datastore apigee-datastore/ \ --namespaceAPIGEE_NAMESPACE \ --atomic \ -fOVERRIDES_FILE.yaml
Error: UPGRADE FAILED: "datastore" has no deployed releases, replaceupgradewithinstalland try the command again.- Verify the backup job:
kubectl get cronjob -nAPIGEE_NAMESPACE
- After a backup job completes, verify snapshots have been created. The number of generated snapshots should be equivalent to the number of Cassandra nodes in the Hybrid instance.
kubectl get volumesnapshot -nAPIGEE_NAMESPACE
- Verify the backup job:
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-17 UTC.