Skip to content

Commit

Permalink
[Enhancement] Support multiple data volumes on helm chart (#578)
Browse files Browse the repository at this point in the history
* [Enhancement] Support multiple volumes on helm chart

Signed-off-by: yandongxiao <yandongxiao@starrocks.com>

* Add more comment in values.yaml

Signed-off-by: yandongxiao <yandongxiao@starrocks.com>

---------

Signed-off-by: yandongxiao <yandongxiao@starrocks.com>
  • Loading branch information
yandongxiao authored Aug 21, 2024
1 parent 7bec0ca commit 15a7580
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,23 @@ spec:
{{- if or .Values.starrocksBeSpec.storageSpec.name .Values.starrocksBeSpec.emptyDirs .Values.starrocksBeSpec.hostPaths }}
storageVolumes:
{{- if .Values.starrocksBeSpec.storageSpec.name }}
{{- if gt (int .Values.starrocksBeSpec.storageSpec.storageCount) 1 }}
{{- $storageName := .Values.starrocksBeSpec.storageSpec.name -}}
{{- $storageClassName := .Values.starrocksBeSpec.storageSpec.storageClassName -}}
{{- $storageSize := .Values.starrocksBeSpec.storageSpec.storageSize -}}
{{- $storageMountPath := include "starrockscluster.be.data.path" . -}}
{{- range $i, $e := until (int .Values.starrocksBeSpec.storageSpec.storageCount) }}
- name: {{ $storageName }}{{ $i }}{{template "starrockscluster.be.data.suffix" . }}
storageClassName: {{ $storageClassName }}
storageSize: "{{ $storageSize }}"
mountPath: {{ $storageMountPath }}{{ $i }}
{{- end }}
{{- else}}
- name: {{ .Values.starrocksBeSpec.storageSpec.name }}{{template "starrockscluster.be.data.suffix" . }}
storageClassName: {{ .Values.starrocksBeSpec.storageSpec.storageClassName }}
storageSize: "{{ .Values.starrocksBeSpec.storageSpec.storageSize }}"
mountPath: {{template "starrockscluster.be.data.path" . }}
{{- end }}
- name: {{ .Values.starrocksBeSpec.storageSpec.name }}{{template "starrockscluster.be.log.suffix" . }}
storageClassName: {{ .Values.starrocksBeSpec.storageSpec.storageClassName }}
storageSize: "{{ .Values.starrocksBeSpec.storageSpec.logStorageSize }}"
Expand Down Expand Up @@ -704,10 +717,23 @@ spec:
{{- if or .Values.starrocksCnSpec.storageSpec.name .Values.starrocksCnSpec.emptyDirs .Values.starrocksCnSpec.hostPaths }}
storageVolumes:
{{- if .Values.starrocksCnSpec.storageSpec.name }}
{{- if gt (int .Values.starrocksCnSpec.storageSpec.storageCount) 1 }}
{{- $storageName := .Values.starrocksCnSpec.storageSpec.name -}}
{{- $storageClassName := .Values.starrocksCnSpec.storageSpec.storageClassName -}}
{{- $storageSize := .Values.starrocksCnSpec.storageSpec.storageSize -}}
{{- $storageMountPath := include "starrockscluster.cn.data.path" . -}}
{{- range $i, $e := until (int .Values.starrocksCnSpec.storageSpec.storageCount) }}
- name: {{ $storageName }}{{ $i }}{{template "starrockscluster.cn.data.suffix" . }}
storageClassName: {{ $storageClassName }}
storageSize: "{{ $storageSize }}"
mountPath: {{ $storageMountPath }}{{ $i }}
{{- end }}
{{- else }}
- name: {{ .Values.starrocksCnSpec.storageSpec.name }}{{template "starrockscluster.cn.data.suffix" . }}
storageClassName: {{ .Values.starrocksCnSpec.storageSpec.storageClassName }}
storageSize: "{{ .Values.starrocksCnSpec.storageSpec.storageSize }}"
mountPath: {{template "starrockscluster.cn.data.path" . }}
{{- end }}
- name: {{ .Values.starrocksCnSpec.storageSpec.name }}{{template "starrockscluster.cn.log.suffix" . }}
storageClassName: {{ .Values.starrocksCnSpec.storageSpec.storageClassName }}
storageSize: "{{ .Values.starrocksCnSpec.storageSpec.logStorageSize }}"
Expand Down
28 changes: 24 additions & 4 deletions helm-charts/charts/kube-starrocks/charts/starrocks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -560,9 +560,19 @@ starrocksCnSpec:
# You must set name when you set storageClassName
# Note: Because hostPath field is not supported here, hostPath is not allowed to be set in storageClassName.
storageClassName: ""
# the storage size of persistent volume for data.
# the storage size of per persistent volume for data.
storageSize: 1Ti
# If storageMountPath is empty, the storageMountPath will be set to /opt/starrocks/cn/storage.
# the number of persistent volumes for data.
# if storageCount == 1
# the storageMountPath field is used to specify the mount path of the persistent volume. If storageMountPath is empty,
# the storageMountPath will be set to /opt/starrocks/cn/storage.
# If storageMountPath is not /opt/starrocks/cn/storage, you must add in config the following configuration: storage_root_path = xxx.
# if storageCount > 1
# the storageMountPath field is used to specify the prefix of mount path of the persistent volume. For example, if the
# storageMountPath is /opt/starrocks/cn/storage, the real mount path will be /opt/starrocks/cn/storage0, /opt/starrocks/cn/storage1, ...
# You must add in config the following configuration: storage_root_path = /opt/starrocks/cn/storage0;/opt/starrocks/cn/storage1;...
storageCount: 1
# see the comment of storageCount for the usage of storageMountPath.
storageMountPath: ""
# the storage size of persistent volume for log, and the mount path is /opt/starrocks/cn/log.
# If you set it to 0Gi, the related PVC will not be created, and the log will not be persisted.
Expand Down Expand Up @@ -819,9 +829,19 @@ starrocksBeSpec:
# You must set name when you set storageClassName
# Note: Because hostPath field is not supported here, hostPath is not allowed to be set in storageClassName.
storageClassName: ""
# the storage size of persistent volume for data.
# the storage size of per persistent volume for data.
storageSize: 1Ti
# If storageMountPath is empty, the storageMountPath will be set to /opt/starrocks/be/storage.
# the number of persistent volumes for data.
# if storageCount == 1
# the storageMountPath field is used to specify the mount path of the persistent volume. If storageMountPath is empty,
# the storageMountPath will be set to /opt/starrocks/be/storage.
# If storageMountPath /opt/starrocks/be/storage, you must add in config the following configuration: storage_root_path = xxx.
# if storageCount > 1
# the storageMountPath field is used to specify the prefix of mount path of the persistent volume. For example, if the
# storageMountPath is /opt/starrocks/be/storage, the real mount path will be /opt/starrocks/be/storage0, /opt/starrocks/be/storage1, ...
# You must add in config the following configuration: storage_root_path = /opt/starrocks/be/storage0;/opt/starrocks/be/storage1;...
storageCount: 1
# see the comment of storageCount for the usage of storageMountPath.
storageMountPath: ""
# Setting this parameter can persist log storage, and the mount path is /opt/starrocks/be/log.
# If you set it to 0Gi, the related PVC will not be created, and the log will not be persisted.
Expand Down
28 changes: 24 additions & 4 deletions helm-charts/charts/kube-starrocks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -668,9 +668,19 @@ starrocks:
# You must set name when you set storageClassName
# Note: Because hostPath field is not supported here, hostPath is not allowed to be set in storageClassName.
storageClassName: ""
# the storage size of persistent volume for data.
# the storage size of per persistent volume for data.
storageSize: 1Ti
# If storageMountPath is empty, the storageMountPath will be set to /opt/starrocks/cn/storage.
# the number of persistent volumes for data.
# if storageCount == 1
# the storageMountPath field is used to specify the mount path of the persistent volume. If storageMountPath is empty,
# the storageMountPath will be set to /opt/starrocks/cn/storage.
# If storageMountPath is not /opt/starrocks/cn/storage, you must add in config the following configuration: storage_root_path = xxx.
# if storageCount > 1
# the storageMountPath field is used to specify the prefix of mount path of the persistent volume. For example, if the
# storageMountPath is /opt/starrocks/cn/storage, the real mount path will be /opt/starrocks/cn/storage0, /opt/starrocks/cn/storage1, ...
# You must add in config the following configuration: storage_root_path = /opt/starrocks/cn/storage0;/opt/starrocks/cn/storage1;...
storageCount: 1
# see the comment of storageCount for the usage of storageMountPath.
storageMountPath: ""
# the storage size of persistent volume for log, and the mount path is /opt/starrocks/cn/log.
# If you set it to 0Gi, the related PVC will not be created, and the log will not be persisted.
Expand Down Expand Up @@ -927,9 +937,19 @@ starrocks:
# You must set name when you set storageClassName
# Note: Because hostPath field is not supported here, hostPath is not allowed to be set in storageClassName.
storageClassName: ""
# the storage size of persistent volume for data.
# the storage size of per persistent volume for data.
storageSize: 1Ti
# If storageMountPath is empty, the storageMountPath will be set to /opt/starrocks/be/storage.
# the number of persistent volumes for data.
# if storageCount == 1
# the storageMountPath field is used to specify the mount path of the persistent volume. If storageMountPath is empty,
# the storageMountPath will be set to /opt/starrocks/be/storage.
# If storageMountPath /opt/starrocks/be/storage, you must add in config the following configuration: storage_root_path = xxx.
# if storageCount > 1
# the storageMountPath field is used to specify the prefix of mount path of the persistent volume. For example, if the
# storageMountPath is /opt/starrocks/be/storage, the real mount path will be /opt/starrocks/be/storage0, /opt/starrocks/be/storage1, ...
# You must add in config the following configuration: storage_root_path = /opt/starrocks/be/storage0;/opt/starrocks/be/storage1;...
storageCount: 1
# see the comment of storageCount for the usage of storageMountPath.
storageMountPath: ""
# Setting this parameter can persist log storage, and the mount path is /opt/starrocks/be/log.
# If you set it to 0Gi, the related PVC will not be created, and the log will not be persisted.
Expand Down

0 comments on commit 15a7580

Please sign in to comment.