How does longhorn use the storage nodes #8445
Replies: 1 comment
-
All things being equal (same amount of space available, no other constraints) then yes, the 8 replicas should be evenly spread across the 4 worker nodes. The location of the workload where the volume is attached can be different from the storage, unless directed by a data-locality setting. In general, Kubernetes will try to spread the workloads around in the same way that Longhorn spreads its volume replicas. If there is a desire to segregate redis pods from postgres pods, that can certainly be done with node selectors and affinities on the workload pods. However, Longhorn takes more consideration of available space when placing a replica than of the owning workload. To isolate the storage, if that's the main desire, one could use diskSelector tags and craft customized storage classes for the two applications so they avoid each other's disks. However, that would make Longhorn less flexible for where it could place replicas for rebuild after node cordoning or failure. There's a good overview of how it all works at https://longhorn.io/docs/1.6.1/concepts/ |
Beta Was this translation helpful? Give feedback.
-
Given this use case (need to deploy 1 redis service and 1 postgres service) which needs persistent storage
I have 4 nodes dedicated to loghorn storage and longhorn is configured to replicate the volumes up to 2 replicas
Now my main question is given that I'll get 2 volumes for redis and 2 volumes for postgres
So I have a total of 4 volumes and 4 nodes does that mean that every node will get some volume?
My main concern is that I do not want the volumes for redis to be on same node as the volumes for postgres
Since these services based on configuration gets scheduled on the storage nodes
Will longhorn handle this case automatically given that I have enough nodes to keep all volumes separately?
Or is better for me to use node selectors and put redis and postgres on separate storage node?
And if yes then will that mean that on that same nodes longhorn will replicate the necesare volumes? and not duplicate anyvolume for different services on same node?
Beta Was this translation helpful? Give feedback.
All reactions