rancher / local-path-provisioner

Dynamically provisioning persistent local storage with Kubernetes
Apache License 2.0
2.07k stars 439 forks source link

How to set multiple nodepaths to one sc #395

Closed StormstoutY closed 1 month ago

StormstoutY commented 3 months ago

The machine in my k8s cluster has two local ssd disks, which I mounted to /data1 and /data2 respectively. When I create storageClass, I hope that nodepath can be randomly selected from these two paths to balance a distribution of io as possible on the two disks. From the md, I see that nodePathMap is the place I can customize where to store the data on each node. So I wrote the yaml as:

apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: local-path-data3 provisioner: rancher.io/local-path parameters: nodePathMap: [ { "node": "DEFAULT_PATH_FOR_NON_LISTED_NODES", "paths": ["/data1", "/data2"] } ] volumeBindingMode: WaitForFirstConsumer reclaimPolicy: Delete

I want to know if this way of writing can take effect when creating sc, so that the nodepath of sc can be randomly selected from these two paths of each node in the cluster.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 month ago

This issue was closed because it has been stalled for 5 days with no activity.