-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(chart): make StorageClass parameters/mountOptions configurable
This will allow the user to optionally define extra parameters and mountOptions for the provisioned StorageClass, without having to template it outside of the chart. Existing behavior is unchanged[1] and pre-existing parameters like cache, ssd will have priority over what the user defines. [1] I've added 2 small error messages, for rare cases where the user might forget to fill out .name or .storage. Signed-off-by: Philipp Born <[email protected]>
- Loading branch information
1 parent
364b8be
commit a78e338
Showing
4 changed files
with
27 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ policies: | |
scopes: | ||
- deps | ||
- main | ||
- chart | ||
descriptionLength: 72 | ||
- type: license | ||
spec: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,28 @@ | ||
{{- define "storageClass.parameters" -}} | ||
csi.storage.k8s.io/fstype: {{ default "ext4" .fstype }} | ||
storage: {{ .storage | required "Proxmox Storage name must be provided." }} | ||
{{- with .cache }} | ||
cache: {{ . }} | ||
{{- end }} | ||
{{- if .ssd }} | ||
ssd: "true" | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- range $storage := .Values.storageClass }} | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass | ||
metadata: | ||
name: {{ $storage.name }} | ||
name: {{ $storage.name | required "StorageClass name must be provided." }} | ||
provisioner: {{ $.Values.provisionerName }} | ||
allowVolumeExpansion: true | ||
volumeBindingMode: WaitForFirstConsumer | ||
reclaimPolicy: {{ default "Delete" $storage.reclaimPolicy }} | ||
parameters: | ||
csi.storage.k8s.io/fstype: {{ default "ext4" $storage.fstype }} | ||
storage: {{ $storage.storage }} | ||
{{- if $storage.cache }} | ||
cache: {{ $storage.cache }} | ||
{{- end }} | ||
{{- if $storage.ssd }} | ||
ssd: "true" | ||
{{- end }} | ||
{{- mustMergeOverwrite (default (dict) $storage.extraParameters) (include "storageClass.parameters" . | fromYaml) | toYaml | nindent 2 -}} | ||
{{- with $storage.mountOptions }} | ||
mountOptions: | ||
{{- . | toYaml | nindent 2 }} | ||
{{- end }} | ||
--- | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters