Skip to content

Commit

Permalink
Merge pull request #235 from kubeservice-stack/helm-allow-configure
Browse files Browse the repository at this point in the history
feat: allow storageclass value configure
  • Loading branch information
peter-wangxu authored Sep 25, 2023
2 parents 255e6d8 + d9e29ca commit 1b28a09
Show file tree
Hide file tree
Showing 15 changed files with 159 additions and 51 deletions.
14 changes: 7 additions & 7 deletions docs/commandline/open-local.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@

### SEE ALSO

* [open-local agent](open-local_agent.md) - command for collecting local storage information
* [open-local completion](open-local_completion.md) - Generate the autocompletion script for the specified shell
* [open-local controller](open-local_controller.md) - command for starting a controller
* [open-local csi](open-local_csi.md) - command for running csi plugin
* [open-local gen-doc](open-local_gen-doc.md) - generate document for Open-Local CLI with MarkDown format
* [open-local scheduler](open-local_scheduler.md) - scheduler is a scheduler extender implementation for local storage
* [open-local version](open-local_version.md) - Print the version of open-local
* [open-local agent](./open-local_agent.md) - command for collecting local storage information
* [open-local completion](./open-local_completion.md) - Generate the autocompletion script for the specified shell
* [open-local controller](./open-local_controller.md) - command for starting a controller
* [open-local csi](./open-local_csi.md) - command for running csi plugin
* [open-local gen-doc](./open-local_gen-doc.md) - generate document for Open-Local CLI with MarkDown format
* [open-local scheduler](./open-local_scheduler.md) - scheduler is a scheduler extender implementation for local storage
* [open-local version](./open-local_version.md) - Print the version of open-local

2 changes: 1 addition & 1 deletion docs/commandline/open-local_agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ open-local agent [flags]

### SEE ALSO

* [open-local](open-local.md) -
* [open-local](./open-local.md) -

10 changes: 5 additions & 5 deletions docs/commandline/open-local_completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ See each sub-command's help for details on how to use the generated script.

### SEE ALSO

* [open-local](open-local.md) -
* [open-local completion bash](open-local_completion_bash.md) - Generate the autocompletion script for bash
* [open-local completion fish](open-local_completion_fish.md) - Generate the autocompletion script for fish
* [open-local completion powershell](open-local_completion_powershell.md) - Generate the autocompletion script for powershell
* [open-local completion zsh](open-local_completion_zsh.md) - Generate the autocompletion script for zsh
* [open-local](./open-local.md) -
* [open-local completion bash](./open-local_completion_bash.md) - Generate the autocompletion script for bash
* [open-local completion fish](./open-local_completion_fish.md) - Generate the autocompletion script for fish
* [open-local completion powershell](./open-local_completion_powershell.md) - Generate the autocompletion script for powershell
* [open-local completion zsh](./open-local_completion_zsh.md) - Generate the autocompletion script for zsh

2 changes: 1 addition & 1 deletion docs/commandline/open-local_completion_bash.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ open-local completion bash

### SEE ALSO

* [open-local completion](open-local_completion.md) - Generate the autocompletion script for the specified shell
* [open-local completion](./open-local_completion.md) - Generate the autocompletion script for the specified shell

2 changes: 1 addition & 1 deletion docs/commandline/open-local_completion_fish.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ open-local completion fish [flags]

### SEE ALSO

* [open-local completion](open-local_completion.md) - Generate the autocompletion script for the specified shell
* [open-local completion](./open-local_completion.md) - Generate the autocompletion script for the specified shell

2 changes: 1 addition & 1 deletion docs/commandline/open-local_completion_powershell.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ open-local completion powershell [flags]

### SEE ALSO

* [open-local completion](open-local_completion.md) - Generate the autocompletion script for the specified shell
* [open-local completion](./open-local_completion.md) - Generate the autocompletion script for the specified shell

2 changes: 1 addition & 1 deletion docs/commandline/open-local_completion_zsh.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ open-local completion zsh [flags]

### SEE ALSO

