Add Kubernetes clusters with CSI drivers
Portworx Backup supports backup and restore on Kubernetes clusters with CSI drivers if the driver meets certain prerequisites.
Add the cluster to Portworx Backup
-
From the home page, select Add Cluster:
-
In the Add Cluster page, under Select Kubernetes Platform, select Others and then enter the cluster details:
- The name of the cluster
- Retrieve the Kubeconfig from your cluster and paste it in the Kubeconfig text frame or click Browse to upload it from a file.
- Select the Others radio button from the Kubernetes Service radio group
-
Click Add Cluster.
Portworx Backup adds the Kubernetes cluster and create a default VolumeSnapshotClass on it. In some cases, this default VolumeSnapshotClass will work with no further configuration. If it doesn't, you must configure it by adding your CSI driver's parameters.
Attempt a backup on your newly added cluster from the Portworx Backup user interface. If it fails, proceed to the Add CSI driver specific parameters section.
Add CSI driver specific parameters
If you have added the cluster to Portworx Backup and successfully performed a backup, skip this section. If you attempted a backup unsuccessfully, you must add some parameters to the VolumeSnapshotClass
to allow Portworx Backup to perform backups and restores with your CSI driver.
See your CSI driver documentation to determine which parameters you need in your VolumeSnapshotClass. If the CSI driver you are using requires VolumeSnapshotClass
parameters to function correctly, you must create or update this object.
Perform the following steps to edit the default VolumeSnapshotClass for your CSI driver:
-
Verify that the VolumeSnapshotClass exists:
kubectl get volumesnapshotclass <snapshotclass>
-
List the CSI driver(s) for your volumes and retain the driver name for use in the next step:
kubectl get csidrivers
-
Edit the VolumeSnapshotClass object for your CSI driver by saving the driver name as an environment variable called
CSI_DRIVER_NAME
and entering thekubectl edit
command shown below:CSI_DRIVER_NAME=<csi_driver_name>
kubectl edit volumesnapshotclass stork-csi-snapshot-class-${CSI_DRIVER_NAME} -
Add the necessary parameters to this object based on the documentation for your CSI driver(s).
Portworx Backup will now use these VolumeSnapshotClass parameters when performing backups and restores. Verify that you've configured the VolumeSnapshotClass successfully by running another backup from the Portworx Backup user interface.
Portworx Backup always overrides the VolumeSnapshotClass
with a deletion policy as retain
to prevent data loss.