File tree Expand file tree Collapse file tree
controller/build/resource Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -360,7 +360,9 @@ pub fn build_rolegroup_statefulset(
360360 . build ( ) ,
361361 spec : Some ( StatefulSetSpec {
362362 pod_management_policy : Some ( "Parallel" . to_string ( ) ) ,
363- replicas : Some ( i32:: from ( rg. replicas ) ) ,
363+ // Leave `replicas` unset when the role group does not specify a count, so a
364+ // HorizontalPodAutoscaler can own the replica count without the operator fighting it.
365+ replicas : rg. replicas . map ( i32:: from) ,
364366 selector : LabelSelector {
365367 match_labels : Some ( cluster. role_group_selector ( role, role_group_name) . into ( ) ) ,
366368 ..LabelSelector :: default ( )
Original file line number Diff line number Diff line change @@ -514,7 +514,7 @@ impl v1alpha1::DruidCluster {
514514 groups. insert(
515515 role_group_name,
516516 DruidRoleGroupConfig {
517- replicas: validated. replicas. unwrap_or ( 1 ) ,
517+ replicas: validated. replicas,
518518 config: common,
519519 config_overrides: validated. config. config_overrides,
520520 env_overrides,
@@ -668,9 +668,9 @@ fn validate_logging(
668668/// `product_specific_common_config`; the rendered per-file configs (runtime.properties /
669669/// security.properties / jvm.config) are produced later, in the config-map build step.
670670///
671- /// The StatefulSet replicas come from [`RoleGroupConfig::replicas`] (defaulted to 1 during the
672- /// merge), mirroring the hive-operator. Upstream `replicas` should be made optional again so an
673- /// unspecified count can stay HPA-friendly .
671+ /// The StatefulSet replicas come from [`RoleGroupConfig::replicas`], which is optional: an
672+ /// unspecified count is passed through as `None` to the StatefulSet so a HorizontalPodAutoscaler
673+ /// can own the replica count .
674674pub type DruidRoleGroupConfig =
675675 RoleGroupConfig < ValidatedDruidConfig , JavaCommonConfig , DruidConfigOverrides > ;
676676
You can’t perform that action at this time.
0 commit comments