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

Conversation

dengliu
Copy link
Collaborator

@dengliu dengliu commented Aug 20, 2024

Description

#494

Test

1) Test config spec setting

with values1.yaml, run

helm template --debug kube-starrocks --values kube-starrocks/values.yaml --values kube-starrocks/values-1.yaml

# spec for component be, provide storage and compute function.
starrocks:
  starrocksFESpec:
    configyaml:
      query_port: 9031
      foo: FEAdditionalValue
      additonal: values
  starrocksBeSpec:
    configyaml:
      be_port: 9061
      foo: BEAdditionalValue
  starrocksCluster:
    enabledCn: true
  starrocksCnSpec:
    configyaml:
      heartbeat_service_port: 9051
      foo: CNAdditionalValue

Got
image
image
image

2) Test config hash

with template below, a minor change in the configyaml values generate totally different hash value

fe-config-hash: "{{template "starrockscluster.fe.config.hash" . }}"
be-config-hash: "{{template "starrockscluster.be.config.hash" . }}"
cn-config-hash: "{{template "starrockscluster.cn.config.hash" . }}"

image
image
image

3) Test with quote in values

  starrocksFESpec:
    configyaml:
      LOG_DIR : ${STARROCKS_HOME}/log
      DATE : '"$(date +%Y%m%d-%H%M%S)"'
      JAVA_OPTS: '"-Dlog4j2.formatMsgNoLookups=true -Xmx8192m -XX:+UseG1GC -Xlog:gc*:${LOG_DIR}/fe.gc.log.$DATE:time"'
      mysql_service_nio_enabled: false

image

4) Test with configyaml not setting

Verified that it uses the string value in config field

5) Verified default value setting from configyaml

image
image
image

Related Issue(s)

N/A

Checklist

For operator, please complete the following checklist:

  • run make generate to generate the code.
  • run golangci-lint run to check the code style.
  • run make test to run UT.
  • run make manifests to update the yaml files of CRD.

For helm chart, please complete the following checklist:

  • make sure you have updated the values.yaml
    file of starrocks chart.
  • In scripts directory, run bash create-parent-chart-values.sh to update the values.yaml file of the parent
    chart( kube-starrocks chart).

@dengliu dengliu changed the title [Enhancement] Support yaml map type config for fe, be and cn [helm]support config override in starrocksFESpec/starrocksBeSpec/starrocksCnSpec Aug 20, 2024
@dengliu dengliu force-pushed the dliu/config branch 3 times, most recently from ec7f121 to 0df9849 Compare August 20, 2024 05:50
@yandongxiao
Copy link
Collaborator

‌‌‌‌‌‌‌I think there is a backward compatibility issue here. That is, if the user has set a custom config by config and then upgrades to use the latest helm chart, because the value of configyaml is always not empty, it will cause the user to use the default content of configyaml as the configuration for FE/BE/CN.

@yandongxiao
Copy link
Collaborator

Looking at your code, you directly modified helm-charts/charts/kube-starrocks/values.yaml, should modify helm-charts/charts/kube-starrocks/charts/starrocks/values.yaml.

In scripts directory, run bash create-parent-chart-values.sh to update the values.yaml file of the parent
chart( kube-starrocks chart).

@yandongxiao
Copy link
Collaborator

‌Can we merge the contents of config and configyaml to generate the final result? This way, there will only be one set of configurations in values.yaml. At the same time, allow users to add incremental configurations through configyaml.

@dengliu
Copy link
Collaborator Author

dengliu commented Aug 20, 2024

‌‌‌‌‌‌‌I think there is a backward compatibility issue here. That is, if the user has set a custom config by config and then upgrades to use the latest helm chart, because the value of configyaml is always not empty, it will cause the user to use the default content of configyaml as the configuration for FE/BE/CN.

I can set configyaml to {} to address this issue. would this solution OK with you?

@dengliu
Copy link
Collaborator Author

dengliu commented Aug 20, 2024

‌Can we merge the contents of config and configyaml to generate the final result? This way, there will only be one set of configurations in values.yaml. At the same time, allow users to add incremental configurations through configyaml.

if both config and configyaml has the same key, which value shall be overriden?
I am afraid this hybrid mode will cause more confusion, and increase the chance of making mistakes

@yandongxiao
Copy link
Collaborator

‌‌‌‌‌‌‌I think there is a backward compatibility issue here. That is, if the user has set a custom config by config and then upgrades to use the latest helm chart, because the value of configyaml is always not empty, it will cause the user to use the default content of configyaml as the configuration for FE/BE/CN.

I can set configyaml to {} to address this issue. would this solution OK with you?

This is LGTM. The method I mentioned seems quite difficult to implement, and splitting the configuration into two blocks doesn't seem like a good choice.

@yandongxiao
Copy link
Collaborator

‌Can we merge the contents of config and configyaml to generate the final result? This way, there will only be one set of configurations in values.yaml. At the same time, allow users to add incremental configurations through configyaml.

if both config and configyaml has the same key, which value shall be overriden? I am afraid this hybrid mode will cause more confusion, and increase the chance of making mistakes

Agree with you

u
Signed-off-by: Deng Liu <[email protected]>
Signed-off-by: Deng Liu <[email protected]>
u
Signed-off-by: Deng Liu <[email protected]>
Signed-off-by: Deng Liu <[email protected]>
@yandongxiao yandongxiao merged commit 86cbfd4 into StarRocks:main Aug 21, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants