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
+3 -6
View File
@@ -20,7 +20,7 @@ variable "kubernetes" {
mount_path = string mount_path = string
}))) })))
environment = optional(map(object({ environment = optional(map(object({
name = string name = optional(string)
value = optional(string) value = optional(string)
value_from = optional(object({ value_from = optional(object({
secret_key_ref = object({ secret_key_ref = object({
@@ -197,7 +197,8 @@ resource "kubernetes_deployment_v1" "automatic" {
dynamic "env" { dynamic "env" {
for_each = each.value.environment != null ? each.value.environment : {} for_each = each.value.environment != null ? each.value.environment : {}
content { content {
name = env.key name = env.key
value = env.value.value != null ? env.value.value : null
dynamic "value_from" { dynamic "value_from" {
for_each = env.value.value_from != null ? env.value.value_from : {} for_each = env.value.value_from != null ? env.value.value_from : {}
content { 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_variables = { PORT = 80, test = 22 }
environment = { environment = {
MY_VAR = { MY_VAR = {
name = "MY_VAR" name = "MY_VARS"
value_from = { value_from = {
secret_key_ref = { secret_key_ref = {
name = "my_secret" name = "my_secret"
@@ -42,6 +42,10 @@ kubernetes = {
} }
} }
} }
DEUX_VAR = {
name = "var-deux"
value = "valeur"
}
} }
pvc = { pvc = {
onitamadeux = { onitamadeux = {