From 51922ba05995492b08c9a59720fdb61c9721abcb Mon Sep 17 00:00:00 2001 From: gonzalezzfelipe Date: Fri, 30 Aug 2024 14:56:44 -0300 Subject: [PATCH] fix: Bootrapping improved --- bootstrap/pgbouncer/main.tf | 10 +++++----- bootstrap/pgbouncer/pg-bouncer.tf | 2 +- bootstrap/postgres/postgres.tf | 3 +-- bootstrap/postgres/postgresql.conf | 6 +++--- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/bootstrap/pgbouncer/main.tf b/bootstrap/pgbouncer/main.tf index 50e59f2..b985a95 100644 --- a/bootstrap/pgbouncer/main.tf +++ b/bootstrap/pgbouncer/main.tf @@ -27,7 +27,7 @@ variable "load_balancer" { } variable "certs_configmap_name" { - type = string + type = string default = "pgbouncer-certs" } @@ -41,22 +41,22 @@ variable "pg_bouncer_user_settings" { } variable "pg_bouncer_auth_user_password" { - type = string + type = string default = "" } variable "postgres_secret_name" { - type = string + type = string default = "" } variable "instance_role" { - type = string + type = string default = "pgbouncer" } variable "postgres_instance_name" { - type = string + type = string default = "postgres-dbsync-v3-ar9" } diff --git a/bootstrap/pgbouncer/pg-bouncer.tf b/bootstrap/pgbouncer/pg-bouncer.tf index 9c51d53..8aa0839 100644 --- a/bootstrap/pgbouncer/pg-bouncer.tf +++ b/bootstrap/pgbouncer/pg-bouncer.tf @@ -10,7 +10,7 @@ resource "kubernetes_deployment_v1" "pgbouncer" { } spec { - replicas = 1 + replicas = var.pg_bouncer_replicas strategy { rolling_update { diff --git a/bootstrap/postgres/postgres.tf b/bootstrap/postgres/postgres.tf index bfa1b06..43fd10f 100644 --- a/bootstrap/postgres/postgres.tf +++ b/bootstrap/postgres/postgres.tf @@ -84,9 +84,8 @@ resource "kubernetes_stateful_set_v1" "postgres" { } volume_mount { - mount_path = "/etc/postgresql/postgresql.conf" + mount_path = "/etc/postgresql" name = "config" - sub_path = "postgresql.conf" } volume_mount { diff --git a/bootstrap/postgres/postgresql.conf b/bootstrap/postgres/postgresql.conf index 4bc0b6e..81be601 100644 --- a/bootstrap/postgres/postgresql.conf +++ b/bootstrap/postgres/postgresql.conf @@ -1,7 +1,7 @@ listen_addresses = '*' -max_connections = 100 -shared_buffers = 12GB -effective_cache_size = 36GB +max_connections = 125 +shared_buffers = 15GB +effective_cache_size = 45GB maintenance_work_mem = 2GB checkpoint_completion_target = 0.9 wal_buffers = 16MB