Skip to content

Commit

Permalink
[Enhancement] Support multiple volumes on helm chart
Browse files Browse the repository at this point in the history
Signed-off-by: yandongxiao <[email protected]>
  • Loading branch information
yandongxiao committed Aug 16, 2024
1 parent 52cfec8 commit 483e51b
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 4 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
15 changes: 13 additions & 2 deletions helm-charts/charts/kube-starrocks/charts/starrocks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -557,9 +557,15 @@ 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 its value is greater than 1:
# 1. the storageMountPath will follow the format, e.g. /opt/starrocks/cn/storage0, /opt/starrocks/cn/storage1, ...
# 2. You must add in config the following configuration: storage_root_path = /opt/starrocks/cn/storage0;/opt/starrocks/cn/storage1;...
storageCount: 1
# If storageMountPath is empty, the storageMountPath will be set to /opt/starrocks/cn/storage.
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 @@ -813,8 +819,13 @@ 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
# the number of persistent volumes for data.
# if its value is greater than 1:
# 1. the storageMountPath will follow the format, e.g. /opt/starrocks/be/storage0, /opt/starrocks/be/storage1, ...
# 2. You must add in config the following configuration: storage_root_path = /opt/starrocks/be/storage0;/opt/starrocks/be/storage1;...
storageCount: 1
# If storageMountPath is empty, the storageMountPath will be set to /opt/starrocks/be/storage.
storageMountPath: ""
# Setting this parameter can persist log storage, and the mount path is /opt/starrocks/be/log.
Expand Down
15 changes: 13 additions & 2 deletions helm-charts/charts/kube-starrocks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,15 @@ 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 its value is greater than 1:
# 1. the storageMountPath will follow the format, e.g. /opt/starrocks/cn/storage0, /opt/starrocks/cn/storage1, ...
# 2. You must add in config the following configuration: storage_root_path = /opt/starrocks/cn/storage0;/opt/starrocks/cn/storage1;...
storageCount: 1
# If storageMountPath is empty, the storageMountPath will be set to /opt/starrocks/cn/storage.
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 @@ -921,8 +927,13 @@ 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
# the number of persistent volumes for data.
# if its value is greater than 1:
# 1. the storageMountPath will follow the format, e.g. /opt/starrocks/be/storage0, /opt/starrocks/be/storage1, ...
# 2. You must add in config the following configuration: storage_root_path = /opt/starrocks/be/storage0;/opt/starrocks/be/storage1;...
storageCount: 1
# If storageMountPath is empty, the storageMountPath will be set to /opt/starrocks/be/storage.
storageMountPath: ""
# Setting this parameter can persist log storage, and the mount path is /opt/starrocks/be/log.
Expand Down

0 comments on commit 483e51b

Please sign in to comment.