Skip to content

Commit

Permalink
[helm] Align replicas number with number of nodes (#1029)
Browse files Browse the repository at this point in the history
Adapt the number of CRDB nodes based on the provisioned IPs.
  • Loading branch information
barroco authored May 15, 2024
1 parent 38636c3 commit cd08962
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ resource "local_file" "helm_chart_values" {
conf = {
join = var.crdb_external_nodes
cluster-name = var.crdb_cluster_name
single-node = false
single-node = false # Always false. Even with 1 replica, we would expect to keep the ability to pool it with another cluster.
locality = "zone=${var.crdb_locality}"
}

statefulset = {
replicas = length(var.crdb_internal_nodes)
args = [
"--locality-advertise-addr=zone=${var.crdb_locality}@$(hostname -f)",
"--advertise-addr=$${HOSTNAME##*-}.${var.crdb_hostname_suffix}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ metadata:
name: {{.Release.Name}}-core-service
spec:
minReadySeconds: 30
replicas: 3
replicas: {{ len .Values.loadBalancers.cockroachdbNodes }}
selector:
matchLabels:
app: {{.Release.Name}}-core-service
Expand Down
1 change: 1 addition & 0 deletions deploy/services/helm-charts/dss/values.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ cockroachdb:
locality: zone=interuss-example-google-ew1

statefulset:
replicas: 3 # Must match the number of .loadBalancers.cockroachdbNodes items.
args:
- --locality-advertise-addr=zone=interuss-example-google-ew1@$(hostname -f)
- --advertise-addr=${HOSTNAME##*-}.db.example.com
Expand Down

0 comments on commit cd08962

Please sign in to comment.