clsing brackets
This commit is contained in:
+14
-13
@@ -28,12 +28,12 @@ variable "storage_path" {
|
||||
}
|
||||
|
||||
resource "kubernetes_deployment_v1" "redis-automatic" {
|
||||
for_each = { for key, value in var.kubernetes_input : key => value if value.redis != null && value.enabled == true }
|
||||
for_each = {for key, value in var.kubernetes_input : key => value if value.redis != null && value.enabled == true}
|
||||
|
||||
|
||||
metadata {
|
||||
namespace = coalesce(each.value.namespace, each.value.connected_namespace, each.key)
|
||||
name = "${coalesce(each.value.name, each.key)}-redis"
|
||||
name = "${coalesce(each.value.name, each.key)}-redis"
|
||||
labels = {
|
||||
app = each.key
|
||||
deployment_method = "Terraform"
|
||||
@@ -62,7 +62,7 @@ resource "kubernetes_deployment_v1" "redis-automatic" {
|
||||
spec {
|
||||
container {
|
||||
image = try(each.value.redis.image, "docker.io/library/redis:7")
|
||||
name = "${coalesce(each.value.name, each.key)}-redis"
|
||||
name = "${coalesce(each.value.name, each.key)}-redis"
|
||||
port {
|
||||
|
||||
container_port = 6379
|
||||
@@ -76,9 +76,6 @@ resource "kubernetes_deployment_v1" "redis-automatic" {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
dynamic "env" {
|
||||
for_each = each.value.environment != null ? each.value.environment : {}
|
||||
content {
|
||||
@@ -92,22 +89,26 @@ resource "kubernetes_deployment_v1" "redis-automatic" {
|
||||
content {
|
||||
name = env.value.value_from.secret_key_ref.name
|
||||
key = env.value.value_from.secret_key_ref.key
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
volume {
|
||||
name = "${each.key}-redis-volume"
|
||||
host_path {
|
||||
path = try(each.value.redis.host_path, join("/", [var.storage_path.main_storage, coalesce(each.value.namespace, each.value.connected_namespace, each.key), join("-", [each.key, "redis"])]))
|
||||
volume {
|
||||
name = "${each.key}-redis-volume"
|
||||
host_path {
|
||||
path = try(each.value.redis.host_path, join("/", [
|
||||
var.storage_path.main_storage, coalesce(each.value.namespace, each.value.connected_namespace, each.key),
|
||||
join("-", [each.key, "redis"])
|
||||
]))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user