Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volume provisioning with multiple storage backends #417

Open
lechugaletal opened this issue Sep 25, 2024 · 1 comment
Open

Volume provisioning with multiple storage backends #417

lechugaletal opened this issue Sep 25, 2024 · 1 comment

Comments

@lechugaletal
Copy link

I'm trying to find if there is a way to provision PVs from multiple storage backends given a StatefulSet that has a single StorageClass defined in its volumeClaimTemplates section.

Given a StatefulSet with a spec of spec.volumeClaimTemplates.storageClassName: test-sc (pointing to a single StorageClass), and a storageClass with an hypothetical spec like:

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: test-sc
parameters:
  backends:
    - accessProtocol: fc1
      csi.storage.k8s.io/controller-expand-secret-name: hpe-backend1
      csi.storage.k8s.io/controller-expand-secret-namespace: hpe-storage
      csi.storage.k8s.io/fstype: ext4
    - accessProtocol: fc2
      csi.storage.k8s.io/controller-expand-secret-name: hpe-backend2
      csi.storage.k8s.io/controller-expand-secret-namespace: hpe-storage
      csi.storage.k8s.io/fstype: ext4
      imageFeatures: layering
      pool: rbd
provisioner: csi.hpe.com
reclaimPolicy: Retain
volumeBindingMode: WaitForFirstConsumer
allowedTopologies:
- matchLabelExpressions:
  - key: csi.hpe.com/zone
    values:
    - fc1
    - fc2

Could it be possible to provision PVs from one backend or another depending on the zone or region in which the pod is scheduled?

Thank you very much for your help!

@datamattsson
Copy link
Collaborator

Hey! Thanks for reaching out. What you're trying to do can not be automatically performed unfortunately. It requires the CSI Topology feature to be enhanced further in the driver. We're not sure how such implementation would look but we would most likely add topology information to the backend Secret and allow multiple backends in one Secret.

However, since StatefulSet PVC names are predictable, you can have two StorageClasses (topology-fc1 and topology-fc2) and manually create the PVCs before creating the StatefulSet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants