This commit is contained in:
2024-11-18 17:14:27 +00:00
parent 8890d057cb
commit d0c23e2aaf
2 changed files with 8 additions and 7 deletions
+2 -5
View File
@@ -20,7 +20,7 @@ variable "kubernetes" {
mount_path = string
})))
environment = optional(map(object({
name = string
name = optional(string)
value = optional(string)
value_from = optional(object({
secret_key_ref = object({
@@ -198,6 +198,7 @@ resource "kubernetes_deployment_v1" "automatic" {
for_each = each.value.environment != null ? each.value.environment : {}
content {
name = env.key
value = env.value.value != null ? env.value.value : null
dynamic "value_from" {
for_each = env.value.value_from != null ? env.value.value_from : {}
content {
@@ -211,10 +212,6 @@ resource "kubernetes_deployment_v1" "automatic" {
}
}
# value = env.value
# value_from = {
# secret_key_ref = {
# name = test } }
}
}
+5 -1
View File
@@ -34,7 +34,7 @@ kubernetes = {
# environment_variables = { PORT = 80, test = 22 }
environment = {
MY_VAR = {
name = "MY_VAR"
name = "MY_VARS"
value_from = {
secret_key_ref = {
name = "my_secret"
@@ -42,6 +42,10 @@ kubernetes = {
}
}
}
DEUX_VAR = {
name = "var-deux"
value = "valeur"
}
}
pvc = {
onitamadeux = {