diff --git a/deploy/chart/local-path-provisioner/README.md b/deploy/chart/local-path-provisioner/README.md index e785246f6..e06342620 100644 --- a/deploy/chart/local-path-provisioner/README.md +++ b/deploy/chart/local-path-provisioner/README.md @@ -65,6 +65,7 @@ default values. | `storageClass.defaultVolumeType` | The default volume type this storage class creates | `hostPath` | | `storageClass.name` | The name to assign the created StorageClass | local-path | | `storageClass.reclaimPolicy` | ReclaimPolicy field of the class | Delete | +| `storageClass.pathPattern` | Template for the volume directory name | `nil` | | `nodePathMap` | Configuration of where to store the data on each node | `[{node: DEFAULT_PATH_FOR_NON_LISTED_NODES, paths: [/opt/local-path-provisioner]}]` | | `resources` | Local Path Provisioner resource requests & limits | `{}` | | `rbac.create` | If true, create & use RBAC resources | `true` | diff --git a/deploy/chart/local-path-provisioner/templates/storageclass.yaml b/deploy/chart/local-path-provisioner/templates/storageclass.yaml index 6a41ce15e..0bddf7b0f 100644 --- a/deploy/chart/local-path-provisioner/templates/storageclass.yaml +++ b/deploy/chart/local-path-provisioner/templates/storageclass.yaml @@ -20,6 +20,10 @@ provisioner: {{ template "local-path-provisioner.provisionerName" $dot }} volumeBindingMode: {{ $values.storageClass.volumeBindingMode }} reclaimPolicy: {{ $values.storageClass.reclaimPolicy }} allowVolumeExpansion: true +{{- if .Values.storageClass.pathPattern }} +parameters: + pathPattern: {{ .Values.storageClass.pathPattern | quote }} +{{ end -}} {{- end }} --- {{- end }} diff --git a/deploy/chart/local-path-provisioner/values.yaml b/deploy/chart/local-path-provisioner/values.yaml index b3a6c549c..a2d4a4805 100644 --- a/deploy/chart/local-path-provisioner/values.yaml +++ b/deploy/chart/local-path-provisioner/values.yaml @@ -48,6 +48,9 @@ storageClass: ## volumeBindingMode field controls when volume binding and dynamic provisioning should occur, can be "Immediate" or "WaitForFirstConsumer" volumeBindingMode: WaitForFirstConsumer + ## Set a path pattern, if unset the default will be used + # pathPattern: "{{ .PVC.Namespace }}-{{ .PVC.Name }}" + # nodePathMap is the place user can customize where to store the data on each node. # 1. If one node is not listed on the nodePathMap, and Kubernetes wants to create volume on it, the paths specified in # DEFAULT_PATH_FOR_NON_LISTED_NODES will be used for provisioning.