This is an automated email from the ASF dual-hosted git repository.
hanahmily pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb-helm.git
The following commit(s) were added to refs/heads/master by this push:
new 84d1dcb Support node discovery configuration in cluster mode (#44)
84d1dcb is described below
commit 84d1dcbc6fe03123c2bb16cf4f0c6d80519f1951
Author: mrproliu <[email protected]>
AuthorDate: Tue Jan 13 11:54:30 2026 +0800
Support node discovery configuration in cluster mode (#44)
* Support node discovery configuration in cluster mode
---
.github/workflows/e2e.ci.yaml | 2 +
CHANGES.md | 7 +
chart/templates/_helpers.tpl | 174 +++++++++++++++++++++
chart/templates/cluster_data_statefulset.yaml | 28 +++-
chart/templates/cluster_liaison_statefulset.yaml | 21 ++-
chart/templates/node_discovery_file_configmap.yaml | 38 +++++
chart/values-lifecycle.yaml | 98 ++++++++++++
chart/values.yaml | 98 ++++++++++++
doc/parameters.md | 43 ++++-
test/e2e/e2e-banyandb-node-registry-dns.yaml | 73 +++++++++
test/e2e/expected/nodes-data.yaml | 67 ++++++++
test/e2e/expected/nodes-liaison.yaml | 109 +++++++++++++
test/e2e/values.dns.registry.yaml | 119 ++++++++++++++
13 files changed, 870 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/e2e.ci.yaml b/.github/workflows/e2e.ci.yaml
index ea0fb9f..2157249 100644
--- a/.github/workflows/e2e.ci.yaml
+++ b/.github/workflows/e2e.ci.yaml
@@ -41,6 +41,8 @@ jobs:
config: test/e2e/e2e-banyandb-cluster.yaml
- name: Run Skywalking E2E Test (BanyanDB lifecycle as database)
config: test/e2e/e2e-banyandb-lifecycle.yaml
+ - name: Run Skywalking E2E Test (BanyanDB DNS node registry)
+ config: test/e2e/e2e-banyandb-node-registry-dns.yaml
name: ${{ matrix.test.name }}
env:
OAP_TAG: 79860ca5c76a77bbd93e76ce4861b24707dd5ee3
diff --git a/CHANGES.md b/CHANGES.md
index da5aac9..2fbcfbb 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -2,6 +2,13 @@ Changes by Version
==================
Release Notes.
+0.6.0
+-----------------
+
+#### Features
+
+- Support configure node discovery in cluster mode.
+
0.5.3
-----------------
diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl
index 5d8f674..8b44843 100644
--- a/chart/templates/_helpers.tpl
+++ b/chart/templates/_helpers.tpl
@@ -124,3 +124,177 @@ Generate data node names list for "hot" role only
{{- end }}
{{- $dataNodes | join "," -}}
{{- end }}
+
+{{/*
+Generate DNS SRV address for a component
+Format: _<port-name>._<proto>.<service-name>.<namespace>.svc.cluster.local
+*/}}
+{{- define "banyandb.dnsSrvAddress" -}}
+{{- $component := .component }}
+{{- $role := .role }}
+{{- $fullname := include "banyandb.fullname" .root }}
+{{- $namespace := .root.Release.Namespace }}
+{{- $serviceName := "" }}
+{{- $portName := "grpc" }}
+{{- if eq $component "liaison" }}
+ {{- $serviceName = printf "%s-liaison-headless" $fullname }}
+ {{- $portName = "internal-grpc" }}
+{{- else if eq $component "data" }}
+ {{- $serviceName = printf "%s-data-%s-headless" $fullname $role }}
+{{- end }}
+{{- printf "_%s._tcp.%s.%s.svc.cluster.local" $portName $serviceName
$namespace }}
+{{- end }}
+
+{{/*
+Generate all DNS SRV addresses for node discovery
+Returns comma-separated list of SRV addresses
+*/}}
+{{- define "banyandb.allDnsSrvAddresses" -}}
+{{- $addresses := list }}
+{{- /* Add liaison SRV address */}}
+{{- $liaisonSrv := include "banyandb.dnsSrvAddress" (dict "root" . "component"
"liaison") }}
+{{- $addresses = append $addresses $liaisonSrv }}
+{{- /* Add data node SRV addresses for each role */}}
+{{- range $roleName, $roleConfig := .Values.cluster.data.roles }}
+ {{- $dataSrv := include "banyandb.dnsSrvAddress" (dict "root" $ "component"
"data" "role" $roleName) }}
+ {{- $addresses = append $addresses $dataSrv }}
+{{- end }}
+{{- $addresses | join "," }}
+{{- end }}
+
+{{/*
+Generate node discovery environment variables for a component
+*/}}
+{{- define "banyandb.nodeDiscoveryEnv" -}}
+{{- $config := .root.Values.cluster.nodeDiscovery | default dict }}
+{{- $mode := $config.mode | default "etcd" }}
+
+- name: BYDB_NODE_DISCOVERY_MODE
+ value: {{ $mode | quote }}
+
+{{- if eq $mode "etcd" }}
+{{- /* Etcd mode configuration */}}
+{{- $etcdClient := index .root.Values "etcd-client" | default dict }}
+{{- if $etcdClient.namespace }}
+- name: BYDB_NAMESPACE
+ value: {{ $etcdClient.namespace | quote }}
+{{- end }}
+{{- if $etcdClient.nodeDiscoveryTimeout }}
+- name: BYDB_NODE_DISCOVERY_TIMEOUT
+ value: {{ $etcdClient.nodeDiscoveryTimeout | quote }}
+{{- end }}
+{{- if $etcdClient.fullSyncInterval }}
+- name: BYDB_ETCD_FULL_SYNC_INTERVAL
+ value: {{ $etcdClient.fullSyncInterval | quote }}
+{{- end }}
+
+{{- else if eq $mode "dns" }}
+{{- /* DNS mode configuration */}}
+{{- /* Always auto-generate SRV addresses for all data nodes */}}
+{{- $srvAddresses := include "banyandb.allDnsSrvAddresses" .root }}
+{{- if $srvAddresses }}
+- name: BYDB_NODE_DISCOVERY_DNS_SRV_ADDRESSES
+ value: {{ $srvAddresses | quote }}
+{{- end }}
+
+{{- if $config.dns.fetchInitInterval }}
+- name: BYDB_NODE_DISCOVERY_DNS_FETCH_INIT_INTERVAL
+ value: {{ $config.dns.fetchInitInterval | quote }}
+{{- end }}
+{{- if $config.dns.fetchInitDuration }}
+- name: BYDB_NODE_DISCOVERY_DNS_FETCH_INIT_DURATION
+ value: {{ $config.dns.fetchInitDuration | quote }}
+{{- end }}
+{{- if $config.dns.fetchInterval }}
+- name: BYDB_NODE_DISCOVERY_DNS_FETCH_INTERVAL
+ value: {{ $config.dns.fetchInterval | quote }}
+{{- end }}
+{{- if $config.dns.grpcTimeout }}
+- name: BYDB_NODE_DISCOVERY_GRPC_TIMEOUT
+ value: {{ $config.dns.grpcTimeout | quote }}
+{{- end }}
+
+{{- /* Auto-generate TLS configuration based on existing gRPC TLS settings */}}
+{{- $tlsEnabled := false }}
+{{- $caCerts := list }}
+{{- /* Check liaison TLS */}}
+{{- if and .root.Values.cluster.liaison .root.Values.cluster.liaison.tls
.root.Values.cluster.liaison.tls.grpcSecretName }}
+ {{- $tlsEnabled = true }}
+ {{- $caCerts = append $caCerts (printf "/etc/tls/%s/ca.crt"
.root.Values.cluster.liaison.tls.grpcSecretName) }}
+{{- end }}
+{{- /* Check data nodes TLS for each role */}}
+{{- range $roleName, $roleConfig := .root.Values.cluster.data.roles }}
+ {{- if and $roleConfig.tls $roleConfig.tls.grpcSecretName }}
+ {{- $tlsEnabled = true }}
+ {{- $caCerts = append $caCerts (printf "/etc/tls/%s/ca.crt"
$roleConfig.tls.grpcSecretName) }}
+ {{- else if and $.root.Values.cluster.data.nodeTemplate.tls
$.root.Values.cluster.data.nodeTemplate.tls.grpcSecretName }}
+ {{- $tlsEnabled = true }}
+ {{- $caCerts = append $caCerts (printf "/etc/tls/%s/ca.crt"
$.root.Values.cluster.data.nodeTemplate.tls.grpcSecretName) }}
+ {{- end }}
+{{- end }}
+
+{{- if $tlsEnabled }}
+- name: BYDB_NODE_DISCOVERY_DNS_TLS
+ value: "true"
+{{- if $caCerts }}
+- name: BYDB_NODE_DISCOVERY_DNS_CA_CERTS
+ value: {{ $caCerts | join "," | quote }}
+{{- end }}
+{{- end }}
+{{- else if eq $mode "file" }}
+{{- $fileConfig := $config.file | default dict }}
+- name: BYDB_NODE_DISCOVERY_FILE_PATH
+ value: "/etc/banyandb/node-discovery/nodes.yaml"
+{{- if $fileConfig.fetchInterval }}
+- name: BYDB_NODE_DISCOVERY_FILE_FETCH_INTERVAL
+ value: {{ $fileConfig.fetchInterval | quote }}
+{{- end }}
+{{- if $fileConfig.retryInitialInterval }}
+- name: BYDB_NODE_DISCOVERY_FILE_RETRY_INITIAL_INTERVAL
+ value: {{ $fileConfig.retryInitialInterval | quote }}
+{{- end }}
+{{- if $fileConfig.retryMaxInterval }}
+- name: BYDB_NODE_DISCOVERY_FILE_RETRY_MAX_INTERVAL
+ value: {{ $fileConfig.retryMaxInterval | quote }}
+{{- end }}
+{{- if $fileConfig.retryMultiplier }}
+- name: BYDB_NODE_DISCOVERY_FILE_RETRY_MULTIPLIER
+ value: {{ $fileConfig.retryMultiplier | quote }}
+{{- end }}
+{{- if $fileConfig.grpcTimeout }}
+- name: BYDB_NODE_DISCOVERY_GRPC_TIMEOUT
+ value: {{ $fileConfig.grpcTimeout | quote }}
+{{- end }}
+{{- end }}
+{{- end }}
+
+{{/*
+Resolve ConfigMap name for file-based node discovery
+*/}}
+{{- define "banyandb.nodeDiscoveryFileConfigMapName" -}}
+{{- $root := .root | default . }}
+{{- $config := $root.Values.cluster.nodeDiscovery | default dict }}
+{{- $mode := $config.mode | default "etcd" }}
+{{- $file := $config.file | default dict }}
+{{- $cm := $file.configMap | default dict }}
+{{- if $cm.existingName }}
+{{- $cm.existingName }}
+{{- else if $cm.content }}
+ {{- printf "%s-node-discovery" (include "banyandb.fullname" $root) }}
+{{- else if eq $mode "file" }}
+ {{- fail "cluster.nodeDiscovery.file.configMap.existingName or content must
be set when cluster.nodeDiscovery.mode=file" }}
+{{- else }}
+{{- "" }}
+{{- end }}
+{{- end }}
+
+{{/*
+Resolve discovery file data key
+*/}}
+{{- define "banyandb.nodeDiscoveryFileKey" -}}
+{{- $root := .root | default . }}
+{{- $nodeDiscovery := $root.Values.cluster.nodeDiscovery | default dict }}
+{{- $file := $nodeDiscovery.file | default dict }}
+{{- $cm := $file.configMap | default dict }}
+{{- default "nodes.yaml" $cm.key }}
+{{- end }}
diff --git a/chart/templates/cluster_data_statefulset.yaml
b/chart/templates/cluster_data_statefulset.yaml
index 9db3538..6bc33de 100644
--- a/chart/templates/cluster_data_statefulset.yaml
+++ b/chart/templates/cluster_data_statefulset.yaml
@@ -16,6 +16,9 @@ limitations under the License.
*/}}
{{- if and .Values.cluster.enabled .Values.cluster.data }}
+{{- $nodeDiscovery := .Values.cluster.nodeDiscovery | default dict }}
+{{- $nodeDiscoveryMode := default "etcd" $nodeDiscovery.mode }}
+{{- $nodeDiscoveryFileMode := eq $nodeDiscoveryMode "file" }}
{{- $nodeTemplate := .Values.cluster.data.nodeTemplate }}
{{- range $roleName, $roleConfig := .Values.cluster.data.roles }}
{{- /* Merge nodeTemplate with role-specific config */}}
@@ -193,10 +196,11 @@ spec:
{{- else }}
{{- include "banyandb.etcdEndpoints" $ | nindent 12 }}
{{- end }}
+ {{- include "banyandb.nodeDiscoveryEnv" (dict "root" $) | nindent
12 }}
{{- $mergedEnv := concat $.Values.cluster.data.nodeTemplate.env
$roleConfig.env }}
{{- range $env := $mergedEnv }}
- name: {{ $env.name }}
- value: {{ $env.value }}
+ value: {{ .value | toString | quote }}
{{- end }}
args:
@@ -256,7 +260,7 @@ spec:
{{- end }}
{{- end }}
- {{- if or $.Values.storage.data.enabled $roleConfig.tls }}
+ {{- if or $.Values.storage.data.enabled $roleConfig.tls
$nodeDiscoveryFileMode }}
volumeMounts:
{{- if $.Values.storage.data.enabled }}
{{- range $claim := $.Values.storage.data.persistentVolumeClaims }}
@@ -288,6 +292,11 @@ spec:
name: {{ $roleConfig.tls.etcdSecretName }}-volume
{{- end }}
{{- end }}
+ {{- if $nodeDiscoveryFileMode }}
+ - mountPath: /etc/banyandb/node-discovery
+ name: node-discovery-file
+ readOnly: true
+ {{- end }}
{{- end }}
{{- if $roleConfig.backupSidecar.enabled }}
- name: backup
@@ -362,7 +371,8 @@ spec:
value: "{{- $.Values.cluster.etcdEndpoints | join "," -}}"
{{- else }}
{{- include "banyandb.etcdEndpoints" $ | nindent 12 }}
- {{- end }}
+ {{- end }}
+ {{- include "banyandb.nodeDiscoveryEnv" (dict "root" $) | nindent
12 }}
command:
- "/lifecycle"
- "--schedule={{ $roleConfig.lifecycleSidecar.schedule }}"
@@ -434,8 +444,9 @@ spec:
{{- end }}
{{- end }}
- {{- if $roleConfig.tls }}
+ {{- if or $roleConfig.tls $nodeDiscoveryFileMode }}
volumes:
+ {{- if $roleConfig.tls }}
{{- if $roleConfig.tls.grpcSecretName }}
- name: {{ $roleConfig.tls.grpcSecretName }}-volume
secret:
@@ -446,6 +457,15 @@ spec:
secret:
secretName: {{ $roleConfig.tls.etcdSecretName }}
{{- end }}
+ {{- end }}
+ {{- if $nodeDiscoveryFileMode }}
+ - name: node-discovery-file
+ configMap:
+ name: {{ include "banyandb.nodeDiscoveryFileConfigMapName" $ }}
+ items:
+ - key: {{ include "banyandb.nodeDiscoveryFileKey" $ }}
+ path: nodes.yaml
+ {{- end }}
{{- end }}
{{- if $roleConfig.tolerations }}
diff --git a/chart/templates/cluster_liaison_statefulset.yaml
b/chart/templates/cluster_liaison_statefulset.yaml
index 705e903..a7e56d9 100644
--- a/chart/templates/cluster_liaison_statefulset.yaml
+++ b/chart/templates/cluster_liaison_statefulset.yaml
@@ -16,6 +16,9 @@ limitations under the License.
*/}}
{{- if and .Values.cluster.enabled .Values.cluster.liaison }}
+{{- $nodeDiscovery := .Values.cluster.nodeDiscovery | default dict }}
+{{- $nodeDiscoveryMode := default "etcd" $nodeDiscovery.mode }}
+{{- $nodeDiscoveryFileMode := eq $nodeDiscoveryMode "file" }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
@@ -164,6 +167,7 @@ spec:
{{- else }}
{{- include "banyandb.etcdEndpoints" . | nindent 12 }}
{{- end }}
+ {{- include "banyandb.nodeDiscoveryEnv" (dict "root" .) | nindent
12 }}
{{- if include "banyandb.hasDataNodeListValue" . }}
- name: BYDB_DATA_NODE_LIST
value: "{{ include "banyandb.dataNodeListValue" . }}"
@@ -246,7 +250,7 @@ spec:
{{- end }}
{{- end }}
- {{- if or .Values.storage.liaison.enabled
.Values.cluster.liaison.tls .Values.auth.enabled }}
+ {{- if or .Values.storage.liaison.enabled
.Values.cluster.liaison.tls .Values.auth.enabled $nodeDiscoveryFileMode }}
volumeMounts:
{{- if .Values.storage.liaison.enabled }}
{{- range $claim := .Values.storage.liaison.persistentVolumeClaims
}}
@@ -275,9 +279,14 @@ spec:
- mountPath: /etc/banyandb
name: banyandb-auth-writable
{{- end }}
+ {{- if $nodeDiscoveryFileMode }}
+ - mountPath: /etc/banyandb/node-discovery
+ name: node-discovery-file
+ readOnly: true
+ {{- end }}
{{- end }}
- {{- if or .Values.cluster.liaison.tls .Values.auth.enabled }}
+ {{- if or .Values.cluster.liaison.tls .Values.auth.enabled
$nodeDiscoveryFileMode }}
volumes:
{{- if .Values.cluster.liaison.tls }}
{{- if .Values.cluster.liaison.tls.grpcSecretName }}
@@ -296,6 +305,14 @@ spec:
secretName: {{ .Values.cluster.liaison.tls.httpSecretName }}
{{- end }}
{{- end }}
+ {{- if $nodeDiscoveryFileMode }}
+ - name: node-discovery-file
+ configMap:
+ name: {{ include "banyandb.nodeDiscoveryFileConfigMapName" . }}
+ items:
+ - key: {{ include "banyandb.nodeDiscoveryFileKey" . }}
+ path: nodes.yaml
+ {{- end }}
{{- if .Values.auth.enabled }}
{{- $useExisting := ne .Values.auth.existingSecret "" }}
{{- $authSecret := ternary .Values.auth.existingSecret (printf
"%s-auth" (include "banyandb.fullname" .)) $useExisting }}
diff --git a/chart/templates/node_discovery_file_configmap.yaml
b/chart/templates/node_discovery_file_configmap.yaml
new file mode 100644
index 0000000..c631e96
--- /dev/null
+++ b/chart/templates/node_discovery_file_configmap.yaml
@@ -0,0 +1,38 @@
+{{/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/}}
+
+{{- if and .Values.cluster.enabled .Values.cluster.nodeDiscovery }}
+{{- if eq (default "etcd" .Values.cluster.nodeDiscovery.mode) "file" }}
+{{- $nodeDiscovery := .Values.cluster.nodeDiscovery }}
+{{- $fileConfig := $nodeDiscovery.file | default dict }}
+{{- $cm := $fileConfig.configMap | default dict }}
+{{- if and (not $cm.existingName) $cm.content }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ include "banyandb.nodeDiscoveryFileConfigMapName" . }}
+ labels: {{ include "banyandb.labels" . | nindent 4 }}
+data:
+ {{ include "banyandb.nodeDiscoveryFileKey" . }}: |
+{{- if kindIs "string" $cm.content }}
+{{ $cm.content | nindent 4 }}
+{{- else }}
+{{ toYaml $cm.content | nindent 4 }}
+{{- end }}
+{{- end }}
+{{- end }}
+{{- end }}
diff --git a/chart/values-lifecycle.yaml b/chart/values-lifecycle.yaml
index 1ab751b..eb52945 100644
--- a/chart/values-lifecycle.yaml
+++ b/chart/values-lifecycle.yaml
@@ -40,6 +40,24 @@ image:
##
pullPolicy: IfNotPresent
+## @section Etcd Client Configuration for Node Discovery
+##
+etcd-client:
+ ## @param etcd-client.namespace Namespace in etcd for node registration
+ ## Default: banyandb
+ ##
+ namespace: "banyandb"
+
+ ## @param etcd-client.nodeDiscoveryTimeout Timeout for node discovery
+ ## Default: 2m
+ ##
+ nodeDiscoveryTimeout: "2m"
+
+ ## @param etcd-client.fullSyncInterval Interval for full state
synchronization
+ ## Default: 30m
+ ##
+ fullSyncInterval: "30m"
+
## @section Configuration for standalone deployment
##
standalone:
@@ -207,6 +225,86 @@ cluster:
## @param cluster.etcdEndpoints List of etcd endpoints
##
etcdEndpoints: []
+
+ ## @section Node Discovery Configuration for Service Discovery
+ ##
+ nodeDiscovery:
+ ## @param cluster.nodeDiscovery.mode Node discovery mode (etcd, dns, file)
+ ## Default: dns
+ ##
+ mode: "dns"
+
+ ## @section DNS Mode Configuration
+ ##
+ dns:
+ ## @param cluster.nodeDiscovery.dns.fetchInitInterval Query interval
during initialization
+ ## Default: 5s
+ ##
+ fetchInitInterval: "5s"
+
+ ## @param cluster.nodeDiscovery.dns.fetchInitDuration Duration of
initialization phase
+ ## Default: 5m
+ ##
+ fetchInitDuration: "5m"
+
+ ## @param cluster.nodeDiscovery.dns.fetchInterval Query interval after
initialization
+ ## Default: 15s
+ ##
+ fetchInterval: "15s"
+
+ ## @param cluster.nodeDiscovery.dns.grpcTimeout Timeout for gRPC
metadata fetch
+ ## Default: 5s
+ ##
+ grpcTimeout: "5s"
+
+ ## @section File Mode Configuration
+ ##
+ file:
+ ## @param cluster.nodeDiscovery.file.grpcTimeout Timeout for metadata
fetches over gRPC while using file discovery
+ ## Default: 5s
+ ##
+ grpcTimeout: "5s"
+
+ ## @param cluster.nodeDiscovery.file.fetchInterval Interval to poll and
reload the discovery file
+ ## Default: 5m
+ ##
+ fetchInterval: "5m"
+
+ ## @param cluster.nodeDiscovery.file.retryInitialInterval Initial retry
interval for failed node fetches metadata
+ ## Default: 1s
+ ##
+ retryInitialInterval: "1s"
+
+ ## @param cluster.nodeDiscovery.file.retryMaxInterval Maximum retry
interval for failed node fetches metadata
+ ## Default: 2m
+ ##
+ retryMaxInterval: "2m"
+
+ ## @param cluster.nodeDiscovery.file.retryMultiplier Backoff multiplier
applied between retries fetches metadata
+ ## Default: 2.0
+ ##
+ retryMultiplier: 2.0
+
+ ## @section Discovery file ConfigMap settings
+ ##
+ configMap:
+ ## @param cluster.nodeDiscovery.file.configMap.existingName Existing
ConfigMap name to mount as discovery file
+ ##
+ existingName: ""
+
+ ## @param cluster.nodeDiscovery.file.configMap.key Data key inside the
ConfigMap that stores the discovery file
+ ## Default: nodes.yaml
+ ##
+ key: "nodes.yaml"
+
+ ## @param cluster.nodeDiscovery.file.configMap.content Inline YAML
used to create the ConfigMap when existingName is empty
+ ## Example:
+ ## nodes:
+ ## - name: liaison-0
+ ## grpc_address: liaison:18912
+ ##
+ content: ""
+
## @section Configuration for liaison component
##
liaison:
diff --git a/chart/values.yaml b/chart/values.yaml
index 90f425e..8d87a02 100644
--- a/chart/values.yaml
+++ b/chart/values.yaml
@@ -74,6 +74,24 @@ auth:
##
users: []
+## @section Etcd Client Configuration for Node Discovery
+##
+etcd-client:
+ ## @param etcd-client.namespace Namespace in etcd for node registration
+ ## Default: banyandb
+ ##
+ namespace: "banyandb"
+
+ ## @param etcd-client.nodeDiscoveryTimeout Timeout for node discovery
+ ## Default: 2m
+ ##
+ nodeDiscoveryTimeout: "2m"
+
+ ## @param etcd-client.fullSyncInterval Interval for full state
synchronization
+ ## Default: 30m
+ ##
+ fullSyncInterval: "30m"
+
## @section Configuration for standalone deployment
##
standalone:
@@ -248,6 +266,86 @@ cluster:
## @param cluster.etcdEndpoints List of etcd endpoints
##
etcdEndpoints: []
+
+ ## @section Node Discovery Configuration for Service Discovery
+ ##
+ nodeDiscovery:
+ ## @param cluster.nodeDiscovery.mode Node discovery mode (etcd, dns, file)
+ ## Default: dns
+ ##
+ mode: "dns"
+
+ ## @section DNS Mode Configuration
+ ##
+ dns:
+ ## @param cluster.nodeDiscovery.dns.fetchInitInterval Query interval
during initialization
+ ## Default: 5s
+ ##
+ fetchInitInterval: "5s"
+
+ ## @param cluster.nodeDiscovery.dns.fetchInitDuration Duration of
initialization phase
+ ## Default: 5m
+ ##
+ fetchInitDuration: "5m"
+
+ ## @param cluster.nodeDiscovery.dns.fetchInterval Query interval after
initialization
+ ## Default: 15s
+ ##
+ fetchInterval: "15s"
+
+ ## @param cluster.nodeDiscovery.dns.grpcTimeout Timeout for gRPC
metadata fetch
+ ## Default: 5s
+ ##
+ grpcTimeout: "5s"
+
+ ## @section File Mode Configuration
+ ##
+ file:
+ ## @param cluster.nodeDiscovery.file.grpcTimeout Timeout for metadata
fetches over gRPC while using file discovery
+ ## Default: 5s
+ ##
+ grpcTimeout: "5s"
+
+ ## @param cluster.nodeDiscovery.file.fetchInterval Interval to poll and
reload the discovery file
+ ## Default: 5m
+ ##
+ fetchInterval: "5m"
+
+ ## @param cluster.nodeDiscovery.file.retryInitialInterval Initial retry
interval for failed node fetches metadata
+ ## Default: 1s
+ ##
+ retryInitialInterval: "1s"
+
+ ## @param cluster.nodeDiscovery.file.retryMaxInterval Maximum retry
interval for failed node fetches metadata
+ ## Default: 2m
+ ##
+ retryMaxInterval: "2m"
+
+ ## @param cluster.nodeDiscovery.file.retryMultiplier Backoff multiplier
applied between retries fetches metadata
+ ## Default: 2.0
+ ##
+ retryMultiplier: 2.0
+
+ ## @section Discovery file ConfigMap settings
+ ##
+ configMap:
+ ## @param cluster.nodeDiscovery.file.configMap.existingName Existing
ConfigMap name to mount as discovery file
+ ##
+ existingName: ""
+
+ ## @param cluster.nodeDiscovery.file.configMap.key Data key inside the
ConfigMap that stores the discovery file
+ ## Default: nodes.yaml
+ ##
+ key: "nodes.yaml"
+
+ ## @param cluster.nodeDiscovery.file.configMap.content Inline YAML
used to create the ConfigMap when existingName is empty
+ ## Example:
+ ## nodes:
+ ## - name: liaison-0
+ ## grpc_address: liaison:18912
+ ##
+ content: ""
+
## @section Configuration for liaison component
##
liaison:
diff --git a/doc/parameters.md b/doc/parameters.md
index 2817aec..120b800 100644
--- a/doc/parameters.md
+++ b/doc/parameters.md
@@ -28,6 +28,14 @@ The content of this document describes the parameters that
can be configured in
| `auth.credentialsFileKey` | Key name in the Secret that stores the
| `credentials.yaml` |
| `auth.users` | List of users to configure when not using
existingSecret | `[]` |
+### Etcd Client Configuration for Node Discovery
+
+| Name | Description
| Value |
+|------------------------------------|-----------------------------------------|------------|
+| `etcd-client.namespace` | Namespace in etcd for node registration
| `banyandb` |
+| `etcd-client.nodeDiscoveryTimeout` | Timeout for node discovery
| `2m` |
+| `etcd-client.fullSyncInterval` | Interval for full state synchronization
| `30m` |
+
### Configuration for standalone deployment
| Name | Description
| Value |
@@ -83,10 +91,43 @@ The content of this document describes the parameters that
can be configured in
### Cluster mode configuration
| Name | Description | Value |
-| ----------------------- | ----------------------------- | ------ |
+|-------------------------|-------------------------------|--------|
| `cluster.enabled` | Enable cluster mode (boolean) | `true` |
| `cluster.etcdEndpoints` | List of etcd endpoints | `[]` |
+### Node Discovery Configuration for Service Discovery
+
+| Name | Description | Value |
+|------------------------------|---------------------------------|--------|
+| `cluster.nodeDiscovery.mode` | Node discovery mode (etcd, dns) | `etcd` |
+
+### DNS Mode Configuration
+
+| Name | Description
| Value |
+|-----------------------------------------------|--------------------------------------|-------|
+| `cluster.nodeDiscovery.dns.fetchInitInterval` | Query interval during
initialization | `5s` |
+| `cluster.nodeDiscovery.dns.fetchInitDuration` | Duration of initialization
phase | `5m` |
+| `cluster.nodeDiscovery.dns.fetchInterval` | Query interval after
initialization | `15s` |
+| `cluster.nodeDiscovery.dns.grpcTimeout` | Timeout for gRPC metadata
fetch | `5s` |
+
+### File Mode Configuration
+
+| Name | Description
| Value |
+|---------------------------------------------------|-------------------------------------------------------------------|-------|
+| `cluster.nodeDiscovery.file.grpcTimeout` | Timeout for metadata
fetches over gRPC while using file discovery | `5s` |
+| `cluster.nodeDiscovery.file.fetchInterval` | Interval to poll and
reload the discovery file | `5m` |
+| `cluster.nodeDiscovery.file.retryInitialInterval` | Initial retry interval
for failed node fetches metadata | `1s` |
+| `cluster.nodeDiscovery.file.retryMaxInterval` | Maximum retry interval
for failed node fetches metadata | `2m` |
+| `cluster.nodeDiscovery.file.retryMultiplier` | Backoff multiplier
applied between retries fetches metadata | `2.0` |
+
+### Discovery file ConfigMap settings
+
+| Name | Description
| Value |
+|-----------------------------------------------------|---------------------------------------------------------------------|--------------|
+| `cluster.nodeDiscovery.file.configMap.existingName` | Existing ConfigMap
name to mount as discovery file | `""` |
+| `cluster.nodeDiscovery.file.configMap.key` | Data key inside the
ConfigMap that stores the discovery file | `nodes.yaml` |
+| `cluster.nodeDiscovery.file.configMap.content` | Inline YAML used to
create the ConfigMap when existingName is empty | `""` |
+
### Configuration for liaison component
| Name | Description
| Value |
diff --git a/test/e2e/e2e-banyandb-node-registry-dns.yaml
b/test/e2e/e2e-banyandb-node-registry-dns.yaml
new file mode 100644
index 0000000..205dfdd
--- /dev/null
+++ b/test/e2e/e2e-banyandb-node-registry-dns.yaml
@@ -0,0 +1,73 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file is used to test BanyanDB with lifecycle features enabled.
+
+setup:
+ env: kind
+ file: kind.yaml
+ init-system-environment: env
+ kind:
+ expose-ports:
+ - namespace: istio-system
+ resource: pod/banyandb-liaison-0
+ port: 17913
+ - namespace: istio-system
+ resource: pod/banyandb-liaison-1
+ port: 17913
+ - namespace: istio-system
+ resource: pod/banyandb-data-hot-0
+ port: 17913
+ - namespace: istio-system
+ resource: pod/banyandb-data-hot-1
+ port: 17913
+ steps:
+ - name: set PATH
+ command: export PATH=/tmp/skywalking-infra-e2e/bin:$PATH
+ - name: install yq
+ command: bash test/e2e/setup-e2e-shell/install.sh yq
+ - name: install swctl
+ command: bash test/e2e/setup-e2e-shell/install.sh swctl
+ - name: install kubectl
+ command: bash test/e2e/setup-e2e-shell/install.sh kubectl
+ - name: Install helm
+ command: bash test/e2e/setup-e2e-shell/install.sh helm
+ - name: Install dependency
+ command: |
+ helm repo add bitnami https://charts.bitnami.com/bitnami
+ cd chart
+ helm dependency update
+ - name: Install BanyanDB with lifecycle features
+ command: helm -n istio-system install banyandb chart/ -f
test/e2e/values.dns.registry.yaml --create-namespace
+ wait:
+ - namespace: istio-system
+ resource: pod
+ for: condition=ready
+ label-selector: app.kubernetes.io/name=banyandb
+ timeout: 25m
+
+verify:
+ retry:
+ count: 20
+ interval: 3s
+ cases:
+ - query: curl -s
http://${pod_banyandb_liaison_0_host}:${pod_banyandb_liaison_0_17913}/api/v1/cluster/state
| yq -P
+ expected: expected/nodes-liaison.yaml
+ - query: curl -s
http://${pod_banyandb_liaison_1_host}:${pod_banyandb_liaison_1_17913}/api/v1/cluster/state
| yq -P
+ expected: expected/nodes-liaison.yaml
+ - query: curl -s
http://${pod_banyandb_data_hot_0_host}:${pod_banyandb_data_hot_0_17913}/api/v1/cluster/state
| yq -P
+ expected: expected/nodes-data.yaml
+ - query: curl -s
http://${pod_banyandb_data_hot_1_host}:${pod_banyandb_data_hot_1_17913}/api/v1/cluster/state
| yq -P
+ expected: expected/nodes-data.yaml
diff --git a/test/e2e/expected/nodes-data.yaml
b/test/e2e/expected/nodes-data.yaml
new file mode 100644
index 0000000..7a436dc
--- /dev/null
+++ b/test/e2e/expected/nodes-data.yaml
@@ -0,0 +1,67 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+routeTables:
+ property:
+ registered:
+ {{- contains .routeTables.property.registered}}
+ - metadata:
+ group: ""
+ name: banyandb-data-hot-0.banyandb-data-hot-headless.istio-system:17912
+ id: 0
+ createRevision: "0"
+ modRevision: "0"
+ roles:
+ - ROLE_META
+ - ROLE_DATA
+ grpcAddress:
banyandb-data-hot-0.banyandb-data-hot-headless.istio-system:17912
+ httpAddress: ""
+ createdAt: {{ notEmpty .createdAt }}
+ labels:
+ type: hot
+ propertyRepairGossipGrpcAddress:
banyandb-data-hot-0.banyandb-data-hot-headless.istio-system:17932
+ - metadata:
+ group: ""
+ name: banyandb-data-hot-1.banyandb-data-hot-headless.istio-system:17912
+ id: 0
+ createRevision: "0"
+ modRevision: "0"
+ roles:
+ - ROLE_META
+ - ROLE_DATA
+ grpcAddress:
banyandb-data-hot-1.banyandb-data-hot-headless.istio-system:17912
+ httpAddress: ""
+ createdAt: {{ notEmpty .createdAt }}
+ labels:
+ type: hot
+ propertyRepairGossipGrpcAddress:
banyandb-data-hot-1.banyandb-data-hot-headless.istio-system:17932
+ {{- end}}
+ active: []
+ evictable: []
diff --git a/test/e2e/expected/nodes-liaison.yaml
b/test/e2e/expected/nodes-liaison.yaml
new file mode 100644
index 0000000..7d5de49
--- /dev/null
+++ b/test/e2e/expected/nodes-liaison.yaml
@@ -0,0 +1,109 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+routeTables:
+ tire1:
+ registered:
+ {{- contains .routeTables.tire1.registered}}
+ - metadata:
+ group: ""
+ name: banyandb-liaison-0.banyandb-liaison-headless.istio-system:18912
+ id: 0
+ createRevision: "0"
+ modRevision: "0"
+ roles:
+ - ROLE_META
+ - ROLE_LIAISON
+ grpcAddress:
banyandb-liaison-0.banyandb-liaison-headless.istio-system:18912
+ httpAddress:
banyandb-liaison-0.banyandb-liaison-headless.istio-system:17913
+ createdAt: {{ notEmpty .createdAt }}
+ labels: {}
+ propertyRepairGossipGrpcAddress: ""
+ - metadata:
+ group: ""
+ name: banyandb-liaison-1.banyandb-liaison-headless.istio-system:18912
+ id: 0
+ createRevision: "0"
+ modRevision: "0"
+ roles:
+ - ROLE_META
+ - ROLE_LIAISON
+ grpcAddress:
banyandb-liaison-1.banyandb-liaison-headless.istio-system:18912
+ httpAddress:
banyandb-liaison-1.banyandb-liaison-headless.istio-system:17913
+ createdAt: {{ notEmpty .createdAt }}
+ labels: {}
+ propertyRepairGossipGrpcAddress: ""
+ {{- end}}
+ active:
+ {{- contains .routeTables.tire1.active}}
+ - banyandb-liaison-0.banyandb-liaison-headless.istio-system:18912
+ - banyandb-liaison-1.banyandb-liaison-headless.istio-system:18912
+ {{- end}}
+ evictable: []
+ tire2:
+ registered:
+ {{- contains .routeTables.tire2.registered}}
+ - metadata:
+ group: ""
+ name: banyandb-data-hot-1.banyandb-data-hot-headless.istio-system:17912
+ id: 0
+ createRevision: "0"
+ modRevision: "0"
+ roles:
+ - ROLE_META
+ - ROLE_DATA
+ grpcAddress:
banyandb-data-hot-1.banyandb-data-hot-headless.istio-system:17912
+ httpAddress: ""
+ createdAt: {{ notEmpty .createdAt }}
+ labels:
+ type: hot
+ propertyRepairGossipGrpcAddress:
banyandb-data-hot-1.banyandb-data-hot-headless.istio-system:17932
+ - metadata:
+ group: ""
+ name: banyandb-data-hot-0.banyandb-data-hot-headless.istio-system:17912
+ id: 0
+ createRevision: "0"
+ modRevision: "0"
+ roles:
+ - ROLE_META
+ - ROLE_DATA
+ grpcAddress:
banyandb-data-hot-0.banyandb-data-hot-headless.istio-system:17912
+ httpAddress: ""
+ createdAt: {{ notEmpty .createdAt }}
+ labels:
+ type: hot
+ propertyRepairGossipGrpcAddress:
banyandb-data-hot-0.banyandb-data-hot-headless.istio-system:17932
+ {{- end}}
+ active:
+ {{- contains .routeTables.tire2.active}}
+ - banyandb-data-hot-1.banyandb-data-hot-headless.istio-system:17912
+ - banyandb-data-hot-0.banyandb-data-hot-headless.istio-system:17912
+ {{- end}}
+ evictable: []
diff --git a/test/e2e/values.dns.registry.yaml
b/test/e2e/values.dns.registry.yaml
new file mode 100644
index 0000000..279b5a4
--- /dev/null
+++ b/test/e2e/values.dns.registry.yaml
@@ -0,0 +1,119 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Default values for banyandb.
+# This is a YAML-formatted file.
+# Declare variables to be passed into your templates.
+
+image:
+ repository: ghcr.io/apache/skywalking-banyandb
+ tag: 8a880f51df7a9f843803b84ca8b6e9ff9d2acfca
+ pullPolicy: IfNotPresent
+
+cluster:
+ enabled: true
+ etcdEndpoints: []
+ nodeDiscovery:
+ mode: "dns"
+ liaison:
+ replicas: 2
+ data:
+ nodeTemplate:
+ replicas: 2
+ env:
+ - name: BYDB_PROPERTY_REPAIR_ENABLED
+ value: "true"
+ roles:
+ hot: {}
+
+storage:
+ data:
+ enabled: true
+ persistentVolumeClaims:
+ - mountTargets: [ "measure", "stream", "property", "trace" ]
+ nodeRole: hot
+ existingClaimName: null
+ claimName: data
+ size: 5Gi
+ accessModes:
+ - ReadWriteOnce
+ storageClass: null
+ volumeMode: Filesystem
+ - mountTargets: [ "backups" ]
+ nodeRole: hot
+ existingClaimName: null
+ claimName: backups
+ size: 5Gi
+ accessModes:
+ - ReadWriteOnce
+ storageClass: null
+ volumeMode: Filesystem
+ liaison:
+ enabled: true
+ persistentVolumeClaims:
+ - mountTargets: [ "measure", "stream", "trace" ]
+ claimName: liaison-data
+ size: 10Gi
+ accessModes:
+ - ReadWriteOnce
+ storageClass: null
+ volumeMode: Filesystem
+ standalone:
+ enabled: false
+ persistentVolumeClaims:
+ - mountTargets: [ "measure", "stream", "property", "trace" ]
+ claimName: standalone-data
+ size: 200Gi
+ accessModes:
+ - ReadWriteOnce
+ storageClass: null
+ volumeMode: Filesystem
+
+serviceAccount:
+ # Specifies whether a service account should be created
+ create: true
+ # Annotations to add to the service account
+ annotations: {}
+ # The name of the service account to use.
+ # If not set and create is true, a name is generated using the fullname
template
+ name: ""
+
+etcd:
+ enabled: true
+ replicaCount: 1
+ auth:
+ rbac:
+ create: true
+ allowNoneAuthentication: false
+ rootPassword: banyandb
+ client:
+ secureTransport: false
+ existingSecret: ""
+ enableAuthentication: false
+ certFilename: tls.crt
+ certKeyFilename: tls.key
+ caFilename: ""
+ # extraEnvVars:
+ # - name: ETCDCTL_CACERT
+ # value: /opt/bitnami/etcd/certs/client/ca.crt
+ token:
+ enabled: true
+ type: simple
+
+fullnameOverride: ""
+nameOverride: "banyandb"
+
+auth:
+ enabled: false