* [open-local completion](open-local_completion.md) - Generate the autocompletion script for the specified shell
* [open-local completion](./open-local_completion.md) - Generate the autocompletion script for the specified shell

2 changes: 1 addition & 1 deletion docs/commandline/open-local_controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ open-local controller [flags]

### SEE ALSO

* [open-local](open-local.md) -
* [open-local](./open-local.md) -

2 changes: 1 addition & 1 deletion docs/commandline/open-local_csi.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ open-local csi [flags]

### SEE ALSO

* [open-local](open-local.md) -
* [open-local](./open-local.md) -

2 changes: 1 addition & 1 deletion docs/commandline/open-local_gen-doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ open-local gen-doc [flags]

### SEE ALSO

* [open-local](open-local.md) -
* [open-local](./open-local.md) -

2 changes: 1 addition & 1 deletion docs/commandline/open-local_scheduler.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ open-local scheduler [flags]

### SEE ALSO

* [open-local](open-local.md) -
* [open-local](./open-local.md) -

2 changes: 1 addition & 1 deletion docs/commandline/open-local_version.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ open-local version [flags]

### SEE ALSO

* [open-local](open-local.md) -
* [open-local](./open-local.md) -

78 changes: 49 additions & 29 deletions helm/templates/storage-class.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
{{- if .Values.storageclass.lvm.enabled }}
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ .Values.storageclass.lvm.name }}
{{ include "local.labels" . | indent 2 }}
provisioner: {{ .Values.driver }}
parameters:
volumeType: "LVM"
csi.storage.k8s.io/fstype: ext4
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
{{- range $key, $value := .Values.storageclass.lvm.parameters }}
{{ $key }}: {{ $value }}
{{- end }}
reclaimPolicy: {{ .Values.storageclass.lvm.reclaimPolicy }}
volumeBindingMode: {{ .Values.storageclass.lvm.volumeBindingMode }}
allowVolumeExpansion: {{ .Values.storageclass.lvm.allowVolumeExpansion }}
{{- end }}

{{- if .Values.storageclass.lvm_xfs.enabled }}
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
Expand All @@ -18,11 +24,15 @@ metadata:
{{ include "local.labels" . | indent 2 }}
provisioner: {{ .Values.driver }}
parameters:
volumeType: "LVM"
csi.storage.k8s.io/fstype: xfs
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
{{- range $key, $value := .Values.storageclass.lvm_xfs.parameters }}
{{ $key }}: {{ $value }}
{{- end }}
reclaimPolicy: {{ .Values.storageclass.lvm_xfs.reclaimPolicy }}
volumeBindingMode: {{ .Values.storageclass.lvm_xfs.volumeBindingMode }}
allowVolumeExpansion: {{ .Values.storageclass.lvm_xfs.allowVolumeExpansion }}
{{- end }}

{{- if .Values.storageclass.device_hdd.enabled }}
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
Expand All @@ -31,12 +41,15 @@ metadata:
{{ include "local.labels" . | indent 2 }}
provisioner: {{ .Values.driver }}
parameters:
csi.storage.k8s.io/fstype: ext4
volumeType: Device
mediaType: hdd
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: false
{{- range $key, $value := .Values.storageclass.device_hdd.parameters }}
{{ $key }}: {{ $value }}
{{- end }}
reclaimPolicy: {{ .Values.storageclass.device_hdd.reclaimPolicy }}
volumeBindingMode: {{ .Values.storageclass.device_hdd.volumeBindingMode }}
allowVolumeExpansion: {{ .Values.storageclass.device_hdd.allowVolumeExpansion }}
{{- end }}

{{- if .Values.storageclass.device_ssd.enabled }}
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
Expand All @@ -45,12 +58,15 @@ metadata:
{{ include "local.labels" . | indent 2 }}
provisioner: {{ .Values.driver }}
parameters:
csi.storage.k8s.io/fstype: ext4
volumeType: Device
mediaType: ssd
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: false
{{- range $key, $value := .Values.storageclass.device_ssd.parameters }}
{{ $key }}: {{ $value }}
{{- end }}
reclaimPolicy: {{ .Values.storageclass.device_ssd.reclaimPolicy }}
volumeBindingMode: {{ .Values.storageclass.device_ssd.volumeBindingMode }}
allowVolumeExpansion: {{ .Values.storageclass.device_ssd.allowVolumeExpansion }}
{{- end }}

