Skip to content

Commit 9a59ef1

Browse files
committed
allow parameterize storageClass.provisioner
Signed-off-by: Lize Cai <[email protected]>
1 parent 76b1c86 commit 9a59ef1

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

helm/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ provisioner chart and their default values.
142142
| classes.[n].storageClass | Create storage class for this class and configure it optionally. | bool/map | `false` |
143143
| classes.[n].storageClass.reclaimPolicy | Specify reclaimPolicy of storage class, available: Delete/Retain. | str | `Delete` |
144144
| classes.[n].storageClass.isDefaultClass | Set storage class as default | bool | `false` |
145+
| classes.[n].storageClass.provisioner | Specify provisioner of storage class. | str | `kubernetes.io/no-provisioner` |
145146
| podAnnotations | Annotations for each Pod in the DaemonSet. | map | `-` |
146147
| podLabels | Labels for each Pod in the DaemonSet. | map | `-` |
147148
| image | Provisioner image. | str | `registry.k8s.io/sig-storage/local-volume-provisioner:v2.5.0` |

helm/provisioner/templates/storageclass.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ metadata:
1616
app.kubernetes.io/name: {{ template "provisioner.name" $ }}
1717
app.kubernetes.io/managed-by: {{ $.Release.Service }}
1818
app.kubernetes.io/instance: {{ $.Release.Name }}
19-
provisioner: kubernetes.io/no-provisioner
19+
{{- if kindIs "map" $val.storageClass }}
20+
provisioner: {{ $val.storageClass.provisioner | default "kubernetes.io/no-provisioner" }}
21+
{{- else }}
22+
provisioner: "kubernetes.io/no-provisioner"
23+
{{- end }}
2024
volumeBindingMode: WaitForFirstConsumer
2125
{{- if kindIs "map" $val.storageClass }}
2226
reclaimPolicy: {{ $val.storageClass.reclaimPolicy | default "Delete" }}

helm/provisioner/values.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,16 @@ classes:
8282
- "2"
8383
# or blkdiscard utility by uncommenting the line below.
8484
# - "/scripts/blkdiscard.sh"
85-
# Uncomment to create storage class object with default configuration.
86-
# storageClass: true
87-
# Uncomment to create storage class object and configure it.
88-
# storageClass:
85+
# Uncomment to create storage class object with default configuration.
86+
# storageClass: true
87+
# Uncomment to create storage class object and configure it.
88+
# storageClass:
8989
# reclaimPolicy: Delete # Available reclaim policies: Delete/Retain, defaults: Delete.
9090
# isDefaultClass: true # set as default class
91+
# If you are using cluster autoscaler to scale the workload using volume provisioned by this storage class,
92+
# set the provisioner of the storage class to another value other than the default.
93+
# Ref: https://github.com/kubernetes-sigs/sig-storage-local-static-provisioner/issues/288
94+
# provisioner: kubernetes.io/no-provisioner
9195

9296
# Defines annotations for each Pod in the DaemonSet.
9397
podAnnotations: {}

0 commit comments

Comments
 (0)