add module as database is good to go
This commit is contained in:
@@ -367,18 +367,15 @@ resource "kubernetes_deployment_v1" "database-automatic" {
|
||||
|
||||
}
|
||||
|
||||
|
||||
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"
|
||||
}
|
||||
volume_mount {
|
||||
mount_path = "/var/lib/postgresql/data"
|
||||
name = "${each.key}-db-pvc"
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
dynamic "env" {
|
||||
for_each = each.value.environment != null ? each.value.environment : {}
|
||||
content {
|
||||
@@ -402,50 +399,47 @@ resource "kubernetes_deployment_v1" "database-automatic" {
|
||||
}
|
||||
|
||||
|
||||
resources {
|
||||
limits = {
|
||||
cpu = each.value.requirements.limits-cpu
|
||||
memory = each.value.requirements.limits-memory
|
||||
}
|
||||
requests = {
|
||||
cpu = each.value.requirements.requests-cpu
|
||||
memory = each.value.requirements.requests-memory
|
||||
}
|
||||
}
|
||||
# resources {
|
||||
# limits = {
|
||||
# cpu = each.value.requirements.limits-cpu
|
||||
# memory = each.value.requirements.limits-memory
|
||||
# }
|
||||
# requests = {
|
||||
# cpu = each.value.requirements.requests-cpu
|
||||
# memory = each.value.requirements.requests-memory
|
||||
# }
|
||||
# }
|
||||
|
||||
dynamic "liveness_probe" {
|
||||
for_each = each.value.liveness_tcp_socket != null || each.value.liveness_http_get != null ? [""] : []
|
||||
content {
|
||||
dynamic "tcp_socket" {
|
||||
for_each = each.value.liveness_tcp_socket != null ? [""] : []
|
||||
content {
|
||||
port = each.value.liveness_tcp_socket
|
||||
}
|
||||
}
|
||||
# dynamic "liveness_probe" {
|
||||
# for_each = each.value.liveness_tcp_socket != null || each.value.liveness_http_get != null ? [""] : []
|
||||
# content {
|
||||
# dynamic "tcp_socket" {
|
||||
# for_each = each.value.liveness_tcp_socket != null ? [""] : []
|
||||
# content {
|
||||
# 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, "/")
|
||||
}
|
||||
}
|
||||
# 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
|
||||
}
|
||||
}
|
||||
# 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 {
|
||||
claim_name = "${volume.value.name}-pvc"
|
||||
}
|
||||
volume {
|
||||
name = "${each.key}-db-pvc"
|
||||
persistent_volume_claim {
|
||||
claim_name = "${each.key}-db-pvc"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user