add RabbitmqCluster.spec.persistence.selector
to select PV to bind
#939
-
Feature Requirement:
Backgroud:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
The cluster operator creates a PVC dynamically using the StatefulSet volume claim template field. We did not consider static provisioned PVs as an option, and it makes more sense to support mainly dynamic PV provisioning. If you still want to use the PV you created, you can override the PVC claim with the StatefulSet override feature, something like this: ---
apiVersion: rabbitmq.com/v1beta1
kind: RabbitmqCluster
metadata:
name: my-rabbitmqcluster
spec:
override:
statefulSet:
spec:
volumeClaimTemplates:
- spec:
accessModes:
- ReadWriteOnce
selector:
matchLabels:
rabbitmq: mylabel
resources:
requests:
storage: "15Gi"
metadata:
name: persistence
persistence:
storage: "15Gi" The field |
Beta Was this translation helpful? Give feedback.
-
@Zerpet What if we need to have more than one replica, will this work? |
Beta Was this translation helpful? Give feedback.
-
As long as you have sufficient PVs with the label in your selector, it should. Note that a single PV won't be claimed by two Pods, given the access mode defined, neither you should allow more than one RabbitMQ Pod access the same PV. |
Beta Was this translation helpful? Give feedback.
-
@Zerpet We already have an existing PV and tried what you have suggested, But getting below error |
Beta Was this translation helpful? Give feedback.
The cluster operator creates a PVC dynamically using the StatefulSet volume claim template field. We did not consider static provisioned PVs as an option, and it makes more sense to support mainly dynamic PV provisioning.
If you still want to use the PV you created, you can override the PVC claim with the StatefulSet override feature, something like this: