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
+40 -46
View File
@@ -367,14 +367,11 @@ resource "kubernetes_deployment_v1" "database-automatic" {
} }
volume_mount {
mount_path = "/var/lib/postgresql/data"
name = "${each.key}-db-pvc"
}
dynamic "volume_mount" {
for_each = each.value.pvc != null ? each.value.pvc : {}
content {
mount_path = volume_mount.value.mount_path
name = "${volume_mount.value.name}-pvc"
}
}
@@ -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" {
# for_each = each.value.liveness_http_get != null ? [""] : []
# content {
# port = each.value.liveness_http_get
# path = coalesce(each.value.liveness_http_get_path, "/")
# }
# }
# initial_delay_seconds = 3
# period_seconds = 3
# }
# }
} }
dynamic "http_get" { volume {
for_each = each.value.liveness_http_get != null ? [""] : [] name = "${each.key}-db-pvc"
content {
port = each.value.liveness_http_get
path = coalesce(each.value.liveness_http_get_path, "/")
}
}
initial_delay_seconds = 3
period_seconds = 3
}
}
}
dynamic "volume" {
for_each = each.value.pvc != null ? each.value.pvc : {}
content {
name = "${volume.value.name}-pvc"
persistent_volume_claim { persistent_volume_claim {
claim_name = "${volume.value.name}-pvc" claim_name = "${each.key}-db-pvc"
}
} }
} }