add module as database is good to go

This commit is contained in:
2024-11-26 14:34:06 +00:00
parent 583d9950bc
commit 164e48b6aa
+38 -44
View File
@@ -367,18 +367,15 @@ resource "kubernetes_deployment_v1" "database-automatic" {
} }
volume_mount {
dynamic "volume_mount" { mount_path = "/var/lib/postgresql/data"
for_each = each.value.pvc != null ? each.value.pvc : {} name = "${each.key}-db-pvc"
content {
mount_path = volume_mount.value.mount_path
name = "${volume_mount.value.name}-pvc"
}
} }
dynamic "env" { dynamic "env" {
for_each = each.value.environment != null ? each.value.environment : {} for_each = each.value.environment != null ? each.value.environment : {}
content { content {
@@ -402,50 +399,47 @@ resource "kubernetes_deployment_v1" "database-automatic" {
} }
resources { # resources {
limits = { # limits = {
cpu = each.value.requirements.limits-cpu # cpu = each.value.requirements.limits-cpu
memory = each.value.requirements.limits-memory # memory = each.value.requirements.limits-memory
} # }
requests = { # requests = {
cpu = each.value.requirements.requests-cpu # cpu = each.value.requirements.requests-cpu
memory = each.value.requirements.requests-memory # memory = each.value.requirements.requests-memory
} # }
} # }
dynamic "liveness_probe" { # dynamic "liveness_probe" {
for_each = each.value.liveness_tcp_socket != null || each.value.liveness_http_get != null ? [""] : [] # for_each = each.value.liveness_tcp_socket != null || each.value.liveness_http_get != null ? [""] : []
content { # content {
dynamic "tcp_socket" { # dynamic "tcp_socket" {
for_each = each.value.liveness_tcp_socket != null ? [""] : [] # for_each = each.value.liveness_tcp_socket != null ? [""] : []
content { # content {
port = each.value.liveness_tcp_socket # port = each.value.liveness_tcp_socket
} # }
} # }
dynamic "http_get" { # dynamic "http_get" {
for_each = each.value.liveness_http_get != null ? [""] : [] # for_each = each.value.liveness_http_get != null ? [""] : []
content { # content {
port = each.value.liveness_http_get # port = each.value.liveness_http_get
path = coalesce(each.value.liveness_http_get_path, "/") # path = coalesce(each.value.liveness_http_get_path, "/")
} # }
} # }
initial_delay_seconds = 3 # initial_delay_seconds = 3
period_seconds = 3 # period_seconds = 3
} # }
} # }
} }
dynamic "volume" { volume {
for_each = each.value.pvc != null ? each.value.pvc : {} name = "${each.key}-db-pvc"
content { persistent_volume_claim {
name = "${volume.value.name}-pvc" claim_name = "${each.key}-db-pvc"
persistent_volume_claim {
claim_name = "${volume.value.name}-pvc"
}
} }
} }