Skip to content

Commit

Permalink
fix(meta): check bootstrap with replicaCount (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
everpcpc authored Mar 6, 2023
1 parent dd185cd commit 0e07751
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions charts/databend-meta/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,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.5.6
version: 0.6.0

# 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: "v0.9.57-nightly"
appVersion: "v1.0.3-nightly"

dependencies:
- name: common
Expand Down
8 changes: 5 additions & 3 deletions charts/databend-meta/templates/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{- $fullName := include "databend-meta.fullname" . }}
{{- $replicaCount := int .Values.replicaCount }}
{{- $bootstrap := or .Values.bootstrap (eq $replicaCount 1) }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand All @@ -8,7 +10,7 @@ metadata:
spec:
serviceName: {{ $fullName }}
replicas: {{ .Values.replicaCount }}
{{- if .Values.bootstrap }}
{{- if $bootstrap }}
podManagementPolicy: OrderedReady
{{- else }}
podManagementPolicy: Parallel
Expand Down Expand Up @@ -51,7 +53,7 @@ spec:
NAME=${BASH_REMATCH[1]}
ID=${BASH_REMATCH[2]}
echo "ID: $ID" "NAME : $NAME"
{{- if .Values.bootstrap }}
{{- if $bootstrap }}
case ${BASH_REMATCH[2]} in
0)
echo "initialize leader node";
Expand Down Expand Up @@ -104,7 +106,7 @@ spec:
--raft-listen-host ${POD_IP} \
--raft-advertise-host ${POD_NAME}.{{ $fullName }}.${POD_NAMESPACE}.svc.cluster.local \
--grpc-api-advertise-host ${POD_IP} \
{{- range $i := until (int .Values.replicaCount) }}
{{- range $i := until $replicaCount }}
--join ${NAME}-{{ $i }}.{{ $fullName }}.${POD_NAMESPACE}.svc.cluster.local:28004 \
{{- end }}
--config-id ${ID}
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 @@ -20,13 +20,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.4.3
version: 0.5.0

# 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: "v0.9.57-nightly"
appVersion: "v1.0.3-nightly"

dependencies:
- name: minio
Expand Down

0 comments on commit 0e07751

Please sign in to comment.