From fdba5cea6b011f284c1b7e50a990f26c61ad982f Mon Sep 17 00:00:00 2001 From: "pierre.geeraert" Date: Mon, 12 Oct 2026 18:08:03 +0100 Subject: [PATCH] forgot the pvc part --- infrastructure/database.tf | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/infrastructure/database.tf b/infrastructure/database.tf index b9aa20c..0f29fd3 100644 --- a/infrastructure/database.tf +++ b/infrastructure/database.tf @@ -67,7 +67,7 @@ resource "kubernetes_deployment_v1" "database-automatic" { volume_mount { mount_path = try(each.value.database.mountPath, "/var/lib/postgresql/") - name = "${each.key}-db-pvc" + name = "${each.key}-db-volume" } dynamic "volume_mount" { @@ -106,7 +106,6 @@ resource "kubernetes_deployment_v1" "database-automatic" { content { name = env.value.value_from.secret_key_ref.name key = env.value.value_from.secret_key_ref.key - # optional = true } } } @@ -120,9 +119,9 @@ resource "kubernetes_deployment_v1" "database-automatic" { volume { - name = "${each.key}-db-pvc" - persistent_volume_claim { - claim_name = "${each.key}-db-pvc" + name = "${each.key}-db-volume" + host_path { + path = try(each.value.database.host_path, join("/", [var.storage_path.main_storage, coalesce(each.value.namespace, each.value.connected_namespace, each.key), join("-", [each.key, "db"])])) } } @@ -131,8 +130,8 @@ resource "kubernetes_deployment_v1" "database-automatic" { content { name = "${each.key}-db-backup" - persistent_volume_claim { - claim_name = "${each.key}-db-backup" + host_path { + path = join("/", [var.storage_path.fast_access,"Backup", coalesce(each.value.namespace, each.value.connected_namespace, each.key), "${each.key}-db-backup"]) } } }