How to attach the same Trident created PVC to multiple k8s clusters
Applies to
- Astra Trident
- Kubernetes (k8s)
- Persistent Volumes (PV)
- Persistent Volume Claims (PVC)
Description
This process could be for ongoing Read-Write-Many (RWM) access to unstructured data that is shared across pods residing in multiple k8s clusters, or it could be for moving an application between k8s clusters in a gradual fashion, while maintaining access to the unstructured data throughout the application migration.
Requirements
- Don't use "autoExportPolicy" and "autoExportCIDRs" in the Trident backend definition. Use an "exportPolicy" in the backend definition that covers the worker nodes in both k8s clusters, and manage the NFS clients in this export policy list manually (or use a subnet level export).
- Set "reclaimPolicy: Retain" in the storage class that will have volumes shared between k8s clusters. This means you will have to manually remove k8s PVs and storage volumes when they are ready to be deleted.
- Consider using a unique "storagePrefix" in the backend, and map storage classes to it, for storage classes that will have volumes shared between k8s clusters. Consider doing the same for any backends using the same SVM that will *not* have volumes shared between k8s clusters.