You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by li...@apache.org on 2025/11/06 14:25:19 UTC
(skywalking-banyandb-helm) 01/01: Support data node list in the liaison
This is an automated email from the ASF dual-hosted git repository.
liuhan pushed a commit to branch data-node-list
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb-helm.git
commit 4aaab2e83f721234b9314c9b0a8b8b067cb61748
Author: mrproliu <74...@qq.com>
AuthorDate: Thu Nov 6 23:25:07 2025 +0900
Support data node list in the liaison
---
chart/templates/_helpers.tpl | 30 +++++++++++++++++++++++-
chart/templates/cluster_liaison_statefulset.yaml | 6 ++++-
chart/values.yaml | 6 +++++
test/e2e/values.cluster.yaml | 3 +++
test/e2e/values.lifecycle.yaml | 3 +++
5 files changed, 46 insertions(+), 2 deletions(-)
diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl
index 66029e3..e12a917 100644
--- a/chart/templates/_helpers.tpl
+++ b/chart/templates/_helpers.tpl
@@ -98,4 +98,32 @@ EtcdEndpoints
{{- end }}
- name: BYDB_ETCD_ENDPOINTS
value: "{{- $endpoints | join "," -}}"
-{{- end }}
\ No newline at end of file
+{{- end }}
+
+{{/*
+Generate data node names list based on passing roles
+*/}}
+{{- define "banyandb.dataNodeList" -}}
+{{- $dataNodes := list }}
+{{- $context := index . 0 }}
+{{- $configuredRoles := index . 1 }}
+{{- $fullname := include "banyandb.fullname" $context }}
+{{- range $roleName, $roleConfig := $context.Values.cluster.data.roles }}
+ {{- $shouldInclude := false }}
+ {{- if eq (len $configuredRoles) 0 }}
+ {{- $shouldInclude = true }}
+ {{- else }}
+ {{- if has $roleName $configuredRoles }}
+ {{- $shouldInclude = true }}
+ {{- end }}
+ {{- end }}
+ {{- if $shouldInclude }}
+ {{- $replicas := $roleConfig.replicas | default $context.Values.cluster.data.nodeTemplate.replicas }}
+ {{- range $i := until (int $replicas) }}
+ {{- $nodeName := printf "%s-data-%s-%d" $fullname $roleName $i }}
+ {{- $dataNodes = append $dataNodes $nodeName }}
+ {{- end }}
+ {{- end }}
+{{- end }}
+{{- $dataNodes | join "," -}}
+{{- end }}
diff --git a/chart/templates/cluster_liaison_statefulset.yaml b/chart/templates/cluster_liaison_statefulset.yaml
index 72a0643..fce9358 100644
--- a/chart/templates/cluster_liaison_statefulset.yaml
+++ b/chart/templates/cluster_liaison_statefulset.yaml
@@ -164,6 +164,10 @@ spec:
{{- else }}
{{- include "banyandb.etcdEndpoints" . | nindent 12 }}
{{- end }}
+ {{- if .Values.cluster.liaison.dataNodeListEnv.enabled }}
+ - name: BYDB_DATA_NODE_LIST
+ value: "{{ include "banyandb.dataNodeList" (list . .Values.cluster.liaison.dataNodeListEnv.roles) }}"
+ {{- end }}
{{- range $env := .Values.cluster.liaison.env }}
- name: {{ $env.name }}
value: {{ $env.value }}
@@ -396,4 +400,4 @@ spec:
{{- end }}
{{- end }}
{{- end }}
-{{- end }}
\ No newline at end of file
+{{- end }}
diff --git a/chart/values.yaml b/chart/values.yaml
index 90f425e..75d9390 100644
--- a/chart/values.yaml
+++ b/chart/values.yaml
@@ -276,6 +276,12 @@ cluster:
## @param cluster.liaison.env Environment variables for liaison pods
##
env: []
+ ## Data node list environment configuration
+ ## @param cluster.liaison.dataNodeListEnv.enabled Enable BYDB_DATA_NODE_LIST environment variable
+ dataNodeListEnv:
+ enabled: false
+ ## @param cluster.liaison.dataNodeListEnv.roles List of data roles to include (empty list means all roles)
+ roles: []
## @param cluster.liaison.priorityClassName Priority class name for liaison pods
##
priorityClassName: ""
diff --git a/test/e2e/values.cluster.yaml b/test/e2e/values.cluster.yaml
index 1fe46d1..46b8a11 100644
--- a/test/e2e/values.cluster.yaml
+++ b/test/e2e/values.cluster.yaml
@@ -44,6 +44,9 @@ cluster:
chownUser: 1000
chownGroup: 1000
image: busybox:1.36
+ dataNodeListEnv:
+ enabled: true
+ roles: ["hot"]
# runAsUser: 1000
# runAsGroup: 1000
# fsGroup: 1000
diff --git a/test/e2e/values.lifecycle.yaml b/test/e2e/values.lifecycle.yaml
index c547c6a..999d1dc 100644
--- a/test/e2e/values.lifecycle.yaml
+++ b/test/e2e/values.lifecycle.yaml
@@ -44,6 +44,9 @@ cluster:
chownUser: 1000
chownGroup: 1000
image: busybox:1.36
+ dataNodeListEnv:
+ enabled: true
+ roles: ["hot"]
env:
- name: BYDB_DATA_NODE_SELECTOR
value: "type=hot"