Skip to content

Commit f8465cf

Browse files
fix: Parametrize instance replicas
1 parent 89743f8 commit f8465cf

File tree

5 files changed

+9
-1
lines changed

5 files changed

+9
-1
lines changed

bootstrap/cell/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ module "dbsync_instances" {
8080
dbsync_image_tag = each.value.dbsync_image_tag
8181
node_n2n_tcp_endpoint = each.value.node_n2n_tcp_endpoint
8282
release = each.value.release
83+
replicas = coalesce(each.value.replicas, 1)
8384
topology_zone = coalesce(each.value.topology_zone, var.topology_zone)
8485
sync_status = each.value.sync_status
8586
empty_args = coalesce(each.value.empty_args, false)

bootstrap/cell/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ variable "instances" {
9393
node_n2n_tcp_endpoint = string
9494
release = string
9595
sync_status = string
96+
replicas = optional(number)
9697
enable_postgrest = bool
9798
topology_zone = optional(string)
9899
empty_args = optional(bool, false)

bootstrap/instance/dbsync.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ resource "kubernetes_deployment_v1" "db_sync" {
3333
}
3434

3535
spec {
36-
replicas = 1
36+
replicas = var.replicas
3737

3838
strategy {
3939
type = "Recreate"

bootstrap/instance/main.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ variable "salt" {
2323
type = string
2424
}
2525

26+
variable "replicas" {
27+
type = number
28+
default = 1
29+
}
30+
2631
variable "topology_zone" {}
2732

2833
variable "node_n2n_tcp_endpoint" {

bootstrap/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ variable "cells" {
116116
release = string
117117
sync_status = string
118118
enable_postgrest = bool
119+
replicas = optional(number)
119120
empty_args = optional(bool, false)
120121
custom_config = optional(bool, true)
121122
network_env_var = optional(string, false)

0 commit comments

Comments
 (0)