local-path-provisioner
local-path-provisioner copied to clipboard
Will local-path-provisioner separate pvc replicas across the cluster
I'm deploying a statefulset workload with 3 replicas. I see that the local-path-provisioner deploys all pvc replicas to one node. Is there a way to separate the pvc for each replica to a different node?
The scheduling of the storage is not controlled by the local path provisioner. It will waitForFirstConsumer
(a.k.a. pod creation/scheduling). So if you use anti-affinity for the pods during the first creation, the volumes should follow the pod's scheduling to the different nodes.
After first time, the PV would bound to a certain node and cannot be moved after.
Would I need to create a pvc for each replica? Trying to deploy the 3 replicas and after the first replica is deployed I get the following error.
Warning FailedScheduling
If there is only one PVC, it will only able to be on one node, since the data is stored in one node's hard drive.
Statefulset
and volumeClaimTemplates
may fit your needs
see https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/
I pointed my local-path-provisioner-Path to an glusterfs-mount, so all of my files are available on all k8s-nodes. How can I configure the local-path-provider that the error had volume node affinity conflict
does not appear?