Replies: 2 comments 2 replies
-
This is tricky, although could be possible with some clever naming. It is complicated because the Operator uses # ...
volumeClaimTemplates:
- metadata:
name: www
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: "my-storage-class"
resources:
requests:
storage: 1Gi The statefulset controller then creates the PVCs and mount thems to each Pod. It is challenging to define each PVC for each Pod "manually" because the statefulset uses a Pod template; this has the implications that all Pods will be "replicas" of each other, just with a different Pod name, volumes and volume mounts will be identical. The How do you run on pre-provisioned storage? You can create your PVCs with the names that the StatefulSet controller will attempt to create. IIRC, it follows the pattern As an alternative to all this trickery, you could define a |
Beta Was this translation helpful? Give feedback.
-
@Zerpet thank you so much for your comments and help! and also for "confirming" that I did not miss some docs or simple things ... it's in my opinion really missing ... I've wasted many hours poking around for sth that should be a simple best practice recipe for production. anyways, thanks!
yes, this is exactly my problem. in my desperation, I even dug through the code base, and I found the lines responsible for the PVC template and I found I also recognized that what I actually want to achieve is this:
I actually do not absolutely need to precreate PVCs - my thinking was that pre-creating per-node PVCs 1:1 bound to per-node PVsm plus using those PVCs 1:1 for the Pods of the cluster would achieve above. this is true, but could also be achieved if the stateful set created from the controller would automatically choose the right PV for every new node PVC created. so I want to modify my PVs to have which means: I need to figure out the names of the PVCs that the controller will create (later). as you mention, the naming pattern for PVCs dynamically created by a StatefulSet is:
is there a docs pages listing such name patterns? since there is this name based magic like
this is even "more magic" ... maybe it chooses the right PV for a PVC .. or not. why can't I simply specify explicitly the binding of Cluster to Pods to PVCs to PVs? I don't get it. hence my plan is to try setting:
this way (I hope) a given PV can only ever be bound by the one right PVC. is that true? is it enough (for correct 1:1 between Pod, PVC and PV)?
using |
Beta Was this translation helpful? Give feedback.
-
Hi all,
I've been trying to figure out how to create a simple RabbitMQ cluster with 3 nodes using the RabbitMQ Cluster Operator with pre-existing PVCs
data-rabbitmq-0
,data-rabbitmq-1
anddata-rabbitmq-2
.Each RabbitMQ node 0, 1, 2 should only use the respective
data-rabbitmq-0
,data-rabbitmq-1
anddata-rabbitmq-2
PVC.No PVCs must be created dynamically.
How do I do that?
Is there an option to specify something like this (doesn't work, just to illustrate what I am looking for):
I've read the docs, examples, tried various things, no luck:( I'm not even sure the operator is able to or designed to do that.
How are people running multi node clusters on pre-provisioned storage, with volumes dedicated to RabbitMQ nodes (which seems crucial for high performance clustered storage on RabbitMQ)?
Any hints or help would be greatly appreciated!
Cheers,
/Tobias
Beta Was this translation helpful? Give feedback.
All reactions