diff --git a/deploy/chart/local-path-provisioner/README.md b/deploy/chart/local-path-provisioner/README.md index e785246f659255e0397a34f8e39e737e7bb6135e..e063426201fb3f59c86e3b21bdf3f78ad15deed1 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 6a41ce15e0cbce49f9d420128e4384905236a6c6..0bddf7b0f6df56bb5c95fea9fea04b89da4a2013 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 259ae35dc2a91b2ed74cf5c562708489d0e8ef1b..930aa3b1777d04c6b03191169e4fcc22a214e9a7 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.