From 42a3b084ae181d85a0df90157cc35441d2153c1b Mon Sep 17 00:00:00 2001 From: jinyang09 Date: Thu, 16 Apr 2026 15:26:22 +0800 Subject: [PATCH] feat: helm support different cg config for ddc --- .../templates/dorisdisaggregatedcluster.yaml | 22 ++++++++++----- helm-charts/doris-disaggregated/values.yaml | 27 +++++++++++++++---- 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/helm-charts/doris-disaggregated/templates/dorisdisaggregatedcluster.yaml b/helm-charts/doris-disaggregated/templates/dorisdisaggregatedcluster.yaml index 9d5bb08f..e54c0638 100644 --- a/helm-charts/doris-disaggregated/templates/dorisdisaggregatedcluster.yaml +++ b/helm-charts/doris-disaggregated/templates/dorisdisaggregatedcluster.yaml @@ -78,16 +78,26 @@ spec: {{- end }} computeGroups: {{- $originalContext := . -}} - {{- range $index, $cgName := .Values.computeGroupNames }} - - uniqueId: {{ $cgName }} - replicas: {{ $originalContext.Values.computeSpec.replicas }} - image: {{ $originalContext.Values.computeSpec.image.repository }}:{{ $originalContext.Values.computeSpec.image.tag }} + {{- range $index, $cg := .Values.computeGroups }} + {{- $replicas := $originalContext.Values.computeSpec.replicas }} + {{- if $cg.replicas }}{{- $replicas = $cg.replicas }}{{- end }} + {{- $imageRepo := $originalContext.Values.computeSpec.image.repository }} + {{- $imageTag := $originalContext.Values.computeSpec.image.tag }} + {{- if $cg.image }} + {{- if $cg.image.repository }}{{- $imageRepo = $cg.image.repository }}{{- end }} + {{- if $cg.image.tag }}{{- $imageTag = $cg.image.tag }}{{- end }} + {{- end }} + {{- $resources := $originalContext.Values.computeSpec.resources }} + {{- if $cg.resources }}{{- $resources = $cg.resources }}{{- end }} + - uniqueId: {{ $cg.name }} + replicas: {{ $replicas }} + image: {{ $imageRepo }}:{{ $imageTag }} {{- if $originalContext.Values.computeSpec.imagePullSecrets }} imagePullSecrets: {{- toYaml $originalContext.Values.computeSpec.imagePullSecrets | nindent 6 }} {{- end }} - {{- if $originalContext.Values.computeSpec.resources }} - {{- toYaml $originalContext.Values.computeSpec.resources | nindent 4 }} + {{- if $resources }} + {{- toYaml $resources | nindent 4 }} {{- end }} configMaps: - name: {{ include "be.configmap.name" . }} diff --git a/helm-charts/doris-disaggregated/values.yaml b/helm-charts/doris-disaggregated/values.yaml index 9438ca36..309cb980 100644 --- a/helm-charts/doris-disaggregated/values.yaml +++ b/helm-charts/doris-disaggregated/values.yaml @@ -102,12 +102,29 @@ feSpec: requests: storage: 200Gi -# specify the names of compute groups. this is required. if config -computeGroupNames: -- test-cg -- test-cg1 +# specify the compute groups to deploy. each entry must have a `name` field (used as uniqueId). +# per-group `replicas`, `image`, and `resources` are optional and override the global computeSpec defaults. +# example with per-group overrides: +# computeGroups: +# - name: test-cg +# - name: test-cg1 +# replicas: 3 +# image: +# repository: apache/doris +# tag: be-3.1.0 +# resources: +# requests: +# cpu: 16 +# memory: 32Gi +# limits: +# cpu: 16 +# memory: 32Gi +computeGroups: +- name: test-cg +- name: test-cg1 -# describe the compute group spec to deploy. +# describe the default compute group spec. values here apply to all groups +# unless overridden per-group via computeGroups[*].replicas / computeGroups[*].image / computeGroups[*].resources. computeSpec: replicas: 2 image: