local-path-provisioner
local-path-provisioner copied to clipboard
Feature/multiple storage classes
- Fixes https://github.com/rancher/local-path-provisioner/issues/38
- Fixes https://github.com/rancher/local-path-provisioner/issues/348
While is is currently possible to deploy multiple instances of the provisioner to support multiple storage classes, as well as to support both RWO, RWX, and ROX volumes at the same time, the additional resource consumption and deployment complexity are undesirable.
This patch adds an additional field to the config.json named storageClassConfigs, which is mutually exclusive with the existing nodePathMap and sharedFilesystemPath fields. This field is an object, whose keys are the names of storage classes, and its values are nested objects that contain either nodePathMap or sharedFilesystemPath. When a volume request is received, if this field is set, it is consulted for the configuration to use based on the name of the storage class, otherwise the original configuration fields are used.
This patch also updates the helm chart to add a matching option, which also deploys multiple storage class objects if selected.
This change is backwards compatible, installing this version of the provisioner should not break any existing installs.
One advantage of this change is that single-node k3s/k3d/kind clusters will be able to provide RWX and ROX storage classes out of the box.