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: Update tiers #54

Merged
merged 1 commit into from
Nov 19, 2024
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
17 changes: 9 additions & 8 deletions bootstrap/cell/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ module "dbsync_pvc" {
module "dbsync_postgres" {
source = "../postgres"

namespace = var.namespace
db_volume_claim = local.db_volume_claim
instance_name = local.postgres_host
postgres_config_name = local.postgres_config_name
topology_zone = var.topology_zone
postgres_image_tag = var.postgres_image_tag
postgres_secret_name = var.postgres_secret_name
postgres_resources = var.postgres_resources
namespace = var.namespace
db_volume_claim = local.db_volume_claim
instance_name = local.postgres_host
postgres_config_name = local.postgres_config_name
topology_zone = var.topology_zone
postgres_image_tag = var.postgres_image_tag
postgres_secret_name = var.postgres_secret_name
postgres_resources = var.postgres_resources
is_blockfrost_backend = var.is_blockfrost_backend
}

module "dbsync_pgbouncer" {
Expand Down
4 changes: 4 additions & 0 deletions bootstrap/cell/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ variable "topology_zone" {
type = string
}

variable "is_blockfrost_backend" {
type = bool
}

variable "postgres_image_tag" {
type = string
}
Expand Down
11 changes: 6 additions & 5 deletions bootstrap/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ module "dbsync_cells" {
db_volume_claim = each.value.pvc.name

// PG
topology_zone = each.value.postgres.topology_zone
postgres_image_tag = each.value.postgres.image_tag
postgres_secret_name = var.postgres_secret_name
postgres_resources = each.value.postgres.resources
postgres_config_name = each.value.postgres.config_name
topology_zone = each.value.postgres.topology_zone
is_blockfrost_backend = each.value.postgres.is_blockfrost_backend
postgres_image_tag = each.value.postgres.image_tag
postgres_secret_name = var.postgres_secret_name
postgres_resources = each.value.postgres.resources
postgres_config_name = each.value.postgres.config_name

// PGBouncer
pgbouncer_image_tag = var.pgbouncer_image_tag
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/pgbouncer/tiers.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name = "1"
max_connections = 3
[[tiers]]
name = "2"
max_connections = 10
max_connections = 15
[[tiers]]
name = "3"
max_connections = 40
4 changes: 4 additions & 0 deletions bootstrap/postgres/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ variable "topology_zone" {
type = string
}

variable "is_blockfrost_backend" {
type = bool
}

variable "postgres_image_tag" {
type = string
}
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/postgres/postgres.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resource "kubernetes_stateful_set_v1" "postgres" {
labels = {
"demeter.run/instance" = var.instance_name
role = "postgres"
is_blockfrost_backend = "true"
is_blockfrost_backend = var.is_blockfrost_backend ? "true" : "false"
}
}
spec {
Expand Down
7 changes: 4 additions & 3 deletions bootstrap/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ variable "cells" {
name = optional(string)
})
postgres = object({
image_tag = string
topology_zone = string
config_name = optional(string)
image_tag = string
topology_zone = string
is_blockfrost_backend = bool
config_name = optional(string)
resources = object({
limits = object({
cpu = string
Expand Down
Loading