diff --git a/core/database.tf b/core/database.tf index edc79bc..4ab3a74 100644 --- a/core/database.tf +++ b/core/database.tf @@ -43,7 +43,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" { @@ -82,7 +82,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 } } } @@ -96,9 +95,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"])])) } } diff --git a/core/variables.auto.tfvars b/core/variables.auto.tfvars index 122b837..ea233b1 100644 --- a/core/variables.auto.tfvars +++ b/core/variables.auto.tfvars @@ -37,7 +37,7 @@ kubernetes = { gitea = { - enabled = false + #enabled = false #docker = true image = "gitea/gitea:1.27.0" # no service_port: nginx reaches http://gitea:3000 over deployment_network