Skip to content
Snippets Groups Projects
Commit 90f92695 authored by Andrew Melnick's avatar Andrew Melnick Committed by Derek Su
Browse files

Make multipleStorageClasses a map, not a list, rename to match config.json name

parent 1f742322
No related branches found
No related tags found
No related merge requests found
......@@ -196,9 +196,11 @@ The helperPod is allowed to run on nodes experiencing disk pressure conditions,
`sharedFileSystemPath` allows the provisioner to use a filesystem that is mounted on all nodes at the same time.
In this case all access modes are supported: `ReadWriteOnce`, `ReadOnlyMany` and `ReadWriteMany` for storage claims.
`storageClassConfigs` is a map from storage class names to objects containing `nodePathMap` or `sharedFilesystemPath`, as described above.
In addition `volumeBindingMode: Immediate` can be used in StorageClass definition.
Please note that `nodePathMap` and `sharedFileSystemPath` are mutually exclusive. If `sharedFileSystemPath` is used, then `nodePathMap` must be set to `[]`.
Please note that `nodePathMap`, `sharedFileSystemPath`, and `storageClassConfigs` are mutually exclusive. If `sharedFileSystemPath` or `stroageClassConfigs` are used, then `nodePathMap` must be set to `[]`.
The `setupCommand` and `teardownCommand` allow you to specify the path to binary files in helperPod that will be called when creating or deleting pvc respectively. This can be useful if you need to use distroless images for security reasons. See the examples/distroless directory for an example. A binary file can take the following parameters:
| Parameter | Description |
......
......@@ -14,8 +14,19 @@ data:
{{- with .Values.sharedFileSystemPath }}
{{- $config = set $config "sharedFileSystemPath" . }}
{{- end }}
{{- with .Values.multipleStorageClasses }}
{{- $config = set $config "sharedFileSystemPath" . }}
{{- with .Values.storageClassConfigs }}
{{- $configs := dict }}
{{- range $key, $value := . }}
{{- $configValue := dict }}
{{- with $value.nodePathMap }}
{{- $configValue = set $configValue "nodePathMap" . }}
{{- end }}
{{- with $value.sharedFileSystemPath }}
{{- $configValue = set $configValue "sharedFileSystemPath" . }}
{{- end }}
{{- $configs = set $configs $key $configValue }}
{{- end }}
{{- $config = set $config "storageClassConfigs" $configs }}
{{- end }}
{{- $config | toPrettyJson | nindent 4 }}
setup: |-
......
{{- $storageClasses := list }}
{{ if .Values.multipleStorageClasses }}
{{ $storageClasses = .Values.multipleStorageClasses }}
{{ if .Values.storageClassConfigs }}
{{ $storageClasses = .Values.storageClassConfigs }}
{{- else }}
{{ $storageClasses = list .Values }}
{{ $storageClasses = dict .Values.storageClass.name .Values }}
{{ end }}
{{- $dot := . }}
{{- range $values := $storageClasses }}
{{- range $name, $values := $storageClasses }}
{{ if $values.storageClass.create -}}
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ $values.storageClass.name }}
name: {{ $name }}
labels:
{{ include "local-path-provisioner.labels" $dot | indent 4 }}
annotations:
......
......@@ -73,15 +73,16 @@ nodePathMap:
# If `sharedFileSystemPath` is used, then `nodePathMap` must be set to `[]`.
# sharedFileSystemPath: ""
# `multipleStorageClasses` allows the provisioner to manage multiple independent storage classes.
# `storageClassConfigs` allows the provisioner to manage multiple independent storage classes.
# Each storage class must have a unique name, and contains the same fields as shown above for
# a single storage class setup, EXCEPT for the provisionerName, which is the same for all
# storage classes
# multipleStorageClasses:
# - storageClass:
# name: my-storage-class-name
# storage classes, and name, which is the key of the map.
# storageClassConfigs: {}
# my-storage-class:
# storageClass:
# create: true
# defaultClass: false
# defaultVolumeType: hostPath
# reclaimPolicy: Delete
# sharedFileSystemPath: ""
# ## OR
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment