diff --git a/charts/longhorn/README.md b/charts/longhorn/README.md index fc558fab..a63cf037 100644 --- a/charts/longhorn/README.md +++ b/charts/longhorn/README.md @@ -144,6 +144,8 @@ The `values.yaml` contains items used to tweak a deployment of this chart. | persistence.defaultDataLocality | string | `"disabled"` | Data locality of the default Longhorn StorageClass. (Options: "disabled", "best-effort") | | persistence.defaultFsType | string | `"ext4"` | Filesystem type of the default Longhorn StorageClass. | | persistence.defaultMkfsParams | string | `""` | mkfs parameters of the default Longhorn StorageClass. | +| persistence.defaultDiskSelector.enable | bool | `false` | Setting that allows you to enable the disk selector for the default Longhorn StorageClass. | +| persistence.defaultDiskSelector.selector | string | `""` | Disk selector for the default Longhorn StorageClass. Longhorn uses only disks with the specified tags for storing volume data. (Examples: "nvme,sata") | | persistence.defaultNodeSelector.enable | bool | `false` | Setting that allows you to enable the node selector for the default Longhorn StorageClass. | | persistence.defaultNodeSelector.selector | string | `""` | Node selector for the default Longhorn StorageClass. Longhorn uses only nodes with the specified tags for storing volume data. (Examples: "storage,fast") | | persistence.migratable | bool | `false` | Setting that allows you to enable live migration of a Longhorn volume from one node to another. | diff --git a/charts/longhorn/questions.yaml b/charts/longhorn/questions.yaml index 455c454f..003a27dd 100644 --- a/charts/longhorn/questions.yaml +++ b/charts/longhorn/questions.yaml @@ -765,6 +765,20 @@ questions: group: "Longhorn Storage Class Settings" type: string default: +- variable: persistence.defaultDiskSelector.enable + description: "Setting that allows you to enable the disk selector for the default Longhorn StorageClass." + group: "Longhorn Storage Class Settings" + label: Enable Storage Class Disk Selector + type: boolean + default: false + show_subquestion_if: true + subquestions: + - variable: persistence.defaultDiskSelector.selector + label: Storage Class Disk Selector + description: 'Disk selector for the default Longhorn StorageClass. Longhorn uses only disks with the specified tags for storing volume data. (Examples: "nvme,sata")' + group: "Longhorn Storage Class Settings" + type: string + default: - variable: persistence.defaultNodeSelector.enable description: "Setting that allows you to enable the node selector for the default Longhorn StorageClass." group: "Longhorn Storage Class Settings" @@ -917,4 +931,4 @@ questions: type: int min: 1000 max: 8000 - default: 1250 \ No newline at end of file + default: 1250 diff --git a/charts/longhorn/templates/storageclass.yaml b/charts/longhorn/templates/storageclass.yaml index f79699f5..51bac2a4 100644 --- a/charts/longhorn/templates/storageclass.yaml +++ b/charts/longhorn/templates/storageclass.yaml @@ -42,6 +42,9 @@ data: recurringJobSelector: '{{ .Values.persistence.recurringJobSelector.jobList }}' {{- end }} dataLocality: {{ .Values.persistence.defaultDataLocality | quote }} + {{- if .Values.persistence.defaultDiskSelector.enable }} + diskSelector: "{{ .Values.persistence.defaultDiskSelector.selector }}" + {{- end }} {{- if .Values.persistence.defaultNodeSelector.enable }} nodeSelector: "{{ .Values.persistence.defaultNodeSelector.selector }}" {{- end }} diff --git a/charts/longhorn/values.yaml b/charts/longhorn/values.yaml index c7dfe643..f5ea586b 100644 --- a/charts/longhorn/values.yaml +++ b/charts/longhorn/values.yaml @@ -154,6 +154,11 @@ persistence: dataSourceParameters: ~ # -- Expected SHA-512 checksum of a backing image used in a Longhorn StorageClass. expectedChecksum: ~ + defaultDiskSelector: + # -- Setting that allows you to enable the disk selector for the default Longhorn StorageClass. + enable: false + # -- Disk selector for the default Longhorn StorageClass. Longhorn uses only disks with the specified tags for storing volume data. (Examples: "nvme,sata") + selector: "" defaultNodeSelector: # -- Setting that allows you to enable the node selector for the default Longhorn StorageClass. enable: false