{{- if .Values.storageclass.lvm_throttle.enabled }}
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
Expand All @@ -59,12 +75,15 @@ metadata:
{{ include "local.labels" . | indent 2 }}
provisioner: local.csi.aliyun.com
parameters:
volumeType: "LVM"
bps: "1048576"
iops: "1024"
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
{{- range $key, $value := .Values.storageclass.lvm_throttle.parameters }}
{{ $key }}: {{ $value }}
{{- end }}
reclaimPolicy: {{ .Values.storageclass.lvm_throttle.reclaimPolicy }}
volumeBindingMode: {{ .Values.storageclass.lvm_throttle.volumeBindingMode }}
allowVolumeExpansion: {{ .Values.storageclass.lvm_throttle.allowVolumeExpansion }}
{{- end }}

{{- if .Values.storageclass.lvm.enabled }}
---
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
Expand All @@ -77,4 +96,5 @@ parameters:
csi.aliyun.com/readonly: "true"
csi.aliyun.com/snapshot-initial-size: 4Gi
csi.aliyun.com/snapshot-expansion-size: 1Gi
csi.aliyun.com/snapshot-expansion-threshold: 50%
csi.aliyun.com/snapshot-expansion-threshold: 50%
{{- end }}
45 changes: 45 additions & 0 deletions helm/values-acka.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,59 @@ controller:
update_nls: "false"
framework_scheduler_names: ahe-scheduler
storageclass:
# lvm StorageClass
lvm:
enabled: true
name: yoda-lvm-default
parameters:
volumeType: "LVM"
csi.storage.k8s.io/fstype: ext4
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
# lvm_xfs StorageClass
lvm_xfs:
enabled: true
name: yoda-lvm-xfs
parameters:
volumeType: LVM
csi.storage.k8s.io/fstype: xfs
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
# lvm_throttle StorageClass
lvm_throttle:
enabled: false
name: yoda-lvm-io-throttle
parameters:
volumeType: LVM
# bps: "1048576"
# iops: "1024"
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
# device_ssd StorageClass
device_ssd:
enabled: true
name: yoda-device-ssd
parameters:
csi.storage.k8s.io/fstype: ext4
volumeType: Device
mediaType: ssd
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: false
# device_hdd StorageClass
device_hdd:
enabled: true
name: yoda-device-hdd
parameters:
csi.storage.k8s.io/fstype: ext4
volumeType: Device
mediaType: hdd
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: false
monitor:
# install grafana dashboard
enabled: false
Expand Down
43 changes: 43 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,59 @@ extender:
controller:
update_nls: "true"
storageclass:
# lvm StorageClass
lvm:
enabled: true
name: open-local-lvm
parameters:
volumeType: "LVM"
csi.storage.k8s.io/fstype: ext4
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
# lvm_xfs StorageClass
lvm_xfs:
enabled: true
name: open-local-lvm-xfs
parameters:
volumeType: LVM
csi.storage.k8s.io/fstype: xfs
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
# lvm_throttle StorageClass
lvm_throttle:
enabled: true
name: open-local-lvm-io-throttle
parameters:
volumeType: LVM
# bps: "1048576"
# iops: "1024"
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
# device_ssd StorageClass
device_ssd:
enabled: true
name: open-local-device-ssd
parameters:
csi.storage.k8s.io/fstype: ext4
volumeType: Device
mediaType: ssd
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: false
# device_hdd StorageClass
device_hdd:
enabled: true
name: open-local-device-hdd
parameters:
csi.storage.k8s.io/fstype: ext4
volumeType: Device
mediaType: hdd
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: false
monitor:
# install grafana dashboard
enabled: false
Expand Down

0 comments on commit 1b28a09

Please sign in to comment.