local-path-provisioner icon indicating copy to clipboard operation
local-path-provisioner copied to clipboard

How to set multiple nodepaths to one sc

Open StormstoutY opened this issue 1 year ago • 0 comments

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.

StormstoutY avatar Apr 01 '24 13:04 StormstoutY