Terraform v0.11.10
Please list the resources as a list, for example:
env = [{
name = "PORT"
value = "${var.pod_port}"
}
]
env_from = [{
secret_ref {
name = "server"
}
secret_ref {
name = "redis"
}
}]
https://gist.github.com/Anthonyzou/10f620bc8022e6772f5fa146c71c0f82
Multiple secrets get loaded into the deployment
No deployment
terraform applyAlso allow usage of both secret_ref and config_map_ref together.
env_from {
config_map_ref {
name = "config-map"
}
secret_ref {
name = "secret"
}
}
Error: Error applying plan:
1 error(s) occurred:
* kubernetes_deployment.frontend_php_fpm_deployment: 1 error(s) occurred:
* kubernetes_deployment.frontend_php_fpm_deployment: Failed to create deployment: Deployment.apps "toppy-webshop-frontend-php-fpm-deployment" is invalid: spec.template.spec.containers[0].envFrom: Invalid value: "": may not have more than one field specified at a time
I'm running into this issue as well. Is there currently a way to get it working or am I going to have to merge all my config into secrets
This one has definitely tripped me up a few times. The appropriate terraform practice here is to a define an env_from block for each reference you want to make, as env_from is itself a list.
env_from {
secret_ref {
name = "secret"
}
}
env_from {
config_map_ref {
name = "configmap"
}
}
I can see how how this would be a little surprising if you were using YAML before.
I just use pulumi now.
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!
Most helpful comment
Also allow usage of both
secret_refandconfig_map_reftogether.