Skip to content

Commit

Permalink
deployment: Add support for the storage class path pattern to the chart
Browse files Browse the repository at this point in the history
Add the `pathPattern` parameter to the storage class values so it can
also be configured from the helm chart.

Signed-off-by: Alban Bedel <[email protected]>
  • Loading branch information
AlbanBedel authored and derekbit committed May 26, 2024
1 parent af85381 commit 056e358
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions deploy/chart/local-path-provisioner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
3 changes: 3 additions & 0 deletions deploy/chart/local-path-provisioner/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 056e358

Please sign in to comment.