Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[helm]support config override in starrocksFESpec/starrocksBeSpec/starrocksCnSpec #580

Merged
merged 5 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,40 @@ starrockscluster

{{- define "starrockscluster.fe.config" -}}
fe.conf: |
{{- if .Values.starrocksFESpec.config }}
{{- .Values.starrocksFESpec.config | nindent 2 }}
{{- if and .Values.starrocksFESpec.configyaml (kindIs "map" .Values.starrocksFESpec.configyaml) }}
{{- range $key, $value := .Values.starrocksFESpec.configyaml }}
{{ $key }} = {{ $value }}
{{- end }}
{{- else if .Values.starrocksFESpec.configyaml }}
{{ fail "configyaml must be a map" }}
{{- else }}
{{- .Values.starrocksFESpec.config | nindent 2 }}
{{- end }}
{{- end }}

{{- define "starrockscluster.cn.config" -}}
cn.conf: |
{{- if .Values.starrocksCnSpec.config }}
{{- .Values.starrocksCnSpec.config | nindent 2 }}
{{- if and .Values.starrocksCnSpec.configyaml (kindIs "map" .Values.starrocksCnSpec.configyaml) }}
{{- range $key, $value := .Values.starrocksCnSpec.configyaml }}
{{ $key }} = {{ $value }}
{{- end }}
{{- else if .Values.starrocksCnSpec.configyaml }}
{{ fail "configyaml must be a map" }}
{{- else }}
{{- .Values.starrocksCnSpec.config | nindent 2 }}
{{- end }}
{{- end }}

{{- define "starrocksclster.be.config" -}}
be.conf: |
{{- if .Values.starrocksBeSpec.config }}
{{- .Values.starrocksBeSpec.config | nindent 2 }}
{{- if and .Values.starrocksBeSpec.configyaml (kindIs "map" .Values.starrocksBeSpec.configyaml) }}
{{- range $key, $value := .Values.starrocksBeSpec.configyaml }}
{{ $key }} = {{ $value }}
{{- end }}
{{- else if .Values.starrocksBeSpec.configyaml }}
{{ fail "configyaml must be a map" }}
{{- else }}
{{- .Values.starrocksBeSpec.config | nindent 2 }}
{{- end }}
{{- end }}

Expand Down Expand Up @@ -214,7 +232,12 @@ starrockscluster.fe.config.hash is used to calculate the hash value of the fe.co
the first 8 digits are taken, which will be used as the annotations for pods.
*/}}
{{- define "starrockscluster.fe.config.hash" }}
{{- if .Values.starrocksFESpec.config }}
{{- if and .Values.starrocksFESpec.configyaml (kindIs "map" .Values.starrocksFESpec.configyaml) }}
{{- $hash := toJson .Values.starrocksFESpec.configyaml | sha256sum | trunc 8 }}
{{- printf "%s" $hash }}
{{- else if .Values.starrocksFESpec.configyaml }}
{{ fail "configyaml must be a map" }}
{{- else if .Values.starrocksFESpec.config }}
{{- $hash := toJson .Values.starrocksFESpec.config | sha256sum | trunc 8 }}
{{- printf "%s" $hash }}
{{- else }}
Expand All @@ -228,7 +251,12 @@ starrockscluster.be.config.hash is used to calculate the hash value of the be.co
the first 8 digits are taken, which will be used as the annotations for pods.
*/}}
{{- define "starrockscluster.be.config.hash" }}
{{- if .Values.starrocksBeSpec.config }}
{{- if and .Values.starrocksBeSpec.configyaml (kindIs "map" .Values.starrocksBeSpec.configyaml) }}
{{- $hash := toJson .Values.starrocksBeSpec.configyaml | sha256sum | trunc 8 }}
{{- printf "%s" $hash }}
{{- else if .Values.starrocksBeSpec.configyaml }}
{{ fail "configyaml must be a map" }}
{{- else if .Values.starrocksBeSpec.config }}
{{- $hash := toJson .Values.starrocksBeSpec.config | sha256sum | trunc 8 }}
{{- printf "%s" $hash }}
{{- else }}
Expand All @@ -241,7 +269,12 @@ starrockscluster.cn.config.hash is used to calculate the hash value of the cn.co
the first 8 digits are taken, which will be used as the annotations for pods.
*/}}
{{- define "starrockscluster.cn.config.hash" }}
{{- if .Values.starrocksCnSpec.config }}
{{- if and .Values.starrocksCnSpec.configyaml (kindIs "map" .Values.starrocksCnSpec.configyaml) }}
{{- $hash := toJson .Values.starrocksCnSpec.configyaml | sha256sum | trunc 8 }}
{{- printf "%s" $hash }}
{{- else if .Values.starrocksCnSpec.configyaml }}
{{ fail "configyaml must be a map" }}
{{- else if .Values.starrocksCnSpec.config }}
{{- $hash := toJson .Values.starrocksCnSpec.config | sha256sum | trunc 8 }}
{{- printf "%s" $hash }}
{{- else }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ starrocksFESpec:
edit_log_port = 9010
mysql_service_nio_enabled = true
sys_log_level = INFO
# A map object for setting the config. When configyaml is set, to non-empty, the configs in configyaml will take
# precedence and values in config field will be discarded.
configyaml: {}
# mount secrets if necessary.
# see https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath for more details about subPath.
secrets: []
Expand Down Expand Up @@ -598,6 +601,9 @@ starrocksCnSpec:
webserver_port = 8040
heartbeat_service_port = 9050
brpc_port = 8060
# A map object for setting the config. When configyaml is set, to non-empty, the configs in configyaml will take
# precedence and values in config field will be discarded.
configyaml: {}
# mount secrets if necessary.
# see https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath for more details about subPath.
secrets: []
Expand Down Expand Up @@ -850,6 +856,9 @@ starrocksBeSpec:
brpc_port = 8060
sys_log_level = INFO
default_rowset_type = beta
# A map object for setting the config. When configyaml is set, to non-empty, the configs in configyaml will take
# precedence and values in config field will be discarded.
configyaml: {}
# mount secrets if necessary.
# see https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath for more details about subPath.
secrets: []
Expand Down
9 changes: 9 additions & 0 deletions helm-charts/charts/kube-starrocks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,9 @@ starrocks:
edit_log_port = 9010
mysql_service_nio_enabled = true
sys_log_level = INFO
# A map object for setting the config. When configyaml is set, to non-empty, the configs in configyaml will take
# precedence and values in config field will be discarded.
configyaml: {}
# mount secrets if necessary.
# see https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath for more details about subPath.
secrets: []
Expand Down Expand Up @@ -706,6 +709,9 @@ starrocks:
webserver_port = 8040
heartbeat_service_port = 9050
brpc_port = 8060
# A map object for setting the config. When configyaml is set, to non-empty, the configs in configyaml will take
# precedence and values in config field will be discarded.
configyaml: {}
# mount secrets if necessary.
# see https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath for more details about subPath.
secrets: []
Expand Down Expand Up @@ -958,6 +964,9 @@ starrocks:
brpc_port = 8060
sys_log_level = INFO
default_rowset_type = beta
# A map object for setting the config. When configyaml is set, to non-empty, the configs in configyaml will take
# precedence and values in config field will be discarded.
configyaml: {}
# mount secrets if necessary.
# see https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath for more details about subPath.
secrets: []
Expand Down
Loading