Skip to content

[Feature] Support adding an observer role in FE to improve query load balancing and scale read workloads#734

Open
zhaohehuhu wants to merge 8 commits intoStarRocks:mainfrom
zhaohehuhu:dev-0106
Open

[Feature] Support adding an observer role in FE to improve query load balancing and scale read workloads#734
zhaohehuhu wants to merge 8 commits intoStarRocks:mainfrom
zhaohehuhu:dev-0106

Conversation

@zhaohehuhu
Copy link
Contributor

@zhaohehuhu zhaohehuhu commented Jan 6, 2026

Description

Support adding a read-only observer role in FE via the K8s Operator to scale read capacity and improve query load balancing.

associated with this PR(StarRocks/starrocks#67778)

Related Issue(s)

No.

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).

Signed-off-by: zhaohehuhu <luoyedeyi@163.com>
@zhaohehuhu zhaohehuhu changed the title Support adding observer role Support adding observer role in FE Jan 6, 2026
@zhaohehuhu zhaohehuhu changed the title Support adding observer role in FE Support adding an Observer role in FE via the Operator Jan 6, 2026
Signed-off-by: zhaohehuhu <luoyedeyi@163.com>
@zhaohehuhu
Copy link
Contributor Author

zhaohehuhu commented Jan 7, 2026

@yandongxiao @kevincai plz help review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds support for an Observer role in FE (Frontend) via the Kubernetes Operator to scale read capacity and improve query load balancing. The Observer role is implemented as a configurable field that can be set to specify the number of observer nodes.

Key changes:

  • Added ObserverNumber field to StarRocksFeSpec API with a getter method that defaults to 0
  • Exposed observer number as an environment variable (OBSERVER_NUMBER) to FE pods
  • Updated CRD schemas to include the new observerNumber field
  • Updated Helm chart values.yaml files with commented examples for the new configuration option

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pkg/apis/starrocks/v1/starrockscluster_types.go Adds ObserverNumber field to StarRocksFeSpec and implements GetObserverNumber() method with default value of 0
pkg/apis/starrocks/v1/zz_generated.deepcopy.go Auto-generated deep copy implementation for the new ObserverNumber pointer field
pkg/apis/starrocks/v1/labels.go Adds OBSERVER_NUMBER constant for the environment variable name
pkg/apis/starrocks/v1/load_type.go Minor whitespace cleanup (removed blank lines)
pkg/k8sutils/templates/pod/spec.go Updates Envs function to set OBSERVER_NUMBER environment variable for FE pods using the new field
pkg/k8sutils/templates/pod/spec_test.go Adds test coverage for the OBSERVER_NUMBER environment variable in FE spec
config/crd/bases/starrocks.com_starrocksclusters.yaml Adds observerNumber field definition to the CRD schema
deploy/starrocks.com_starrocksclusters.yaml Adds observerNumber field definition to the deployed CRD schema
helm-charts/charts/kube-starrocks/charts/starrocks/values.yaml Adds commented example for observerNumber configuration
helm-charts/charts/kube-starrocks/values.yaml Adds commented example for observerNumber configuration in parent chart

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kevincai
Copy link
Collaborator

kevincai commented Jan 8, 2026

don't try to use FE_OBSERVER_NUMBER to hack the current fe_entry_point.sh

It is so dangerous that a single improper env var update can ruin the entire cluster.

@zhaohehuhu
Copy link
Contributor Author

don't try to use FE_OBSERVER_NUMBER to hack the current fe_entry_point.sh

It is so dangerous that a single improper env var update can ruin the entire cluster.

Got it. In that case, we may need to add a new FE observer component.

Signed-off-by: zhaohehuhu <luoyedeyi@163.com>
Signed-off-by: zhaohehuhu <luoyedeyi@163.com>
@zhaohehuhu zhaohehuhu changed the title Support adding an Observer role in FE via the Operator Support adding an Observer role in FE to improve query load balancing Jan 12, 2026
@zhaohehuhu zhaohehuhu changed the title Support adding an Observer role in FE to improve query load balancing Support adding an Observer role in FE to improve query load balancing and scale read workloads Jan 12, 2026
Signed-off-by: zhaohehuhu <luoyedeyi@163.com>
Signed-off-by: zhaohehuhu <luoyedeyi@163.com>
@kyle-goodale-klaviyo
Copy link

This is much needed, thank you!

@zhaohehuhu
Copy link
Contributor Author

This is much needed, thank you!

I still need some time to test this feature. Thanks!

@zhaohehuhu zhaohehuhu changed the title Support adding an Observer role in FE to improve query load balancing and scale read workloads [Feature] Support adding an Observer role in FE to improve query load balancing and scale read workloads Jan 14, 2026
@zhaohehuhu zhaohehuhu changed the title [Feature] Support adding an Observer role in FE to improve query load balancing and scale read workloads [Feature] Support adding an observer role in FE to improve query load balancing and scale read workloads Feb 12, 2026
Signed-off-by: zhaohehuhu <luoyedeyi@163.com>
Signed-off-by: zhaohehuhu <luoyedeyi@163.com>
@zhaohehuhu
Copy link
Contributor Author

@kevincai @yandongxiao plz help review. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants