Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make cluster domain configurable #123

Merged
merged 5 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charts/databend-meta/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.9.7
version: 0.9.8

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "v1.2.615"
appVersion: "v1.2.680"

dependencies:
- name: common
Expand Down
2 changes: 1 addition & 1 deletion charts/databend-meta/templates/_config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ grpc_api_address = "0.0.0.0:{{ .Values.service.ports.grpc }}"
cluster_name = {{ .Values.config.clusterName | quote }}
raft_dir = {{ .Values.config.raft.dir | quote }}
raft_listen_host = "0.0.0.0"
raft_api_port = 28004
raft_api_port = {{ .Values.service.ports.raft }}
max_applied_log_to_keep = 102400
install_snapshot_timeout = 60000
{{- end }}
18 changes: 8 additions & 10 deletions charts/databend-meta/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,26 @@ spec:
echo "initialize leader node";
exec /databend-meta --id ${ID} \
--single \
--raft-advertise-host "${POD_NAME}.{{ $fullName }}.${POD_NAMESPACE}.svc.cluster.local" \
--grpc-api-advertise-host "${POD_NAME}.{{ $fullName }}.${POD_NAMESPACE}.svc.cluster.local" \
--raft-advertise-host "${POD_NAME}.{{ $fullName }}.${POD_NAMESPACE}.svc.{{ .Values.service.clusterDomain }}" \
--grpc-api-advertise-host "${POD_NAME}.{{ $fullName }}.${POD_NAMESPACE}.svc.{{ .Values.service.clusterDomain }}" \
--config-file /etc/databend/meta.yaml
;;
*)
echo "initialize follower node";
exec /databend-meta --id ${ID} \
--join "${NAME}-0.{{ $fullName }}.${POD_NAMESPACE}.svc.cluster.local:28004" \
--raft-advertise-host "${POD_NAME}.{{ $fullName }}.${POD_NAMESPACE}.svc.cluster.local" \
--grpc-api-advertise-host "${POD_NAME}.{{ $fullName }}.${POD_NAMESPACE}.svc.cluster.local" \
--join "${NAME}-0.{{ $fullName }}.${POD_NAMESPACE}.svc.{{ .Values.service.clusterDomain }}:{{ .Values.service.ports.raft }}" \
--raft-advertise-host "${POD_NAME}.{{ $fullName }}.${POD_NAMESPACE}.svc.{{ .Values.service.clusterDomain }}" \
--grpc-api-advertise-host "${POD_NAME}.{{ $fullName }}.${POD_NAMESPACE}.svc.{{ .Values.service.clusterDomain }}" \
--config-file /etc/databend/meta.yaml
;;
esac
{{- else }}
exec /databend-meta --id ${ID} \
{{- range $i := until $replicaCount }}
--join "${NAME}-{{ $i }}.{{ $fullName }}.${POD_NAMESPACE}.svc.cluster.local:28004" \
--join "${NAME}-{{ $i }}.{{ $fullName }}.${POD_NAMESPACE}.svc.{{ .Values.service.clusterDomain }}:{{ .Values.service.ports.raft }}" \
{{- end }}
--raft-advertise-host "${POD_NAME}.{{ $fullName }}.${POD_NAMESPACE}.svc.cluster.local" \
--grpc-api-advertise-host "${POD_NAME}.{{ $fullName }}.${POD_NAMESPACE}.svc.cluster.local" \
--raft-advertise-host "${POD_NAME}.{{ $fullName }}.${POD_NAMESPACE}.svc.{{ .Values.service.clusterDomain }}" \
--grpc-api-advertise-host "${POD_NAME}.{{ $fullName }}.${POD_NAMESPACE}.svc.{{ .Values.service.clusterDomain }}" \
--config-file /etc/databend/meta.yaml
{{- end }}
else
Expand All @@ -92,8 +92,6 @@ spec:
- name: {{ $key }}
containerPort: {{ $val }}
{{- end }}
- name: raft
containerPort: 28004
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
httpGet:
Expand Down
2 changes: 2 additions & 0 deletions charts/databend-meta/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ readinessProbe:

service:
type: ClusterIP
clusterDomain: "cluster.local"
ports:
admin: 28002
raft: 28004
grpc: 9191
# Annotations to add to the service
annotations: {}
Expand Down
4 changes: 2 additions & 2 deletions charts/databend-query/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.11.1
version: 0.11.2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "v1.2.615"
appVersion: "v1.2.680"

dependencies:
- name: common
Expand Down
2 changes: 1 addition & 1 deletion charts/databend-query/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ data:

[meta]
{{- if .Values.config.meta.generateEndpoints }}
endpoints = [{{ range $i := (untilStep 0 (int $.Values.config.meta.replicas) 1) }}"{{ $.Release.Name }}-databend-meta-{{ $i }}.{{ $.Release.Name }}-databend-meta.{{ $.Values.config.meta.namespace | default $.Release.Namespace }}.svc.cluster.local:{{ $.Values.config.meta.port }}",{{ end }}]
endpoints = [{{ range $i := (untilStep 0 (int $.Values.config.meta.replicas) 1) }}"{{ $.Release.Name }}-databend-meta-{{ $i }}.{{ $.Release.Name }}-databend-meta.{{ $.Values.config.meta.namespace | default $.Release.Namespace }}.svc.{{ $.Values.config.meta.clusterDomain }}:{{ $.Values.config.meta.port }}",{{ end }}]
{{- else }}
endpoints = [{{ range .Values.config.meta.endpoints }}{{ . | quote }},{{ end }}]
{{- end }}
Expand Down
9 changes: 6 additions & 3 deletions charts/databend-query/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ replicaCount: 1
# Could be StatefulSet or Deployment
workload: StatefulSet

# By default, the queries are routed to the first node in the StatefulSet, and this node is considered
# By default, the queries are routed to the first node in the StatefulSet, and this node is considered
# as the coordinator. If you want to enable load balance queries across nodes, set this to true. Please
# note that when this is enabled, you can not get the consistent running queries by SHOW PROCESSLIST.
enableLoadBalance: false
Expand Down Expand Up @@ -95,8 +95,8 @@ config:
# # sha1sum: echo -n "password" | sha1sum | cut -d' ' -f1 | xxd -r -p | sha1sum
# authType: double_sha1_password
# authString: 3081f32caef285c232d066033c89a78d88a6d8a5 # databend
# NOTE: use it for on premise session parameters

# NOTE: use it for on premise session parameters
settings:
timezone: "UTC"

Expand All @@ -114,15 +114,18 @@ config:
enabled: false
otlp_endpoint: ""
otlp_protocol: "http"
otlp_labels: {}
profile:
enabled: false
otlp_endpoint: ""
otlp_protocol: "http"
otlp_labels: {}

# [meta]
meta:
# If databend-meta is hosted in the same cluster as databend-data, you can enable this to generate endpoints in a K8s native way.
generateEndpoints: false
clusterDomain: "cluster.local"
# Databend-meta replica count
replicas: 3
# Databend-meta port if you need to change it
Expand Down
Loading